blockchaincommons / learning-bitcoin-from-the-command-line Goto Github PK
View Code? Open in Web Editor NEWA complete course for learning Bitcoin programming and usage from the command
A complete course for learning Bitcoin programming and usage from the command
To look at all the keys in your wallet, type bitcoin-cli dumpwallet mywallet.txt. This will create a mywallet.txt file in your current directory with a long list of private keys, addresses, and other information.
However, this command places mywallet.txt in the user's home directory.
I am using your tutorial to try and create a raw transaction and am following everything to the T. I am using swift and am able to list unspent outputs and get a change a address with no issues. However I get the parse error when creating the raw transaction, I have tried many different syntaxes but always get an error, I have triple checked the addresses and amounts corresponding to the UTXO. Any advice would be greatly appreciated, here is the code that is giving me the error:
{"jsonrpc":"1.0","id":"curltest","method":"createrawtransaction","params":[''[{"txid":"515fa300542890ce3f63fa092ce0ba871c5897a123831b1557555878dde639d4","vout":0}]'', ''{"mm8xEm6YS8B7ErLYYqcdF6URWkS1BWnqtY":0.0001, "2N7rCmXqXiBPbHKRv1H31gAGf4QKZB1UVNb":0.79988325}'']}
and here is the error:
error = { code = "-32700"; message = "Parse error"; }
Hello,
The second half of the btcblock alias does not seem to be working for me:
alias btcblock="echo \`bitcoin-cli getblockcount 2>&1\`/\`wget - http://blockexplorer.com/testnet/q/getblockcount 2> /dev/null | cut -d : -f2 | rev | cut -c 2- | rev\`"
The getblockcount seems to work but the results I receive when I run the alias is "x/ " where x is the number of blocks on the longest chain. There is not input after "/".
Please advise.
~# btcinfo
"balance": 0.00000000,
error code: -32601
error message:
getinfo
This call was removed in version 0.16.0. Use the appropriate fields from:
bitcoin-cli has the option -getinfo to collect and format these in the old format.
We should probably rename those pages without a leading zero with a zero, so that they sort properly in the github view and via ls.
Hi, I am offering to contribute a Chinese translation. Anyway to get started?
Since a new major version of Bitcoin Core is released 0.16.0, I was wondering if there's any plans to upgrade these tutorials. I'm starting a branch off of my [fork] (https://github.com/yashbhutwala/Learning-Bitcoin-from-the-Command-Line/tree/0.16), reviews are welcomed. PR #34.
can you also add some chapters on how to use segwit transactions using bitcoin-cli or curl?
I want to generate a 2-3 multisig address, and pay to it.
locking script: RIPEMD160<Hash256<2 PK1 PK2 PK3 3 OP_CHECKMULTISIG>>
root@ubuntu:~# bitcoin-cli -testnet getnewaddress
2Mv3bjnJv2XtDjAvjYfKjwXBHCmojCiu3mz
root@ubuntu:~# bitcoin-cli -testnet dumpprivkey 2Mv3bjnJv2XtDjAvjYfKjwXBHCmojCiu3mz
cPegPf2xaeaqYB9kqqM2gzVPPXnAmwCME2KjsAQG6gkVnbxZpTKo
root@ubuntu:~# bitcoin-cli -testnet getnewaddress
2MsJ1eKdVZrYLptCLGNrvuTvVjVQzR2FR5o
root@ubuntu:~# bitcoin-cli -testnet dumpprivkey 2MsJ1eKdVZrYLptCLGNrvuTvVjVQzR2FR5o
cQ8ZUeBy27NKafYioHp4f3isHFTFuAx65vPf6dgUgxdNSBegsW3W
root@ubuntu:~# bitcoin-cli -testnet getnewaddress
2N4fwyEsVN9Lowja9ab5ek4R3yck3PmasdN
root@ubuntu:~# bitcoin-cli -testnet dumpprivkey 2N4fwyEsVN9Lowja9ab5ek4R3yck3PmasdN
cVTFSWeeeB9uoKZgcCbCN7eovztbQzNySGsruAFrVSiiX8ogMqtJ
root@ubuntu:~# bitcoin-cli -testnet addmultisigaddress 2 "[\"2Mv3bjnJv2XtDjAvjYfKjwXBHCmojCiu3mz\",\"2MsJ1eKdVZrYLptCLGNrvuTvVjVQzR2FR5o\", \"2N4fwyEsVN9Lowja9ab5ek4R3yck3PmasdN\"]" "test account"
{
"address": "2MwgnLokB4WA9NLNd6yL36AvPHHVChDh5r3",
"redeemScript": "522102f396b11941706b0424499fbf679c3e5987a8d2bf5b47116ec60ceb4f71804d46210256c0ec8ee73ba5fff9b12910880c12be9ff7d15f1f1b5d64685c3bcbdeb6734d210269321ca40da82f1fb8da8932b25beb96b4a84e6af593e89ee64e4c3f867eb7b553ae"
}
If call validateaddress
, get this:
root@ubuntu:~# bitcoin-cli -testnet validateaddress 2MwgnLokB4WA9NLNd6yL36AvPHHVChDh5r3
{
"isvalid": true,
"address": "2MwgnLokB4WA9NLNd6yL36AvPHHVChDh5r3",
"scriptPubKey": "a91430b5e8e9151e46be789562580b0118911d875f3d87",
"isscript": true,
"iswitness": false
}
sendtoaddress
to send 0.527 BTC to 2MwgnLokB4WA9NLNd6yL36AvPHHVChDh5r3
root@ubuntu:~# bitcoin-cli -testnet sendtoaddress 2MwgnLokB4WA9NLNd6yL36AvPHHVChDh5r3 0.527
5332ed1482e665c6f7146283991ad69c05af99cfebab344729d54b382f68a46c
The following command (chapter 6_1_Sending_a_Transaction_to_a_Multisig) can not be executed because env variable $address1 is an address and not a pub key:
machine1$ bitcoin-cli -named createmultisig nrequired=2 keys='''["'$address1'","0367c4f666f18279009c941e57fab3e42653c6553e5ca092c104d1db279e328a28"]'''
Therefore $address1 should be changed to the pubkey of address1 (same as with address2).
Hi,
I read this https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/08_4_Scripting_a_Multisig.md.It is good.
I am working on creating simple p2sh script. But first round of validation can be done easily. Can you please tell about how to do the second round of validation that is deserializing the redeemscript and combine with the operands and do the operation?
Because when we give a scriptsig for a locking script, some of the values will be pushed on to stack initially follwed by whole redeemscript pushed as element into the stack. In that case, how will you deserialize and verify the internal script?
I don't think[1] this works with Bitcoin Core 0.16.0 and above because its wallet defaults to using P2SH-wrapped segwit and segwit requires passing the value of each input being signed to signrawtransaction. For more information, please see this related issue: bitcoin-dot-org/Bitcoin.org#2538
[1] I don't see where in the tutorial it explains to the user how to get an address, so I'm assuming they're just getting whatever address the wallet returns by default, which would be P2SH-wrapped segwit in 0.16.0 and above. If the docs don't already explain how to get an address and I just missed it, I'd suggest that you make that explicit.
Hello,
I am aware you are using debian, but I think many people will follow this on their standard linux distro. Ubuntu (16.04) is not reading from bash_profile properly but instead from bashrc (at least in the desktop enviroment, might work at a login shell), so writing the aliases won't work in ubuntu (used here: https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/02_1_Setting_Up_a_Bitcoin-Core_VPS_by_Hand.md and https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/03_1_Verifying_Your_Bitcoin_Setup.md)
You might consider adding something like ('use ~/.bashrc instead of ~/.bash_profile on ubuntu')
Hello, I have been going through the steps, and tried signing a message per the steps, and I get the Address does not refer to key errorl
Hello, I am new here.
I am experimenting with a full node, and setup a new node on ubuntu - Core 0.16.0.
I'm running my bitcoind in test-net
I'm running a test-net bitcoin daemon.
Whenever I try to sign a message with my pub key, it shows this error
Steps:
bitcoin-cli getnewaddress
--> It produced an address: 2N2yv1XcYfNXR54J7ZJvBxY6ZnmZFbz89tm
bitcoin-cli signmessage "2N2yv1XcYfNXR54J7ZJvBxY6ZnmZFbz89tm" "Hello there"
--> Get following error
error code: -3
error message:
Address does not refer to key
This is pretty vanilla functionality - why is this happening and how to address?
Thank you in advance
Hello!
There is an error in Understand If/Then Ordering
Actual
The owner of <privKeyA> would put <signatureA> <pubKeyA> True in his locking script, while the owner of <privKeyB> would put <signatureB> <pubKeyB> False in her locking script.
Expected
The owner of <privKeyA> would put <signatureA> <pubKeyA> True in his unlocking script, while the owner of <privKeyB> would put <signatureB> <pubKeyB> False in her unlocking script.
Hi, Is there a french version of this documentation ?
If the answer is no, what do you think if I make it ?
Regards,
Denis
This does not currently work:
$ btcdeb $(btcc OP_1 OP_2 OP_ADD)
because $ btcc OP_1 OP_2 OP_ADD
returns 515293
$ btcdeb 515293
btcdeb -- type `btcdeb -h` for start up options
warning: ambiguous input 515293 is interpreted as a numeric value; use 0x515293 to force into hexadecimal interpretation
invalid script
Which can be fixed using $ btcdeb 0x515293
But, suggest using this notation as shown in btcdeb docs
$ btcdeb '[OP_1 OP_2 OP_ADD]'
There should probably be at the beginning and end of each page a link to the previous doc and the next doc, that are local links that work correctly with github. Pages should be renamed first, as per #1.
Using Bitcoin Core 0.16.2. In the file here, your btcinfo
alias no longer works. I get:
This call was removed in version 0.16.0. Use the appropriate fields from:
- getblockchaininfo: blocks, difficulty, chain
- getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings
- getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion
Hi Christopher,
I have just started to follow your tutorial for an intro to Bitcoin and I think it's awesome.
Right now, my Bitcoin daemon is downloading the blocks (testnet). However, I notice that after downloading about 600,000 out of 1,355,036 blocks, the server got disconnected. Only upon running the command btcblock
do I get the following message:
error: couldn't connect to server: unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)/1355033
I have tried restarting the daemon and the download, and even rebooted my VPS, but I will always get to the same error. Any tips on this?
I am following along on section 4.1 and when I try to do:
bitcoin-cli sendtoaddress [address] [amount]
Everything seems to work fine but my transaction stays with 0 confirmations (over 24 hours now). When I check the transaction the way the tutorial suggests everything looks the same.
{
"amount": -0.10000000,
"fee": -0.00022400,
"confirmations": 0,
"trusted": false,
"txid": "888e82fc464e6f520ffd016aadbc1aeeb52c69ca51faf57f3573ec5c90be1a9c",
"walletconflicts": [
"e8a1ea84e968bc1e4cd04e9f762e5145e3c620bd70d250ce422df71d32c00d48",
"aad4eb89a13fd92268363e18f4e92cd890622e58494ff1179df579a4edff6bef"
],
"time": 1511656829,
"timereceived": 1511656829,
"bip125-replaceable": "unknown",
"details": [
{
"account": "",
"address": "2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF",
"category": "send",
"amount": -0.10000000,
"vout": 0,
"fee": -0.00022400,
"abandoned": false
}
],
"hex": "020000000151dd79ce6ffc47739b17e5f984942eab0e48d6243a09ca4136bf8730c0d5b099000000006a4730440220212b8fbfdd7119dbb7473dad2493b4e40c7a82dc1b463075030242a8d97556770220300fc6be4d446fef32a448a2e372982933bdc3a8a6f00119c5b0869b5bcefe430121026910802d0ac183a6195f5bac6dd9e9d613dbe2fe96275cfbe2884bdc4a1a8a53feffffff02809698000000000017a914a9974100aeee974a20cda9a2f545704a0ab54fdc8780b62607000000001976a9142c674fa2afe460ad7eaf0d9dd97c85461966fd7688ac2df11200"
}
I also expected to see my transaction in the mempool of my node but that just returns an empty array. When I pass true to bitcoin-cli getrawmempool true
I get an empty json object.
I am wondering if there is something that would prevent my node from broadcasting transactions? Or if my mempool is somehow set up wrong?
Great tutorial, it's thought me a lot so far. I will just move to the next sections and hopefully figure this out later. Cheers.
The following command export BITCOIN=bitcoin-core-0.16.2
causes
$ wget https://bitcoin.org/bin/$BITCOIN/$BITCOINPLAIN-x86_64-linux-gnu.tar.gz -O ~user1/$BITCOINPLAIN-x86_64-linux-gnu.tar.gz
$ wget https://bitcoin.org/bin/$BITCOIN/SHA256SUMS.asc -O ~user1/SHA256SUMS.asc
to fail.
The solution is to navigate to https://bitcoin.org/bin/ and find a bitcoin version that exists and rerun the export variable command.
EG: export BITCOIN= bitcoin-core-0.16.3
Blockchains probably will not be helpful if:
Users are trusted:
e.g.: transactions occur within a business or organization.
e.g.: transactions are overseen by a central authority.
Secrecy is required:
e.g.: Information should be secret.
e.g.: **Transactions should be secret.**
e.g.: *Transactors should be secret.**
Users **need instant transaction finality, in less than an hour.**
so you are saying blockchains like zcash or cryptonote shouldn't use a blockchain?
Also isn't litecoin and ethereum blocks are faster than (6 blocks * 10mins)
or is this just opinion? (sincere question by a noob)
Signmessage won't work because of the segwith update. More info about this here: https://bitcointalk.org/index.php?topic=3225732.msg33564199
A workarround is to create a newaddress by adding legacy behind the command, like:
bitcoin-cli -testnet getnewaddress "" legacy
The signrawtransaction
command no longer works using default setting in the latest bitcoin core version v0.17.
signrawtransaction is deprecated and will be fully removed in v0.18. To use signrawtransaction in v0.17, restart bitcoind with -deprecatedrpc=signrawtransaction.
Projects should transition to using signrawtransactionwithkey and signrawtransactionwithwallet before upgrading to v0.18
These sections should be converted to use signrawtransactionwithwallet
4.2 Creating a Raw Transaction
4.3 Creating a Raw Transaction with Named Arguments
4.5: Sending Coins with Automated Raw Transactions
In Understanding the Bitcoin Transaction https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/04_2_Creating_a_Raw_Transaction.md#understand-the-bitcoin-transaction
there is a sentence that doesn't quite make sense.
For now, we won't worry about that, but the creation of a change address will be what turns the theory of this section until the actual use of the next subsection.
Not sure what it means to "turns the theory of this section until the actual use".
However, if the 32nd bit needs to be 0 for relative timelock, would that not imply that we cannot have 0xf as as the first hexadecimal character?
0x f000 0000 - 1 = 0x efff ffff. This translates to (1110) for the first hex character f, which would flag the 32nd bit.
0111 1111 .... 5 times (1111).... 1111 = 7fff ffff
Instead, the hexadecimal notation should be 0x00000001 to 0x7fffffff?
If I am wrong, help me understand what am I missing out here?
validateaddress
doesn't return a pubkey
field anymore (stackexchange).
You should probably use getaddressinfo
for this step instead
In the chapter:
4.5: Sending Coins with Automated Raw Transactions
$ unfinishedtx=$(bitcoin-cli -named createrawtransaction inputs='''[]''' outputs='''{ "'$recipient'": 1.0 }''')
What's the meaning of triple single quotes like '''[]''' ?
Clicking the link in the sentence
Again, remember that you can look at this transaction using a blockchainexplorer:
https://live.blockcypher.com/btc-testnet/tx/3a62b396afb8d8a59ebe7b9e52d6aa2485f1082a1d3fc6ece61fb8b55373823d/
gives a page with the error message.
No transaction found with the hash 3a62b396afb8d8a59ebe7b9e52d6aa2485f1082a1d3fc6ece61fb8b55373823d
I expected this to lead to a page with transaction information.
The next link in the section leads to a page with transaction information as expected.
Thanks for this wonderful repo. Such an exciting place to learn about bitcoin in a linear fashion.
I have been following Chap 3 meticulously via the Linode VPS but have noticed that the setup variables instructions use export
which to me preserves both variables only across sub-shells. If I logout, log back in and try echo $BITCOIN
, it returns blank. The crontab entry to start the bitcoin daemon whenever the VPS restarts also won't work unless I go through the setup variables instructions again. Am I missing something?
I tried my own transaction using the testnet. i first looked at my first unspent output and used that to send a new transaction to the testnet.
"txid": "8442b25c5bef594d55adf80e23e5fa320af000c67269837b641a0621863ab428",
"hash": "8442b25c5bef594d55adf80e23e5fa320af000c67269837b641a0621863ab428",
"version": 2,
"size": 224,
"vsize": 224,
"locktime": 0,
"vin": [
{
"txid": "2f3359c635079cf03e07ee477d967df40bf2a7f49a9d85259d0b5f7013493190",
"vout": 1,
"scriptSig": {
"asm": "3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95da2723b74313022073c0a33890737417b71c4db905fd83f17c137c0548b6b5003a0d6fa0a94a4e20[ALL] 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22",
"hex": "483045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95da2723b74313022073c0a33890737417b71c4db905fd83f17c137c0548b6b5003a0d6fa0a94a4e20012103dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.19750000,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 a9974100aeee974a20cda9a2f545704a0ab54fdc OP_EQUAL",
"hex": "a914a9974100aeee974a20cda9a2f545704a0ab54fdc87",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF"
]
}
},
{
"value": 0.19550000,
"n": 1,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 9dae41748a7596237428b9541d593429e4ef26b1 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9149dae41748a7596237428b9541d593429e4ef26b188ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"muth8fjUhvXAu1QZdmygf5wzVBXeUviPcD"
]
}
}
]
}
i waited for this to get confirmed to recieve a new value of 0.1955 to my wallet. This 0.19555 became a new unspent utxo. i then used this transaction to send to the testnet again
{
"txid": "1a3851e8cc9ee0c959de0494aa8293e206f716a98fb7d9b5d6da6652160ddb9e",
"hash": "1a3851e8cc9ee0c959de0494aa8293e206f716a98fb7d9b5d6da6652160ddb9e",
"version": 2,
"size": 223,
"vsize": 223,
"locktime": 0,
"vin": [
{
"txid": "8442b25c5bef594d55adf80e23e5fa320af000c67269837b641a0621863ab428",
"vout": 1,
"scriptSig": {
"asm": "3044022017b3b13af64945fa14eacea7c20602a8b585294659d353f90e47b080272c1bd0022021e4cc87e5d480c256f269ff95d955a30b2039820f2466b166719879421be6a3[ALL] 02ad4fc1f35861f4853fbeceda57da004cadee4a5b4f4367deb52c2c133b2df40d",
"hex": "473044022017b3b13af64945fa14eacea7c20602a8b585294659d353f90e47b080272c1bd0022021e4cc87e5d480c256f269ff95d955a30b2039820f2466b166719879421be6a3012102ad4fc1f35861f4853fbeceda57da004cadee4a5b4f4367deb52c2c133b2df40d"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.09775000,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 a9974100aeee974a20cda9a2f545704a0ab54fdc OP_EQUAL",
"hex": "a914a9974100aeee974a20cda9a2f545704a0ab54fdc87",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF"
]
}
},
{
"value": 0.09575000,
"n": 1,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 f1510b435c94daff54e9018f6c1836c9a2a80291 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914f1510b435c94daff54e9018f6c1836c9a2a8029188ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"n3WvEKZGqCozMVyUgWid2xHn25yWyEuiSE"
]
}
}
]
}
i then run the script debugger. I think I'm confused which transaction to append to one another.
btcdeb 483045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95da2723b74313022073c0a33890737417b71c4db905fd83f17c137c0548b6b5003a0d6fa0a94a4e20012103dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d2276a9149dae41748a7596237428b9541d593429e4ef26b188ac
btcdeb -- type `btcdeb -h` for start up options
valid script
7 op script loaded. type `help` for usage information
script | stack
-------------------------------------------------------------------+--------
3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95d... |
03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22 |
OP_DUP |
OP_HASH160 |
9dae41748a7596237428b9541d593429e4ef26b1 |
OP_EQUALVERIFY |
OP_CHECKSIG |
#0001 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95da2723b74313022073c0a33890737417b71c4db905fd83f17c137c0548b6b5003a0d6fa0a94a4e2001
btcdeb> step
<> PUSH stack 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95da2723b74313022073c0a33890737417b71c4db905fd83f17c137c0548b6b5003a0d6fa0a94a4e2001
script | stack
-------------------------------------------------------------------+-------------------------------------------------------------------
03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22 | 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95d...
OP_DUP |
OP_HASH160 |
9dae41748a7596237428b9541d593429e4ef26b1 |
OP_EQUALVERIFY |
OP_CHECKSIG |
#0002 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
btcdeb> step
<> PUSH stack 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
script | stack
-------------------------------------------------------------------+-------------------------------------------------------------------
OP_DUP | 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
OP_HASH160 | 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95d...
9dae41748a7596237428b9541d593429e4ef26b1 |
OP_EQUALVERIFY |
OP_CHECKSIG |
#0003 OP_DUP
btcdeb> step
<> PUSH stack 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
script | stack
-------------------------------------------------------------------+-------------------------------------------------------------------
OP_HASH160 | 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
9dae41748a7596237428b9541d593429e4ef26b1 | 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
OP_EQUALVERIFY | 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95d...
OP_CHECKSIG |
#0004 OP_HASH160
btcdeb> step
<> POP stack
<> PUSH stack 79c4a0649c807b4393ea3fe8c1c69f9b58c69457
script | stack
-------------------------------------------------------------------+-------------------------------------------------------------------
9dae41748a7596237428b9541d593429e4ef26b1 | 79c4a0649c807b4393ea3fe8c1c69f9b58c69457
OP_EQUALVERIFY | 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
OP_CHECKSIG | 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95d...
#0005 9dae41748a7596237428b9541d593429e4ef26b1
btcdeb> step
<> PUSH stack 9dae41748a7596237428b9541d593429e4ef26b1
script | stack
-------------------------------------------------------------------+-------------------------------------------------------------------
OP_EQUALVERIFY | 9dae41748a7596237428b9541d593429e4ef26b1
OP_CHECKSIG | 79c4a0649c807b4393ea3fe8c1c69f9b58c69457
| 03dd0441340a9dcf400210fd72065e6582f08fae540a39132f122b097c621e7d22
| 3045022100e3262f186304c78fbf62cc34a94a8ddf8dbc3b0844c393ed7f95d...
#0006 OP_EQUALVERIFY
btcdeb> step
<> POP stack
<> POP stack
<> PUSH stack
error: Script failed an OP_EQUALVERIFY operation
Hi I tried to follow the setting up guide but I was not able to get it to work on Debian 10 on digital ocean.
I was however able to successfully follow this https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-10
this
https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1
and I also found this
https://github.com/jtesta/ssh-audit
Maybe its time to update the guide?
What is currently in Section 2.1 is really complicated IMO.
@kallewoof has written a better Bitcoin Script debugging tool at https://github.com/kallewoof/btcdeb — we should re-write chapter 7 to use it.
@shannona, what do you think? @luke-jr can you review Kalle's code?
Hey! I have read this tutorial: https://support.bitpay.com/hc/en-us/articles/115002990903-How-can-I-recover-funds-from-a-Bitcoin-Core-wallet-dat-file-without-having-the-entire-blockchain-downloaded-
I am trying to recover some funds transfered to my bitcoin core wallet without having to wait several days. There are many blockchains to be downloaded (only 4% in 3 days)
What to do? I can't sign the raw transaction. The system gives the following message:

signrawtransaction is deprecated and will be fully removed in v0.18. To use signrawtransaction in v0.17, restart bitcoind with -deprecatedrpc=signrawtransaction.
Projects should transition to using signrawtransactionwithkey and signrawtransactionwithwallet before upgrading to v0.18 (code -32)
I could, however, create the raw transaction.
I just need to sign the transaction and send it.
I already tried to import the private key in a blockchain account, but the balance is still "not spendable"
Inspired by something this repository does I want to propose adding emoji to the various blockquotes in order to make them stand out more (... than just the bold signal word). Another example of where this can be really beneficial is e.g. Chapter 6 section 4 Write our Transaction where at the end two consecutive blockquotes appear. Without the emoji this may appear as a single thing, and the emoji can help readers more easily distinguish between the two.
In the table below I present a preview of what I mean, compared to the current situation, with examples from various chapters. Of course, the emojis I picked are also up for debate.
I'm curious to hear what peoples opinions are about adding this to this project.
Current | Updated | Source |
---|---|---|
|
|
Chapter 3.1 |
|
|
Chapter 3.1 |
|
|
Chapter 4.3 |
|
|
Chapter 3.1 |
As for the Sequence note (e.g. in Chapter 4 section 2 Verify Your Raw Transaction) I'm really lost on what emoji should be used (and related to the last part of this issue, if it should even be a blockquote).
Related to this, I feel like the "M-OF-N VS N-OF-N" blockqoute in (e.g.*) chapter 6 section 1 Create the Addres is inconsistent with other usages of block quotes. But that might just be me 😄
* there is a similar one in Chapter 6 section 2
The old command for getting the public key of an address is described in Chapter 06_01:
machine2$ bitcoin-cli -named validateaddress address=$address2
The new command since 0.17.0 would be:
machine2$ bitcoin-cli -named getaddressinfo address=$address2
Hello,
I noticed a small typo in a shell command, in 9.3: Using CSV in Scripts, paragraph create-a-csv-relative-time.
Actual
Finally, bitwise-or the 23rd bit into the hex value you created:
$ relativevalue=$(printf '%x\n' $((0x$hexvalue | 0x400000)))
$ echo $relativevalue
4224679
Expected
Finally, bitwise-or the 23rd bit into the hex value you created:
$ relativevalue=$(printf '%d\n' $((0x$hexvalue | 0x400000)))
$ echo $relativevalue
4224679
It should be %d\n
to get a decimal value.
when will this part get completed? approximate date? and right now I wanted some way to connect with the bitcoin using python. Do u have something in mind I can start from?
In chapter 5 https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/05_0_Controlling_Bitcoin_Transactions.md#chapter-five-controlling-bitcoin-transactions , it uses CBF and CPFP without explaining what they are. They get de-referenced in the next chapter, but on this page there was definitely a moment of confusion wondering what these terms are.
gpg: directory '/home/user1/.gnupg' created
gpg: keybox '/home/user1/.gnupg/pubring.kbx' created
gpg: cannot open '/dev/tty': No such device or address
SHASIG is
VERIFICATION ERROR: Signature for Bitcoin did not verify!
VERIFICATION SUCCESS / SHA: 9d6b472dc2aceedb1a974b93a3003a81b7e0265963bd2aa0acdcb17598215a4f
$ integer=1546288031
$ hex=$(printf '%08x\n' $integer | sed 's/^\(00\)*//')
$ echo $hex
I have done a blog post of the steps it took me to set up a Testnet node on AWS here. You are free to incorporate it into the eBook.
Im not an expert yet, but trying to get into the technical and developing side of blockchain. I would like to know why we shoud use a cloud provider while following your steps instead of using your local machine at home? cloud provider costs, thats why i am asking
thanks in advance,
jp
In this section we use importaddress
to load our multisignature address into the bitcoin wallet. I looked at the docs for inputaddress
and it said this:
If you have the full public key, you should call importpubkey instead of this
Are we able to get the multisig pubkey and use importpubkey
?
Hi there,
In part Understand How CSV Really Works
of passage 9.3: Using CSV in Scripts
CSV has many of the same subtleties in usage as CLTV:
- The nVersion field must be set to 2 or more.
- The nSequence field must be set to less than 0xf0000000.
- When CSV is run, there must be an operand on the stack that's between 0 and 0xf0000000-1.
- Both the stack operand and nSequence must have the same value on the 23rd bit.
- The nSequence must be greater than or equal to the stack operand.
Value 0xf0000000
in the 2nd and 3rd tip, I think it should be 0x80000000
For my understanding
nSequence = 0xffffffff
, no timelock0x80000000 <= nSequence < 0xffffffff
, indicates absolute timelock, nLocktime
or CLTV
, usually set to 0xfffffffe
nSequence < 0x800000000
, indicates relative timelock, nSequence
or CSV
Please help confirm this or correct me if I got wrong. Thanks 😄
In 03_4_Receiving_a_Transaction.md, it states
Though the addresses are fairly private, transactions can be examined as they go in and out of addresses. This makes the funds ultimately fungible and makes the privacy vulnerable to statistical analysis.
Is it really the visibility of transactions that makes the funds fungible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.