RPC Browser


Command: redeemswap


Help Content for redeemswap
redeemswap "hexscript" "hextransaction" "secret"

The redeemswap command is performed by both parties to redeem coins paid into the contract created by the other party. Redeeming requires the secret and must be performed by the initiator first. Once the initiator's redemption has been published, the secret may be extracted from the transaction and the participant may also redeem their coins.

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

Result:
{
  "txid"             (string) The redemption transaction id encoded in little-endian hexadecimal
  "hex"              (string) The hex-encoded redemption transaction
  "Redeem fee"       (numeric) The amount of the redeem transaction fee in BTC
}

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

Atomicswaps (6)


Blockchain (22)


Control (6)


Generating (2)


Mining (5)


Minting (1)


Network (12)


Rawtransactions (8)


Util (6)


Wallet (48)