/build/rpc / contracts / spot
spot.add_commitment_proof
spot.add_commitment_proof "psbt" "id" Add ICU decryption commitment proof OP_RETURN to a joined spot atomic swap PSBT. This proves the calling party can decrypt the counterparty's holder-only asset before signing. Each party calls this independently to add their own commitment proof. Format: OP_RETURN SHA256(canonical_text || my_receive_address) Arguments: 1. psbt (string, required) Base64-encoded PSBT (should be joined from both parties) 2. id (string, required) Spot offer identifier Result: { (json object) "psbt" : "str", (string) Base64-encoded PSBT with commitment proof added "commitment_hash" : "hex", (string) The commitment hash added to OP_RETURN "commitment_preimage_info" : "str", (string) Description of preimage: canonical_text || receive_address "canonical_text" : "str" (string, optional) Decrypted canonical ICU text (UTF-8), for UI preview only } Examples: > bitcoin-cli spot.add_commitment_proof "cHNidP8BA..." "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Signature
spot.add_commitment_proof(psbt: string, id: string) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"spot.add_commitment_proof","params":["\"<psbt>\"","\"<id>\""]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| psbt | string | yes | Base64-encoded PSBT (should be joined from both parties) |
| id | string | yes | Spot offer identifier |
Result
Type: any
{ (json object) "psbt" : "str", (string) Base64-encoded PSBT with commitment proof added "commitment_hash" : "hex", (string) The commitment hash added to OP_RETURN "commitment_preimage_info" : "str", (string) Description of preimage: canonical_text || receive_address "canonical_text" : "str" (string, optional) Decrypted canonical ICU text (UTF-8), for UI preview only }
Source: services/core-node/bcore/src/wallet/rpc/contracts.cpp:9562
C++ symbol: spot_add_commitment_proof