1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-11-22 16:18:11 +00:00
Commit Graph

232 Commits

Author SHA1 Message Date
Felix Filozov
c66298c3c5 Added missing word. 2021-02-10 21:21:42 -05:00
Ning Shang
c942d694b6
ch07: Typo fixes
Fix minor typos related to 'equal to' and 'less/greater than'.
2021-01-18 20:34:24 -08:00
Ning Shang
555be41b2b
ch07: 2-of-5 instead of 2-of-3 for Mohammed's example
The example is a 2-of-5 multisig, according to the Pay-to-Script-Hash example description earlier, and the P2SH example a few lines below.
2021-01-18 20:00:19 -08:00
Murch
8072effb93
Correct transaction costs in segwit example
The transaction fees in the example were off.
2-of-3 P2SH inputs are between 293 and 297 bytes (293 bytes if both
signatures have low-R, 296 bytes if one signature has high-R, 297 bytes
if both signatures have high-R) and P2SH outputs are 32 bytes.

2-of-3 P2WSH (native segwit) inputs are between 104 and 104.5 vbytes
(416–418 WU, depending on low-R/high-R as above) and P2WSH outputs are
43 bytes.

The transaction header has 10 bytes for non-segwit transactions and 42
WU for segwit transactions.

Source:
https://github.com/BitGo/unspents/blob/master/src/dimensions.ts#L69

I have updated the numbers in the example and amended the conclusion
which did not match the new numbers. Calculation details follow.

-----

Let's assume that the wallet is using signature grinding and will always
produce signatures with low-R:

•Without Segregated Witness:
Transaction A using 2-of-3 P2SH inputs and P2SH outputs:
3*293 + 10 + 2*32 = 953
953 * 30 = 28,590

Transaction B using 2-of-3 P2SH inputs and P2SH outputs:
2*293 + 10 + 3*32 = 692
692 * 30 = 20,760

•With Segregated Witness:
Transaction A using 2-of-3 P2WSH (native segwit) inputs and outputs:
3*104 + 10.5 + 2*43 = 408.5
408.5 * 30 = 12,255

Transaction B using 2-of-3 P2WSH (native segwit) inputs and P2WSH
outputs:
2*104 + 10.5 + 3*43 = 347.5
347.5 * 30 = 10,425
2020-10-13 23:11:13 -04:00
Will Binns
6990e9d83a
Merge pull request #671 from jowo-io/develop
Ensuring "constant width" font is used for two references to `nLocktime`
2020-05-01 11:57:06 -06:00
Will Binns
720e376e3e
Merge pull request #661 from staciewaleyko/patch-1
Fix typo in chapter 7 ("to" => "with")
2020-04-30 22:14:23 -06:00
JoWo
0e2256e394 ensuring "constant width" of two references to nLocktime 2020-02-05 11:24:21 +01:00
Stacie Waleyko
ee79882eb8
Fix typo in chapter 7 ("to" => "with") 2019-10-28 08:30:42 -04:00
Gus
6599228da5 Removes sentence structure error: "outputs" 2019-10-10 08:35:27 -06:00
Will Binns
1bdd74320a
Merge branch 'develop' into op-tuck 2019-10-05 09:07:24 +02:00
practicalswift
fed7506d88 Fix typos 2019-08-27 12:31:52 +00:00
Will Binns
f6f5b29822
Merge pull request #594 from ottosch/develop
Fixed typo: "note than" -> "note that"
2019-06-19 23:21:37 +02:00
Will Binns
10914b174e
Merge pull request #564 from satwo/patch-1
Specify height/timestamp cutoff for nLockTime
2019-05-09 20:05:30 +00:00
Will Binns
5785fc9d5d
Merge pull request #521 from kenjiszk/kenjiszk/fix-typo-patch-1
fix segit to segwit
2019-05-08 13:17:10 +00:00
ottoteixeira
b18ee82b46
Fixed typo: "note than" -> "note that" 2018-08-17 14:37:21 -03:00
Samuel B. Atwood
d6ec46403f
Specify height/timestamp cutoff for nLockTime
Changed "If it is above 500 million..." to "If it is greater than or equal to 500 million" to more accurately reflect the protocol spec.
See: https://en.bitcoin.it/wiki/Script#Locktime
2018-05-07 11:49:35 -05:00
Arthur O'Dwyer
8fb3e8946e Add a missing period.
(This sentence appears in Appendix D, in my PDF copy!)
2018-03-26 14:18:40 -07:00
kristen@oreilly.com
ab5ae32bae Edited ch07.asciidoc with Atlas code editor 2018-03-15 10:09:31 -07:00
kristen@oreilly.com
bab88e00aa Edited ch07.asciidoc with Atlas code editor 2018-03-15 09:30:29 -07:00
kristen@oreilly.com
6486a74a86 Edited ch07.asciidoc with Atlas code editor 2018-03-14 11:20:39 -07:00
kristen@oreilly.com
02cf61ecef Edited ch07.asciidoc with Atlas code editor 2018-03-14 11:18:44 -07:00
Andreas M. Antonopoulos
3d22d30685 Errata 163567 2018-03-14 10:58:05 -06:00
kenjiszk
8280075526 fix segit to segwit 2018-03-07 17:00:56 +09:00
kristen@oreilly.com
35c2b2a6c9 Edited ch07.asciidoc with Atlas code editor 2018-03-05 11:37:10 -08:00
kristen@oreilly.com
fef931c6f4 Edited ch07.asciidoc with Atlas code editor 2018-03-05 11:31:29 -08:00
kristen@oreilly.com
81a0e7ee39 Edited ch07.asciidoc with Atlas code editor 2018-03-05 11:29:32 -08:00
Andreas M. Antonopoulos
77d0ca8ee2
Merge pull request #504 from trustkim/patch-1
correct CLTV's note description: CLTV in the inputs -> CLTV in the outputs
2018-02-14 14:58:50 -06:00
trustkim
1cc6c60e28
correct CLTV's note description
I think CLTV is output-level locktime. so it should be corrected
2018-02-09 18:11:58 +09:00
theStack
cf87badbd2 script opcode count IF vs. VERIFY: diff is two ops
v1: HASH160 <expected hash> EQUALVERIFY <Bob's Pubkey> CHECKSIG
v2: HASH160 <expected hash> EQUAL IF <Bob's Pubkey> CHECKSIG ENDIF

