diff --git a/ch01_intro.adoc b/ch01_intro.adoc index 65d5eebe..b9d8d3ba 100644 --- a/ch01_intro.adoc +++ b/ch01_intro.adoc @@ -284,7 +284,7 @@ examples. ++++
Wallet | diff --git a/ch04_keys.adoc b/ch04_keys.adoc index 7ff21505..f605a80b 100644 --- a/ch04_keys.adoc +++ b/ch04_keys.adoc @@ -690,19 +690,50 @@ a base58check-encoded private key wallet import format (WIF) that starts with a version prefixes and the resulting base58 characters are shown in <
---|
Type | +Version prefix (hex) | +Base58 result prefix | +
---|---|---|
Address for pay to public key hash (P2PKH) |
+0x00 |
+1 |
+
Address for pay to script hash (P2SH) |
+0x05 |
+3 |
+
Testnet Address for P2PKH |
+0x6F |
+m or n |
+
Testnet Address for P2SH |
+0xC4 |
+2 |
+
Private Key WIF |
+0x80 |
+5, K, or L |
+
BIP32 Extended Public Key |
+0x0488B21E |
+xpub |
+
HRPs | +Network | +
---|---|
bc |
+Bitcoin mainnet |
+
tb |
+Bitcoin testnet |
+
Output type | +Example script | +
---|---|
P2WPKH |
+OP_0 2b626ed108ad00a944bb2922a309844611d25468 |
+
P2WSH |
+OP_0 648a32e50b6fb7c5233b228f60a6a2ca4158400268844c4bc295ed5e8c3d626f |
+
P2TR |
+OP_1 2ceefa5fa770ff24f87c5475d76eab519eda6176b11dbe1618fcf755bfac5311 |
+
Future Example |
+OP_16 0000 |
+
Type | +Prefix | +Description | +
---|---|---|
Hex |
+None |
+64 hexadecimal digits |
+
WIF |
+5 |
+Base58check encoding: base58 with version prefix of 128 and 32-bit checksum |
+
WIF-compressed |
+K or L |
+As above, with added suffix 0x01 before encoding |
+
Format | +Private key | +
---|---|
Hex |
+1e99423a4ed27608a15a2616a2b0e9e52ced330ac530edcc32c8ffc6a526aedd |
+
WIF |
+5J3mBbAH58CpQ3Y5RNJpUKPE62SQ5tfcvU2JpbnkeyhfsYB1Jcn |
+
WIF-compressed |
+KxFC1jmwwCoACiCAWZ3eXa96mBM6tb3TYzGmf6YwgdGWZgawvrtJ |
+
Format | +Private key | +
---|---|
Hex |
+1e99423a4ed27608a15a2616a2b0e9e52ced330ac530edcc32c8ffc6a526aedd |
+
WIF |
+5J3mBbAH58CpQ3Y5RNJpUKPE62SQ5tfcvU2JpbnkeyhfsYB1Jcn |
+
WIF-compressed |
+KxFC1jmwwCoACiCAWZ3eXa96mBM6tb3TYzGmf6YwgdGWZgawvrtJ |
+
From |
+
|
+
+ |
|
+
+ |
|
+
+ |
|
+
To |
+
|
+
Length | +Pattern | +Frequency | +Average search time | +
---|---|---|---|
1 |
+1K |
+1 in 58 keys |
+< 1 milliseconds |
+
2 |
+1Ki |
+1 in 3,364 |
+50 milliseconds |
+
3 |
+1Kid |
+1 in 195,000 |
+< 2 seconds |
+
4 |
+1Kids |
+1 in 11 million |
+1 minute |
+
5 |
+1KidsC |
+1 in 656 million |
+1 hour |
+
6 |
+1KidsCh |
+1 in 38 billion |
+2 days |
+
7 |
+1KidsCha |
+1 in 2.2 trillion |
+3–4 months |
+
8 |
+1KidsChar |
+1 in 128 trillion |
+13–18 years |
+
9 |
+1KidsChari |
+1 in 7 quadrillion |
+800 years |
+
10 |
+1KidsCharit |
+1 in 400 quadrillion |
+46,000 years |
+
11 |
+1KidsCharity |
+1 in 23 quintillion |
+2.5 million years |
+
Date | +Label | +BTC | +
---|---|---|
2023-01-01 |
+Bought bitcoins from Joe |
++0.00100 |
+
2023-01-02 |
+Paid Bob for podcast |
+−0.00075 |
+
Standard | +Script | +BIP32 path | +
---|---|---|
BIP44 |
+P2PKH |
+
|
+
BIP49 |
+Nested P2WPKH |
+
|
+
BIP84 |
+P2WPKH |
+
|
+
BIP86 |
+P2TR Single-key |
+
|
+
Descriptor | +Explanation | +
---|---|
|
+P2PKH script for the provided public key |
+
|
+P2SH multisignature requring two signatures corresponding to these two keys |
+
|
+P2PKH scripts for the BIP32 |
+
Entropy (bits) | +Checksum (bits) | +Entropy + checksum (bits) | +Recovery code words | +
---|---|---|---|
128 |
+4 |
+132 |
+12 |
+
160 |
+5 |
+165 |
+15 |
+
192 |
+6 |
+198 |
+18 |
+
224 |
+7 |
+231 |
+21 |
+
256 |
+8 |
+264 |
+24 |
+
Entropy (bits) | +Checksum (bits) | +Entropy + checksum (bits) | +Recovery code words | +
---|---|---|---|
128 |
+4 |
+132 |
+12 |
+
160 |
+5 |
+165 |
+15 |
+
192 |
+6 |
+198 |
+18 |
+
224 |
+7 |
+231 |
+21 |
+
256 |
+8 |
+264 |
+24 |
+
Entropy input (128 bits) |
+
|
+
Recovery Code (12 words) |
+
|
+
Passphrase |
+(none) |
+
Seed (512 bits) |
+
|
+
Entropy input (128 bits) |
+
|
+
Recovery Code (12 words) |
+
|
+
Passphrase |
+SuperDuperSecret |
+
Seed (512 bits) |
+
|
+
Entropy input (256 bits) |
+
|
+
Recovery Code (24 words) |
+
|
+
Passphrase |
+(none) |
+
Seed (512 bits) |
+
|
+
HD path | +Key described | +
---|---|
m/0 |
+The first (0) child private key from the master private key (m) |
+
m/0/0 |
+The first grandchild private key from the first child (m/0) |
+
m/0'/0 |
+The first normal grandchild private key from the first hardened child (m/0') |
+
m/1/0 |
+The first grandchild private key from the second child (m/1) |
+
M/23/17/0/0 |
+The first great-great-grandchild public key from the first great-grandchild from the 18th grandchild from the 24th child |
+
HD path | +Key described | +
---|---|
M/44 |
+The third receiving public key for the primary Bitcoin account |
+
M/44 |
+The fifteenth change-address public key for the fourth Bitcoin account |
+
m/44 |
+The second private key in the Litecoin main account, for signing transactions |
+
Value | +Bytes used | +Format | +
---|---|---|
>= |
+
|
+
|
+
>= |
+3 |
+
|
+
>= |
+
|
+
|
+
>= |
+
|
+
|
+
+ | Authorization |
+Authentication |
+
Whitepaper |
+Public key |
+Signature |
+
Original (Legacy) |
+Output script |
+Input script |
+
Segwit |
+Witness program |
+Witness structure |
+
Field |
+Factor |
+Weight in Alice’s Tx |
+
Version |
+4 |
+16 |
+
Marker & Flag |
+1 |
+2 |
+
Inputs Count |
+4 |
+4 |
+
Outpoint |
+4 |
+144 |
+
Input script |
+4 |
+4 |
+
Sequence |
+4 |
+16 |
+
Outputs Count |
+4 |
+4 |
+
Amount |
+4 |
+64 (2 outputs) |
+
Output script |
+4 |
+232 (2 outputs with different scripts) |
+
Witness Count |
+1 |
+1 |
+
Witness items |
+1 |
+66 |
+
Lock time |
+4 |
+16 |
+
Total |
+N/A |
+569 |
+
Output script |
+2 PubKey1 PubKey2 PubKey3 PubKey4 PubKey5 5 OP_CHECKMULTISIG |
+
Input script |
+Sig1 Sig2 |
+
Redeem script |
+2 PubKey1 PubKey2 PubKey3 PubKey4 PubKey5 5 OP_CHECKMULTISIG |
+
Output script |
+OP_HASH160 <20-byte hash of redeem script> OP_EQUAL |
+
Input script |
+Sig1 Sig2 <redeem script> |
+
SIGHASH flag |
+Value | +Description | +
---|---|---|
|
+
|
+Signature applies to all inputs and outputs |
+
|
+
|
+Signature applies to all inputs, none of the outputs |
+
|
+
|
+Signature applies to all inputs but only the one output with the same index number as the signed input |
+
SIGHASH flag |
+Value | +Description | +
---|---|---|
|
+
|
+Signature applies to one input and all outputs |
+
|
+
|
+Signature applies to one input, none of the outputs |
+
|
+
|
+Signature applies to one input and the output with the same index number |
+
Size | +Field | +Description | +
---|---|---|
4 bytes |
+Block Size |
+The size of the block, in bytes, following this field |
+
80 bytes |
+Block Header |
+Several fields form the block header |
+
1–3 bytes (compactSize) |
+Transaction Counter |
+How many transactions follow |
+
Variable |
+Transactions |
+The transactions recorded in this block |
+
Size | +Field | +Description | +
---|---|---|
4 bytes |
+Version |
+Originally a version field; its use has evolved over time |
+
32 bytes |
+Previous Block Hash |
+A hash of the previous (parent) block in the chain |
+
32 bytes |
+Merkle Root |
+The root hash of the merkle tree of this block’s transactions |
+
4 bytes |
+Timestamp |
+The approximate creation time of this block (Unix epoch time) |
+
4 bytes |
+Target |
+A compact encoding of the proof-of-work target for this block |
+
4 bytes |
+Nonce |
+Arbitrary data used for the proof-of-work algorithm |
+
Size | +Field | +Description | +
---|---|---|
32 bytes |
+Transaction Hash |
+Pointer to the transaction containing the UTXO to be spent |
+
4 bytes |
+Output Index |
+The index number of the UTXO to be spent, first one is 0 |
+
1–9 bytes (compactSize) |
+Script Size |
+Script length in bytes, to follow |
+
Variable |
+Input Script |
+A script that fulfills the conditions of the UTXO output script |
+
4 bytes |
+Sequence Number |
+Multipurpose field used for BIP68 timelocks and transaction replacement signaling |
+
Size | +Field | +Description | +
---|---|---|
32 bytes |
+Transaction Hash |
+All bits are zero: Not a transaction hash reference |
+
4 bytes |
+Output Index |
+All bits are ones: 0xFFFFFFFF |
+
1 byte |
+Coinbase Data Size |
+Length of the coinbase data, from 2 to 100 bytes |
+
Variable |
+Coinbase Data |
+Arbitrary data used for extra nonce and mining tags. In v2 blocks; must begin with block height |
+
4 bytes |
+Sequence Number |
+Set to 0xFFFFFFFF |
+
Size | +Field | +Description | +
---|---|---|
4 bytes |
+Version |
+A multipurpose bitfield |
+
32 bytes |
+Previous Block Hash |
+A reference to the hash of the previous (parent) block in the chain |
+
32 bytes |
+Merkle Root |
+A hash that is the root of the merkle tree of this block’s transactions |
+
4 bytes |
+Timestamp |
+The approximate creation time of this block (seconds from Unix Epoch) |
+
4 bytes |
+Target |
+The Proof-of-Work algorithm target for this block |
+
4 bytes |
+Nonce |
+A counter used for the Proof-of-Work algorithm |
+