1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-11-30 03:48:31 +00:00
Commit Graph

278 Commits

Author SHA1 Message Date
David A. Harding
b2df51488b [Move only] Move content from CH06 & CH07 to new A&A chapter
A&A = Authorization & Authentication
2023-03-30 14:01:06 -10:00
David A. Harding
0a24448da5 [Move only] Move content from CH06 & CH07 to new Transactions chapter 2023-03-05 10:58:12 -10:00
David A. Harding
da42564e86 CH06-7: reflow text so that future diffs will be more readable 2023-03-05 10:54:23 -10:00
David A. Harding
33402f685d Anchors: rename "cup_of_coffee" to "spending_bitcoin" 2023-02-05 13:33:02 -10:00
David A. Harding
2f0d7d8c3a Revert CC-BY-SA material added since the second edition
The commit ab5ae32bae is the last commit
for the second edition, so all changes since then are dropped except for
several commits for the third edition authored by Andreas Antonopoulos.

No attempt is made to remove CC-BY-SA or other licensed content present
in the already-published first or second editions.

This revert may itself be reverted for versions of the book published
under CC-BY-SA.
2023-02-01 06:31:10 -10:00
Andreas M. Antonopoulos
a3229bbbc0 bitcoin/Bitcoin capitalization changed everywhere 2021-10-25 23:51:17 +02:00
Dan Raviv
35b9de0cb4 Replace http scheme with https where appropriate 2021-04-10 10:51:03 +03:00
Will Binns
53ec800983
Merge pull request #901 from rating89us/patch-81
ch10: unmodified/unupgraded/nonupgraded -> non-upgraded
2021-04-08 12:21:09 +02:00
Will Binns
1f02e2232f
Merge pull request #890 from rating89us/patch-69
ch07: fix text + styling in tip
2021-04-08 11:39:10 +02:00
rating89us
1d9f80131f
ch07: nonupgraded -> non-upgraded 2021-04-02 22:46:36 +02:00
rating89us
7c6f9c4cd2
ch07: fix text + styling in tip 2021-03-26 12:50:31 +01:00
krupawan5618
aa585005bb
Update ch07.asciidoc
a to an
2021-03-15 01:17:41 -04:00
Will Binns
553e1a51fb
ch07: Swap placement of sender and receiver
Closes #760
2021-03-10 10:18:58 +01:00
Will Binns
6661b9cbec
ch07: Update script example to account for bug
Closes #624
2021-03-10 09:36:12 +01:00
Will Binns
6b8e6ca895
Merge pull request #849 from krupawan5618/patch-7
Update ch07.asciidoc -  Clarify current restrictions of standard multisig vs. P2SH
2021-03-10 08:35:58 +01:00
Will Binns
8f059d8330
Merge pull request #847 from krupawan5618/patch-6
Update ch07.asciidoc - Removed Public Key for unlocking script for P2SH
2021-03-10 08:34:20 +01:00
Will Binns
ef7fd81d89
ch07: Fix 'BOOLOR' styling to match other operators 2021-03-09 14:52:46 +01:00
krupawan5618
a9a5ed38a9
Update ch07.asciidoc
refactored text to create sizeable tip box; fixed typos
2021-03-05 19:48:37 -05:00
krupawan5618
73c3af32c3
Update ch07.asciidoc
Elaborated a bit more on IsStandard() function and provided clarity to the examples written above. 

Reference: ed25cb58f6/src/policy/policy.cpp (L53)
2021-03-05 19:44:54 -05:00
krupawan5618
d2a386cf7f
Update ch07.asciidoc
Aim is to clarify the current restrictions of standard multisig vs. P2SH. The aim is to further clarify why a transaction would be invalid, in each perspective. On a technical note, saying that it 'invalidates the transaction' may not be correct, but my current understanding is that a 2 of 5 multisig transaction would enter the mempool but then become invalid by nodes. 

