RPC Browser


Command: extractsecret


Help Content for extractsecret
extractsecret "hextransaction" "secrethash"

The extractsecret command is used by the participant to extract the secret from the initiator's redemption transaction. With the secret known, the participant may claim the coins paid into the initiator's contract.

Argumets:
1. "hextransaction"  (string, required) The hex-encoded redemption transaction
2. "secrethash"      (string, required) The hex-encoded hash of redemption secret

Result:
{
  "secret"           (string) The hex-encoded secret for redemption
}

Examples:
> bitcoin-cli extractsecret "02000000019d06cfd5d6500bb810d726e07e4000f54076a11a3ea317ca2f2126baba95c8b600000000ef473044022001a1e090631efd01fa6a53fcc1a71b963f9096d35a8ec717771a8b0f3d240bd702203309b438b58dc990a09e820fd6d9110b331fefd5d4f2ee22c9ca4bb0b12d9daf412103089998f1ac124f16fb215f7d4cc5a428cc6acf5d7eddf1599f7a693409877f582062ad2f3179961e78e2851d5387622aa9faff6ae1266aeb5610de5f91ebb29471514c616382012088a8203fbf99fcb5690013e742991b5d43f62ac897ecb8494a33feaf6f76ff16b66d9f8876a914bc6999b404d7d393f13a242f03ebd40c17c08a676704fba4d95ab17576a91470231e7988280299558c1b5c0e83bcbe4df1c3156888acffffffff014ca8eb0b000000001976a9144536e14d69c8d3b0b090a02a2185a4238dcd226e88acfba4d95a" "3fbf99fcb5690013e742991b5d43f62ac897ecb8494a33feaf6f76ff16b66d9f"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "extractsecret", "params": ["02000000019d06cfd5d6500bb810d726e07e4000f54076a11a3ea317ca2f2126baba95c8b600000000ef473044022001a1e090631efd01fa6a53fcc1a71b963f9096d35a8ec717771a8b0f3d240bd702203309b438b58dc990a09e820fd6d9110b331fefd5d4f2ee22c9ca4bb0b12d9daf412103089998f1ac124f16fb215f7d4cc5a428cc6acf5d7eddf1599f7a693409877f582062ad2f3179961e78e2851d5387622aa9faff6ae1266aeb5610de5f91ebb29471514c616382012088a8203fbf99fcb5690013e742991b5d43f62ac897ecb8494a33feaf6f76ff16b66d9f8876a914bc6999b404d7d393f13a242f03ebd40c17c08a676704fba4d95ab17576a91470231e7988280299558c1b5c0e83bcbe4df1c3156888acffffffff014ca8eb0b000000001976a9144536e14d69c8d3b0b090a02a2185a4238dcd226e88acfba4d95a" "3fbf99fcb5690013e742991b5d43f62ac897ecb8494a33feaf6f76ff16b66d9f"] }' -H 'content-type: text/plain;' http://127.0.0.1:7332/
Execute Command: extractsecret

Atomicswaps (6)


Blockchain (22)


Control (6)


Generating (2)


Mining (5)


Minting (1)


Network (12)


Rawtransactions (8)


Util (6)


Wallet (48)