Compare commits

...

8 Commits

Author SHA1 Message Date
Shannon Appelcline
2c7301f91b
Merge pull request #586 from joegesualdo/patch-4
Update 09_0_Introducing_Bitcoin_Scripts.md
2022-12-13 14:46:35 -10:00
Shannon Appelcline
0cadc9b8dc
Merge pull request #587 from joegesualdo/patch-5
Update 10_4_Scripting_a_Multisig.md
2022-12-13 14:46:07 -10:00
Shannon Appelcline
598791eff3
Merge pull request #591 from SebiCreator/patch-1
Update 11_2_Using_CLTV_in_Scripts.md
2022-12-13 14:45:27 -10:00
Shannon Appelcline
9d1282bdea
Merge pull request #593 from histamineblkr/patch-1
Uncomplicate btcblock alias and fix 301 error
2022-12-13 14:40:32 -10:00
Brandon Authier
f95809a912
Uncomplicate btcblock alias and fix 301 error
The btcblock alias was overly complicated requiring multiple cut commands and multiple line reversals due to using wget (which wasn't even installed on debian by default, whereas curl is). Using curl with the silent flag reduces complexity. Also removing the cat command double redirection using HERE doc notation and complicated escaping is accomplished with a single echo command and simply append redirect.

Update the mainnet get block call with curl and fix the 301 error received by calling url in plain text.
2022-11-29 17:35:00 -08:00
Sebastian Kaeser
8a2a6955ff
Update 11_2_Using_CLTV_in_Scripts.md
OP_CHECKLOCKTIMEVERIFY not OP_CHECKLOCKTIMEVALUE
2022-11-17 10:52:39 +01:00
Joe Gesualdo
aaa618699c
Update 10_4_Scripting_a_Multisig.md 2022-07-11 16:42:23 -04:00
Joe Gesualdo
f07ae7b521
Update 09_0_Introducing_Bitcoin_Scripts.md 2022-07-11 12:39:53 -04:00
4 changed files with 5 additions and 7 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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.