ignoring the push-data ops (hash, pubkey),
v1 consists of [HASH160, EQUALVERIFY, CHECKSIG] -> 3 opcodes,
v2 consists of [HASH160, EQUAL, IF, CHECKSIG, ENDIF] -> 5 opcodes,
hence the difference is two opcodes.
2018-02-05 14:23:38 -05:00
Andreas M. Antonopoulos
9c783e1edf Clarified #421 2018-02-03 21:20:42 -06:00
Andreas M. Antonopoulos
8a9869f808 Fixed missing forward reference and clean up #420 2018-02-03 19:31:31 -06:00
Andreas M. Antonopoulos
f5c0df0ed5
Merge pull request #493 from theStack/isstandard
replace "isStandard" by "IsStandard" (ref. to Bitcoin Core function)
2018-02-03 14:05:04 -08:00
Andreas M. Antonopoulos
bd730b5570
wording 2018-02-03 16:04:39 -06:00
Andreas M. Antonopoulos
76e44f226e
Rewrite 3-key limit information 2018-02-03 16:02:41 -06:00
Andreas M. Antonopoulos
1ddd89b658 Several fixes to Segwit/P2SH #440
There were several errors in the address and hash calculations. Fixed errors and added command line examples to clarify the process
2018-02-03 15:38:34 -06:00
Andreas M. Antonopoulos
240b5b0c1c Better P2SH example with bx 2018-02-03 15:36:44 -06:00
Andreas M. Antonopoulos
2fcc1db70f wording 2018-02-03 15:36:16 -06:00
Andreas M. Antonopoulos
4ebfce27d2 wording 2018-02-03 15:35:51 -06:00
theStack
2f1015c23f s/isStandard/IsStandard/ (ref. to Bitcoin Core) 2018-02-03 05:58:52 -05:00
Andreas M. Antonopoulos
3830fafc1d Merge branch 'develop' into feature/move_segwit 2018-02-02 17:10:05 -08:00
Andreas M. Antonopoulos
06158f95bf Moved segwit appendix to ch07 2018-02-02 17:08:49 -08:00
Andreas M. Antonopoulos
32464c86dd Improved P2SH example
Showing use of bx to produce script-hash
2018-02-02 16:59:08 -08:00
Andreas M. Antonopoulos
14cde54626 Add segwit to chapter 7 intro 2018-02-02 15:43:48 -08:00
Andreas M. Antonopoulos
8bdfb3b7da Remove end-of-chapter index reference 2018-02-02 15:42:28 -08:00
Will Binns
f0a57a71ff
Merge pull request #443 from philippgille/patch-1
Add detail to a benefit of P2SH
2018-01-25 00:15:59 +07:00
Philipp Gillé
bacbdd90aa
Fix typo
It should be "a specification" instead of "a specifications".
2017-12-31 18:49:18 +01:00
Philipp Gillé
080f12cdd3
Add detail to a benefit of P2SH
The bullet point previously sounded as if the long script was only stored in the UTXO set when not using P2SH, and stored on the blockchain when using P2SH. This might lead to people thinking it might lead to a smaller blockchain when the script is stored in the UTXO set *instead* of on the blockchain. But without P2SH the long script was stored both in the UTXO set *and* on the blockchain. With P2SH it's only stored on the blockchain, which is a clear advantage over not using P2SH.
2017-12-31 17:54:40 +01:00
Ed Posnak
ebbdbcf683 make binary and hex values consistent 2017-07-31 12:18:31 -04:00
nadams
886b3f3079 Edited ch07.asciidoc with Atlas code editor 2017-05-30 12:16:37 -07:00
Nick Adams
60b2563dd4 deleting some index entries 2017-05-18 15:46:40 -04:00