RPC Browser


Command: auditswap


Help Content for auditswap
auditswap "hexscript" "hextransaction"

The auditswap command inspects a contract script and parses out the addresses that may claim the output, the locktime, and the secret hash. It also validates that the contract transaction pays to the contract and reports the contract output amount. Each party should audit the contract provided by the other to verify that their address is the recipient address, the output value is correct, and that the locktime is sensible.

Argumets:
1. "hexscript"       (string, required) The hex-encoded contract
2. "hextransaction"  (string, required) The hex-encoded contract transaction

Result:
{
  "contractAddress"  (string) The Atom address of the swap contract
  "contractValue"    (numeric) The value for the swap
  "recipientAddress" (string) The recipient address
  "refundAddress"    (string) The address for refund
  "secretHash"       (string) The hash of redemption secret
  "locktime"         (numeric) The time for refund unlock
}

Examples:
> bitcoin-cli auditswap "6382012088a82085a6637bfc298b2623b94bfeacc8d491edfa0abf3d8bb1c0f2d3b5fa58ad17158876a914109cc30524c19942078ba4356d88e6ef2aa71b546704d408da5ab17576a91423905458d1f6ed5c1efdcf87c9e4e1bc4e57a7796888ac" "02000000000101ddbd704186145cc9dcd0b5356d3480efe9b70cf4f2b7d9c919bc6eb506724b0100000000171600143986c86ad67c57f62174d48f159f9de554ba1138feffffff02e0d3f505000000001976a914c929fc3aad535e0d60bb416cc4294a757e31743788ac00e1f5050000000017a91471301e862d2a4e3f01bac5d9255c4d4d81331d7a8702473044022039527fbf8e0a5926d5282138617e1efaec5b2324ddf907623fb185e278b7b71e02203ca51954c1bbccd53927015a384c0236fc5ed2ed5a977adbddaa1c5f7528208a4121022e2622378dc8b9395be551ebaec071fe16ea705d9b018bdecb92ac57e6152e85742d1400"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "auditswap", "params": ["6382012088a82085a6637bfc298b2623b94bfeacc8d491edfa0abf3d8bb1c0f2d3b5fa58ad17158876a914109cc30524c19942078ba4356d88e6ef2aa71b546704d408da5ab17576a91423905458d1f6ed5c1efdcf87c9e4e1bc4e57a7796888ac" "02000000000101ddbd704186145cc9dcd0b5356d3480efe9b70cf4f2b7d9c919bc6eb506724b0100000000171600143986c86ad67c57f62174d48f159f9de554ba1138feffffff02e0d3f505000000001976a914c929fc3aad535e0d60bb416cc4294a757e31743788ac00e1f5050000000017a91471301e862d2a4e3f01bac5d9255c4d4d81331d7a8702473044022039527fbf8e0a5926d5282138617e1efaec5b2324ddf907623fb185e278b7b71e02203ca51954c1bbccd53927015a384c0236fc5ed2ed5a977adbddaa1c5f7528208a4121022e2622378dc8b9395be551ebaec071fe16ea705d9b018bdecb92ac57e6152e85742d1400"] }' -H 'content-type: text/plain;' http://127.0.0.1:7332/
Execute Command: auditswap

Atomicswaps (6)


Blockchain (22)


Control (6)


Generating (2)


Mining (5)


Minting (1)


Network (12)


Rawtransactions (8)


Util (6)


Wallet (48)