-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbitcoin.rfc
86 lines (68 loc) · 3.8 KB
/
bitcoin.rfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
This file encodes the wire format of bitcoin blocks.
Example for 0000000000000000079c58e8b5bce4217f7515a74b170049398ed9b8428beb4a
{"rawblock":"030000009185dbc5e60723af6b4cdcdb5ceea505bc1cf7fe85097d02000000000000000001fef45c2701088577dffd37927b20da129acce6303f2ba3116ce032b4f8a5018de2dd55c4431418cb638acc0201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5703a7ab052f4249503130302f048fe2dd550850030f240c3900003c5b4254434368696e612e636f6d5d20e5b9b8e7a68fe4b88de59ca8e5be97e588b0e5a49a20e8808ce59ca8e8aea1e8be83e5b0912d2de4b99de6809d000000000100f90295000000001976a9142c30a6aaac6d96687291475d7d52f4b469f665a688ac000000000100000001f71c1cd429d1800080147ef63b2aa7440273d1ecdb2b0a1da01aded965e2ca8e000000006b483045022100de5bdb5a365fb16cc4057f1b1c1d9aabf130e85a9da6c184f186d0d0fbe7afd7022024321c4a53c4f5017153a666e10c65e4d790eb100fb4d66eaac8f9417699351c012102163e80de410646145142636833d8a92de4bb5c99e49bd52be5346fb1030628d4ffffffff02f05e3102000000001976a9145ca26d65ee83f441ef98b624763a305d50eb36cf88aca0860100000000001976a914838eb1034b719f9c47ab853aee63d505e4176a8388ac00000000"}
{"hash":"0000000000000000079c58e8b5bce4217f7515a74b170049398ed9b8428beb4a","size":479,"height":371623,"version":3,"merkleroot":"01a5f8b432e06c11a32b3f30e6cc9a12da207b9237fddf77850801275cf4fe01","tx":["ee6bc0e5f95a4ccd0f00784eab850ff8593f9045de96c6656df41c8f9f9c0888","29c59ec39fc19afd84d928272b3290bbe54558f7b51f75feb858b005dea49c10"],"time":1440604813,"nonce":3431621579,"bits":"181443c4","difficulty":54256630327.88996,"chainwork":"0000000000000000000000000000000000000000000998b7adec271cd0ea7258","confirmations":187980,"previousblockhash":"0000000000000000027d0985fef71cbc05a5ee5cdbdc4c6baf2307e6c5db8591","nextblockhash":"000000000000000013677449d7375ed22f9c66a94940328081412179795a1ac5","reward":25,"isMainChain":true,"poolInfo":{}}
03000000 version
9185dbc5e60723af6b4cdcdb5ceea505bc1cf7fe85097d020000000000000000 prev_block
01fef45c2701088577dffd37927b20da129acce6303f2ba3116ce032b4f8a501 merkle_root
8de2dd55 timestamp
c4431418 bits
cb638acc nonce
02 transactions
01000000 version
01 in-counter
0000000000000000000000000000000000000000000000000000000000000000 previous hash
ffffffff previous txout idx
57 coinbase len
03a7ab052f4249503130302f048fe2dd550850030f240c3900003c5b4254434368696e612e636f6d5d20e5b9b8e7a68fe4b88de59ca8e5be97e588b0e5a49a20e8808ce59ca8e8aea1e8be83e5b0912d2de4b99de6809d coinbase
00000000 seq_no
01 out-counter
00f9029500000000 value (25*10^8 satoshi)
19 script_len
76a9142c30a6aaac6d96687291475d7d52f4b469f665a688ac script
00000000 lock_time
01000000 version
01
f71c1cd429d1800080147ef63b2aa7440273d1ecdb2b0a1da01aded965e2ca8e previous hash
00000000
6b
483045022100de5bdb5a365fb16cc4057f1b1c1d9aabf130e85a9da6c184f186d0d0fbe7afd7022024321c4a53c4f5017153a666e10c65e4d790eb100fb4d66eaac8f9417699351c012102163e80de410646145142636833d8a92de4bb5c99e49bd52be5346fb1030628d4 script
ffffffff seq_no
02
f05e310200000000 value
19
76a9145ca26d65ee83f441ef98b624763a305d50eb36cf88ac
a086010000000000 value
19
76a914838eb1034b719f9c47ab853aee63d505e4176a8388ac
00000000 lock_time
*/
opaque sha256[32];
uint32_le amount{2};
struct {
sha256 prev_hash;
uint32_le prev_idx;
/* MAX_SCRIPT_SIZE=10000 */
opaque scriptSig<0..10000 : bitcoin_varint>;
uint32_le seq_no;
} txin;
struct {
amount value;
opaque scriptPubKey<0..10000 : bitcoin_varint>;
} txout;
struct {
uint32_le version;
txin inputs{0..1000 : bitcoin_varint};
txout outputs{0..11110 : bitcoin_varint};
uint32_le lock_time;
} transaction;
struct {
uint32_le version;
sha256 prev_block;
sha256 merkle_root;
uint32_le timestamp;
uint32_le bits;
uint32_le nonce;
transaction tx{0..2^16 : bitcoin_varint};
} block;