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

3805 Commits

Author SHA1 Message Date
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
krupawan5618
29455e4657
Update ch04.asciidoc
Values changed to hexadecimal and bytes to maintain consistency with concurrent graphs and images.
2021-02-25 02:07:02 -05:00
Vasil Dimov
821580d2c7
ch04: the line through (x,y) and (x,-y) is not "tangent"
On the elliptic curve, a line that goes through two different points
with the same `x` coordinates, but different `y` coordinates (they must
be `y` and `-y`) is not "tangent".
2021-02-25 07:23:18 +01:00
krupawan5618
608c0c0318
Update ch04.asciidoc
Added 8G for completeness and as depicted by image.
2021-02-24 20:45:50 -05: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
rating89us
600d90e256
ch06: fixing dust UTXO definition 2021-02-24 12:45:33 +01:00
rating89us
3421cabe9e
ch06: remove sidebar reference 2021-02-24 00:16:21 +01:00
rating89us
2bacb91fa7 ch06: preceding input->input from Alice's transaction; change UTXO example caption 2021-02-22 20:41:44 +01:00
rating89us
d2a7c399cb
ch06: the underlying transaction->the parent transacion 2021-02-22 20:32:48 +01:00
rating89us
07d54abf7c
ch06: transaction(s) -> transaction 2021-02-22 19:47:59 +01:00
rating89us
8fbe66c494
ch05: detailing HD wallet path example 2021-02-22 14:23:22 +01:00
rating89us
4035aa00fc
ch05: add key and (non-hardened) 2021-02-22 13:53:43 +01:00
rating89us
439fe896e6
ch05: Keepkey -> KeepKey 2021-02-21 21:27:50 +01:00
jerzybrzoska
d12ce68054
Update ch08.asciidoc 2021-02-21 20:18:06 +01:00
Will Binns
70177894ec
github_contrib: Add new contributors 2021-02-21 16:31:18 +01:00
Will Binns
96176cc7e1
Merge pull request #802 from rating89us/patch-34
ch10: referenced output transaction -> its parent transaction
2021-02-20 21:56:39 +00:00
Will Binns
f11a7638c7
Merge pull request #801 from rating89us/patch-30
ch01: in her wallet -> it contains
2021-02-20 21:47:55 +00:00
Will Binns
363030efb5
Merge pull request #800 from rating89us/patch-35
ch04: Base-58 -> Base58
2021-02-20 21:46:55 +00:00
Will Binns
8a356444dc
Merge pull request #799 from rating89us/patch-38
Remove bash symbol from comments in Ch09 & Ch10
2021-02-20 21:46:26 +00:00
Will Binns
fe1c8ab907
Merge pull request #797 from rating89us/patch-36
ch04: add "web, desktop, or mobile" wallet
2021-02-20 21:45:30 +00:00
Will Binns
f983aa10c7
Merge pull request #792 from rating89us/patch-32
ch02: aggr. tx: add tx batching, saving in fees and exchange withdraw…
2021-02-20 21:44:57 +00:00
Will Binns
57c9d43c68
Merge pull request #785 from rating89us/patch-25
ch01: improve hardware wallet part
2021-02-20 21:44:12 +00:00
Will Binns
917336035b
Merge pull request #783 from rating89us/patch-23
glossary: fixing multisig explanation
2021-02-20 21:43:33 +00:00