On the other hand, nodes wouldn't have a way to tell if a P2SH hash has within it 15 public keys as it is just a hash; therefore, the only way to tell is to analyze unlocking script of a transaction in input, unless the basis for 15 public keys is a size restriction? Thank you
2021-03-05 17:54:26 -05:00
krupawan5618
3e6ae4aaee
Update ch07.asciidoc
Updated the P2SH unlocking script to state that just signatures are required to satisfy unlocking conditions, as depicted by the examples.
2021-03-05 17:19:30 -05:00
krupawan5618
23bdf8f305
Update ch07.asciidoc
Moved this Tip Box for flow.
2021-03-04 21:47:13 -05:00
krupawan5618
5d44f72caf
Update ch07.asciidoc
Restructured this Tip box sentence structure for flow. Comment related to P2WPKH and P2WSH are placed at the end with subtle pointer to continue reading for elaboration on this point.
2021-03-04 21:41:56 -05:00
Will Binns
cac0793e72
Merge pull request #828 from rating89us/patch-45
ch07: add pruning synonym
2021-03-04 19:39:34 +01:00
Will Binns
71cca17340
Merge pull request #827 from rating89us/patch-44
ch07: introduce "pure segwit transaction" term
2021-03-04 19:39:09 +01:00
Will Binns
8964f302ea
Merge pull request #826 from rating89us/patch-40
ch07: remove period in list item
2021-03-04 19:38:26 +01:00
Will Binns
4e5408a94c
Merge pull request #824 from rating89us/patch-36
ch07: tx = tx data + witness data
2021-03-04 19:37:37 +01:00
Will Binns
9992809452
Merge pull request #823 from rating89us/patch-32
ch07: change order of signers; add "the Lawyer" to Abdul's sig
2021-03-04 19:36:26 +01:00
Will Binns
359566c08a
Merge pull request #822 from rating89us/patch-30
ch07: must be satisfied to unlock it
2021-03-04 19:33:00 +01:00
Will Binns
2926b88751
Merge pull request #821 from rating89us/patch-27
ch07: fork attack -> fork/double-spend attack; del extra space
2021-03-04 19:32:33 +01:00
Will Binns
4a83b24370
Merge pull request #820 from rating89us/patch-25
ch07: reward -> mining reward
2021-03-04 19:31:46 +01:00
Will Binns
f31f8d97d6
Merge pull request #819 from rating89us/patch-23
ch07: fix numbered list; lock-time -> timelock
2021-03-04 19:31:04 +01:00
Will Binns
867d351f3a
Merge pull request #815 from rating89us/patch-21
ch07: transaction fee cost -> higher transaction fee costs
2021-03-04 19:22:15 +01:00
Will Binns
07d1fa3308
Merge pull request #814 from rating89us/patch-20
ch07: add table summarizing bitcoin non-segwit and segwit addresses
2021-03-04 19:21:49 +01:00
rating89us
925ee5d325
ch07: add pruning definition 2021-02-27 23:25:20 +01:00
rating89us
ca2415b0a8
ch07: introduce "pure segwit transaction" term 2021-02-27 22:44:36 +01:00
rating89us
60bb4d3f0b
ch07: remove period in list item 2021-02-27 21:30:07 +01:00
rating89us
7d0819d677 ch07: tx = tx data + witness data 2021-02-26 15:00:34 +01:00
rating89us
a823b10938 ch07: add table summarizing bitcoin non-segwit and segwit addresses 2021-02-26 12:49:50 +01:00
rating89us
74563c2c01
ch07: change order of signers; add "the Lawyer" to Abdul's sig 2021-02-26 00:05:18 +01:00
rating89us
123652efb9
ch07: must be satisfied to unlock it 2021-02-25 22:38:51 +01:00
rating89us
988d8cedf7
ch07: fork attack -> fork/double-spend attack; del extra space 2021-02-25 22:13:08 +01:00
rating89us
9c0b5d09ab
ch07: reward -> mining reward 2021-02-25 21:26:45 +01:00
rating89us
9f0cd2f74f
ch07: fix numbered list; lock-time -> timelock 2021-02-25 19:09:09 +01:00
rating89us
370930f0ae
ch07: transaction fee cost -> higher transaction fee costs 2021-02-24 20:41:22 +01:00
rating89us
32afaef9a7
ch07: add roles of sender and recipient 2021-02-24 18:23:26 +01:00
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