Language

Choose a language

/build/rpc / cosign / session

cosign.handshake_auto

cosign.handshake_auto "session_id" ( is_initiator ) Automatically complete SPAKE2 + Noise handshake over the established transport. This method handles the entire handshake flow automatically: 1. Generate and exchange SPAKE2 messages 2. Derive shared secret 3. Exchange Noise handshake messages 4. Establish encrypted channel After this completes successfully, cosign.send and cosign.recv are enabled. SECURITY: No unencrypted/unauthenticated traffic is allowed (Phase 4 requirement). Arguments: 1. session_id (string, required) Session ID 2. is_initiator (boolean, optional) Whether this party initiates handshake (default: false for join, true for init) Result: { (json object) "handshake_complete" : true|false, (boolean) Whether handshake completed successfully "sas" : "str", (string) 5-word SAS for user verification "sas_numeric" : "str", (string) 6-digit numeric SAS "message" : "str" (string) Success message } Examples: After init (as initiator) > bitcoin-cli cosign.handshake_auto "abc123..." true After join (as responder) > bitcoin-cli cosign.handshake_auto "abc123..." false

Signature

cosign.handshake_auto(session_id: string, is_initiator?: boolean) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.handshake_auto","params":["\"<session_id>\"",false]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
session_idstringyesSession ID
is_initiatorbooleanWhether this party initiates handshake (default: false for join, true for init)

Result

Type:  any

{ (json object) "handshake_complete" : true|false, (boolean) Whether handshake completed successfully "sas" : "str", (string) 5-word SAS for user verification "sas_numeric" : "str", (string) 6-digit numeric SAS "message" : "str" (string) Success message }

Source: services/core-node/bcore/src/rpc/cosign.cpp:1648

C++ symbol: cosign_handshake_auto