/build/rpc / cosign / session
cosign.adaptor_roundtrip
cosign.adaptor_roundtrip "session_id" "psbt" is_initiator Automate complete adaptor signature ceremony over cosign channel (Phase 4 §5.8). This is the PRIMARY ceremony helper that orchestrates all 3 phases: 1. PREPARE: Generate nonces/commitments, exchange via cosign 2. PARTIAL: Create partial signatures, exchange via cosign 3. COMPLETE: Finalize PSBT with adaptor signatures SECURITY: Handshake must be complete before calling (use cosign.handshake_auto first). IMPORTANT: Both parties must call this simultaneously (initiator and responder roles). Arguments: 1. session_id (string, required) Active cosign session ID (after handshake) 2. psbt (string, required) Partially Signed Bitcoin Transaction (base64) 3. is_initiator (boolean, required) Whether this party initiates ceremony Result: { (json object) "psbt" : "str", (string) Completed PSBT with all signatures (base64) "complete" : true|false, (boolean) Whether ceremony completed successfully "messages_sent" : n, (numeric) Number of messages sent "messages_received" : n (numeric) Number of messages received } Examples: Borrower (initiator) automates ceremony > bitcoin-cli cosign.adaptor_roundtrip "abc123..." "cHNidP8BA..." true Lender (responder) automates ceremony > bitcoin-cli cosign.adaptor_roundtrip "abc123..." "cHNidP8BA..." false
Signature
cosign.adaptor_roundtrip(session_id: string, psbt: string, is_initiator: boolean) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.adaptor_roundtrip","params":["\"<session_id>\"","\"<psbt>\"",false]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| session_id | string | yes | Active cosign session ID (after handshake) |
| psbt | string | yes | Partially Signed Bitcoin Transaction (base64) |
| is_initiator | boolean | yes | Whether this party initiates ceremony |
Result
Type: any
{ (json object) "psbt" : "str", (string) Completed PSBT with all signatures (base64) "complete" : true|false, (boolean) Whether ceremony completed successfully "messages_sent" : n, (numeric) Number of messages sent "messages_received" : n (numeric) Number of messages received }
Source: services/core-node/bcore/src/rpc/cosign.cpp:1442
C++ symbol: cosign_adaptor_roundtrip