From fa8edab9a3339f6243a673799cbcf38e8be6641e Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Mon, 10 Apr 2017 14:14:18 -0700 Subject: [PATCH] Update 5_2_Resending_a_Transaction_with_RBF.md --- 5_2_Resending_a_Transaction_with_RBF.md | 60 +++++++++++++++++++++---- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/5_2_Resending_a_Transaction_with_RBF.md b/5_2_Resending_a_Transaction_with_RBF.md index 0a3434b..3cbd6b9 100644 --- a/5_2_Resending_a_Transaction_with_RBF.md +++ b/5_2_Resending_a_Transaction_with_RBF.md @@ -8,7 +8,7 @@ If your Bitcoin transaction is stuck, and you're sender, you can resend it using ## Opt-In for RBF -RBF is an opt-in Bitcoin feature. Transactions are only eligible for using RBF if they've been created with a special RBF flag. This is done by setting their sequence number (which is typically set automatically, so that it's less than 0xffffffff-1. (4294967294). +RBF is an opt-in Bitcoin feature. Transactions are only eligible for using RBF if they've been created with a special RBF flag. This is done by setting their sequence number (which is typically set automatically, so that it's more than 0 and less than 0xffffffff-1. (4294967294). This is simply done by adding a `sequence` variable to the vins: ``` @@ -54,14 +54,58 @@ _Should I trust transactions with no confirmations?_ No, never. This was true be ### Optional: Always Opt-In for RBF -If you prefer, you can _always_ opt in for RBF. Do so by running your `bitcoind` with the `-walletrbf` command or simply adding it to your bitcoin.conf file: -``` -walletrbf=1 -``` -Once you've done this (and restarted your `bitcoind`), then all transactions should have a lower sequence number and be marked as `bip125-replaceable`. - -[[THIS NEEDS TO BE FURTHER TESTED; APPARENTLY DOESN'T WORK WITH walletrbf=1 ... haven't checked with the flag]] +If you prefer, you can _always_ opt in for RBF. Do so by running your `bitcoind` with the `-walletrbf` command. Once you've done this (and restarted your `bitcoind`), then all transactions should have a lower sequence number and be marked as `bip125-replaceable`. +Note the following example generated by `bitcoind`, which uses a sequence number of "1": +``` +{ + "txid": "d261b9494eb29084f668e1abd75d331fc2d6525dd206b2f5236753b5448ca12c", + "hash": "d261b9494eb29084f668e1abd75d331fc2d6525dd206b2f5236753b5448ca12c", + "size": 226, + "vsize": 226, + "version": 2, + "locktime": 0, + "vin": [ + { + "txid": "4075dbf84303c01adcb0b36cd2c164e2b447192c2d9fbf5fde3b99d0ac7e64b6", + "vout": 1, + "scriptSig": { + "asm": "3045022100b3a0d66abe3429f81a6dc397369d6ac9cb025a2243b68649d95665967fe4365b022038cf037aaab9368268e97203494d1b542e83101e6aaaf97957daf70dee6ee0af[ALL] 022615f4b6417b991530df4bc8c8ee10b8925c741773fead7a5edd89337caeba53", + "hex": "483045022100b3a0d66abe3429f81a6dc397369d6ac9cb025a2243b68649d95665967fe4365b022038cf037aaab9368268e97203494d1b542e83101e6aaaf97957daf70dee6ee0af0121022615f4b6417b991530df4bc8c8ee10b8925c741773fead7a5edd89337caeba53" + }, + "sequence": 1 + } + ], + "vout": [ + { + "value": 0.10000000, + "n": 0, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 e7c1345fc8f87c68170b3aa798a956c2fe6a9eff OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914e7c1345fc8f87c68170b3aa798a956c2fe6a9eff88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi" + ] + } + }, + { + "value": 0.90000000, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 20219e4f3c6bc0f6524d538009e980091b3613e8 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91420219e4f3c6bc0f6524d538009e980091b3613e888ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "miSrC3FvkPPZgqqvCiQycq7io7wTSVsAFH" + ] + } + } + ] +} +``` > **VERSION WARNING:** The walletrbf flag require Bitcoin Core v.0.14.0. ## Understand How RBF Works