mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-09-08 16:37:32 +00:00
Compare commits
8 Commits
bea17662dd
...
2c7301f91b
Author | SHA1 | Date | |
---|---|---|---|
|
2c7301f91b | ||
|
0cadc9b8dc | ||
|
598791eff3 | ||
|
9d1282bdea | ||
|
f95809a912 | ||
|
8a2a6955ff | ||
|
aaa618699c | ||
|
f07ae7b521 |
@ -45,15 +45,13 @@ You can do this by looking at a blocknet explorer, such as [the Blockcypher Test
|
|||||||
|
|
||||||
If you'd like an alias to look at everything at once, the following currently works for Testnet, but may disappear at some time in the future:
|
If you'd like an alias to look at everything at once, the following currently works for Testnet, but may disappear at some time in the future:
|
||||||
```
|
```
|
||||||
$ cat >> ~/.bash_profile << EOF
|
$ echo "alias btcblock='echo \$(bitcoin-cli -testnet getblockcount)/\$(curl -s https://blockstream.info/testnet/api/blocks/tip/height)'" >> .bash_profile
|
||||||
alias btcblock="echo \\\`bitcoin-cli -testnet getblockcount 2>&1\\\`/\\\`wget -O - https://blockstream.info/testnet/api/blocks/tip/height 2> /dev/null | cut -d : -f2 | rev | cut -c 1- | rev\\\`"
|
|
||||||
EOF
|
|
||||||
$ source .bash_profile
|
$ source .bash_profile
|
||||||
$ btcblock
|
$ btcblock
|
||||||
1804372/1804372
|
1804372/1804372
|
||||||
```
|
```
|
||||||
|
|
||||||
> :link: **TESTNET vs MAINNET:** Remember that this tutorial generally assumes that you are using testnet. If you're using the mainnet instead, you can retrieve the current block height with: `wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`. You can replace the latter half of the `btcblock` alias (after `/`) with that.
|
> :link: **TESTNET vs MAINNET:** Remember that this tutorial generally assumes that you are using testnet. If you're using the mainnet instead, you can retrieve the current block height with: `curl -s https://blockchain.info/q/getblockcount`. You can replace the latter half of the `btcblock` alias (after `/\$(`) with that.
|
||||||
|
|
||||||
If you're not up-to-date, but your `getblockcount` is increasing, no problem. Total download time can take from an hour to several hours, depending on your setup.
|
If you're not up-to-date, but your `getblockcount` is increasing, no problem. Total download time can take from an hour to several hours, depending on your setup.
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
To date, we've been interacting with Bitcoin at a relatively high level of abstraction. The `bitcoin-cli` program offers access to a variety of RPC commands that support the creation and control of raw Bitcoin transactions that include funds, data, timelocks, and multisigs.
|
To date, we've been interacting with Bitcoin at a relatively high level of abstraction. The `bitcoin-cli` program offers access to a variety of RPC commands that support the creation and control of raw Bitcoin transactions that include funds, data, timelocks, and multisigs.
|
||||||
|
|
||||||
However, Bitcoin offers much more complexity than that. It includes a simple scripting language that can be used to create even more complex redemption conditions. If multisigs and timelocks provided the bases of Smart Contracts, then Bitcoin Script builds high on that foundation. It's the next step in empowering Bitcoin.
|
However, Bitcoin offers much more complexity than that. It includes a simple scripting language that can be used to create even more complex redemption conditions. If multisigs and timelocks provided the basis of Smart Contracts, then Bitcoin Script builds high on that foundation. It's the next step in empowering Bitcoin.
|
||||||
|
|
||||||
## Objectives for This Chapter
|
## Objectives for This Chapter
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ These were generally problems with any sort of complex Bitcoin script, but they
|
|||||||
|
|
||||||
## Create a P2SH Multisig
|
## Create a P2SH Multisig
|
||||||
|
|
||||||
P2SH multisigs are the modern methodology for creating multisigs on the Blockchains. They can be created very simply, using the same process seen in the previous sections.
|
P2SH multisigs are the modern methodology for creating multisigs on the Blockchain. They can be created very simply, using the same process seen in the previous sections.
|
||||||
|
|
||||||
### Create the Lock for the P2SH Multisig
|
### Create the Lock for the P2SH Multisig
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ But we'll usually abtract it like this:
|
|||||||
|
|
||||||
The above explanation is sufficient to use and understand CLTV. However, [BIP 65](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki) lays out all the details.
|
The above explanation is sufficient to use and understand CLTV. However, [BIP 65](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki) lays out all the details.
|
||||||
|
|
||||||
A locking script will only allow a transaction to respend a UTXO locked with a CLTV if `OP_CHECKLOCKTIMEVALUE` verifies all of the following:
|
A locking script will only allow a transaction to respend a UTXO locked with a CLTV if `OP_CHECKLOCKTIMEVERIFY` verifies all of the following:
|
||||||
|
|
||||||
* The `nSequence` field must be set to less than 0xffffffff, usually 0xffffffff-1 to avoid confilcts with relative timelocks.
|
* The `nSequence` field must be set to less than 0xffffffff, usually 0xffffffff-1 to avoid confilcts with relative timelocks.
|
||||||
* CLTV must pop an operand off the stack and it must be 0 or greater.
|
* CLTV must pop an operand off the stack and it must be 0 or greater.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user