1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-27 08:58:08 +00:00
Commit Graph

3728 Commits

Author SHA1 Message Date
rating89us
689cb16eb8
appdx: fix commentaries in code 2021-03-04 23:32:40 +01:00
Will Binns
72abc050e1
Merge pull request #803 from rating89us/patch-1
ch05: Keepkey -> KeepKey
2021-03-04 20:09:51 +01:00
Will Binns
a993b9d379
Merge pull request #837 from krupawan5618/patch-3
Update ch06.asciidoc - Alice example consistent with Chapter 2 transaction
2021-03-04 20:07:05 +01:00
Will Binns
318712d3ef
Merge pull request #835 from rating89us/patch-49
ch09: add current block height definition
2021-03-04 20:02:37 +01:00
Will Binns
29dc6f39e4
Merge pull request #834 from rating89us/patch-47
ch09: in seconds elapsed since Unix Epoch
2021-03-04 20:00:33 +01:00
Will Binns
3b0f6d1a71
Merge pull request #833 from rating89us/patch-46
ch09: hashing -> double hashing
2021-03-04 20:00:10 +01: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
b9a5fdb605
Merge pull request #825 from rating89us/patch-38
ch04: add missing line break
2021-03-04 19:37:54 +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
50f36c4943
Merge pull request #818 from krupawan5618/patch-2
Update ch04.asciidoc - consistency with hexadecimal and bytes
2021-03-04 19:28:29 +01:00
Will Binns
4a469266ee
Merge pull request #817 from vasild/fix_vertical_line_vs_tangent
ch04: the line through (x,y) and (x,-y) is not "tangent"
2021-03-04 19:25:03 +01:00
Will Binns
ff5e3fddb8
Merge pull request #816 from krupawan5618/patch-1
Update ch04.asciidoc - added "8G"
2021-03-04 19:23:50 +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
Will Binns
f93bd7b44d
Merge pull request #813 from rating89us/patch-18
ch07: add roles of sender and recipient
2021-03-04 19:19:01 +01:00
Will Binns
5ae5ee54c9
Merge pull request #810 from rating89us/patch-17
ch06: fixing dust UTXO definition
2021-03-04 19:12:52 +01:00
Will Binns
68b5e8fd83
Merge pull request #809 from rating89us/patch-16
ch06: remove sidebar reference
2021-03-04 19:12:26 +01:00
Will Binns
ff3e2696dc
Merge pull request #808 from rating89us/patch-15
ch06: the underlying transaction->the parent transacion that contains it
2021-03-04 19:11:02 +01:00
Will Binns
47ae9960f8
Merge pull request #807 from rating89us/patch-8
ch06: preceding input->input from Alice's transaction; change UTXO example…
2021-03-04 19:07:48 +01:00
Will Binns
fa046b8889
Merge pull request #806 from rating89us/patch-5
ch06: transaction(s) -> transaction
2021-03-04 19:07:02 +01:00
Will Binns
a1990f0606
Merge pull request #805 from rating89us/patch-4
ch05: detailing HD wallet path example
2021-03-04 19:06:40 +01:00
Will Binns
6e15f29ad9
Merge pull request #804 from rating89us/patch-3
ch05: add key and (non-hardened)
2021-03-04 19:01:09 +01:00
Will Binns
be5b370818
Merge pull request #766 from jerzybrzoska/patch-7
ch08.asciidoc: I specified where UTXO pool is stored in Bitcoin Core
2021-03-04 19:00:44 +01:00
Will Binns
eaaefe17cd
Merge pull request #747 from hebasto/210119-target
ch10: Align target description with the actual implementation
2021-03-04 18:58:24 +01:00
Will Binns
6c0957abd4
Merge branch 'develop' into 210119-target 2021-03-04 18:58:03 +01:00
Will Binns
f54b6736c0
Merge pull request #743 from syncom/syncom/ch04-suggest-a-more-appropriate-xref
chp04: xref <<vanity_minor_code>> seems better for note on std:random…
2021-03-04 18:54:51 +01:00
krupawan5618
9197d401e3
Update ch06.asciidoc
Provided example transaction that is same as that in Ch. 02, Figure 4. For consistency across chapter.
2021-03-01 21:42:20 -05:00
rating89us
7dcd2bb69e
ch09: add current block height definition 2021-03-01 19:38:29 +01:00
rating89us
08f575aa17
ch09: in seconds elapsed since Unix Epoch 2021-03-01 18:41:08 +01:00
rating89us
4b698144a3
ch09: hashing -> double hashing 2021-03-01 18:34:59 +01:00
drakos
6b041e5341
Fix for Private Key (WIF-Compressed)
When testing with a `private_key = '0000000000000000000000000000000000000000000000000000000000000001'` instead of `private_key = bitcoin.random_key()`,
the generated Private Key (WIF-Compressed) is wrong `5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsrefhvB5QZ`, it should be `KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn`. As it turns out, the proper way to get the correct compressed WIF is to pass `'wif_compressed'` and not `'wif'` to the `bitcoin.encode_privkey` function, as pointed out in the Main.py from the bitcoin python package.

```
def encode_privkey(priv, formt, vbyte=0):
    if not isinstance(priv, int_types):
        return encode_privkey(decode_privkey(priv), formt, vbyte)
    if formt == 'decimal': return priv
    elif formt == 'bin': return encode(priv, 256, 32)
    elif formt == 'bin_compressed': return encode(priv, 256, 32)+b'\x01'
    elif formt == 'hex': return encode(priv, 16, 64)
    elif formt == 'hex_compressed': return encode(priv, 16, 64)+'01'
    elif formt == 'wif':
        return bin_to_b58check(encode(priv, 256, 32), 128+int(vbyte))
    elif formt == 'wif_compressed':
        return bin_to_b58check(encode(priv, 256, 32)+b'\x01', 128+int(vbyte))
    else: raise Exception("Invalid format!")
```

The fix can be done in a couple ways:

`bitcoin.encode_privkey(bitcoin.decode_privkey(compressed_private_key, 'hex'), 'wif')` -> 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsrefhvB5QZ (WRONG)

`bitcoin.encode_privkey(bitcoin.decode_privkey(compressed_private_key, 'hex'), 'wif_compressed')` -> KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU9FMLM39zT (WRONG)

`bitcoin.encode_privkey(bitcoin.decode_privkey(compressed_private_key, 'hex_compressed'), 'wif_compressed')` -> KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn (CORRECT)

`bitcoin.encode_privkey(bitcoin.decode_privkey(private_key, 'hex'), 'wif_compressed')` -> KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn (CORRECT)
2021-02-27 23:37:29 -05: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
485fc5b5ad
ch04: add missing line break 2021-02-26 16:32:54 +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
Andreas M. Antonopoulos
07da92ac95 Paper wallet warning and removal of bitcoinpaperwallet.com 2021-02-25 09:23:46 -06:00