Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zmitton/0218aa4477be338c4658d3e9caf82a87 to your computer and use it in GitHub Desktop.
Save zmitton/0218aa4477be338c4658d3e9caf82a87 to your computer and use it in GitHub Desktop.
{ header:
Header [
<Buffer b8 bc 8e cf 1e ff f5 e7 43 2c 91 80 15 0b 3f 23 a2 8b 10 b8 bc 0d fb d4 da aa 1b f4 de 6a 49 23>,
<Buffer 1d cc 4d e8 de c7 5d 7a ab 85 b5 67 b6 cc d4 1a d3 12 45 1b 94 8a 74 13 f0 a1 42 fd 40 d4 93 47>,
<Buffer b2 93 0b 35 84 4a 23 0f 00 e5 14 31 ac ae 96 fe 54 3a 03 47>,
<Buffer ee 2b 43 48 50 12 8d 80 0a 53 bd e2 ac ab 9a 31 ce 2a 9b 9d d8 f3 1a 77 93 3a d6 f7 7c 87 1c 70>,
<Buffer 5b 6e 9d 7a 5c 9d 49 94 c6 52 90 6f a2 8b 2d 2a 9a 9e e7 b5 a4 69 ae a2 1b 95 72 6f 78 a1 2d 89>,
<Buffer 21 7b 48 6b 87 14 50 78 53 d2 fe ef 1b c9 89 b5 70 a7 66 f5 cb 43 da 9a 5f 64 14 f0 1f 06 41 da>,
<Buffer 03 48 18 c8 08 43 31 e1 00 a3 b0 c2 20 20 15 45 61 10 44 90 12 20 1c 14 04 02 a5 80 02 38 51 09 9a c0 22 51 a0 0b 5c 00 40 48 93 4a 12 4c 80 82 96 68 ... 206 more bytes>,
<Buffer 06 bd ea 95 c4 3b c6>,
<Buffer 6f a2 c4>,
<Buffer 7a 12 1d>,
<Buffer 79 c9 99>,
<Buffer 5c 7f d2 87>,
<Buffer 73 65 6f 33>,
<Buffer 4d 38 bd fa 79 d1 59 da f9 30 a1 08 30 2a cf 7f 5d 56 78 f4 c3 5d 3b c5 07 ae af 81 01 4c ee 58>,
<Buffer d6 0e 94 80 00 51 20 0b> ],
txProof:
Proof [
[ <Buffer 92 34 ec a6 64 1e c1 20 bb e8 60 7d 43 7a 8f 89 5a b8 22 ad 3e eb 02 80 b7 35 57 79 d4 49 fb 18>,
<Buffer 23 3f b0 9d f5 29 f1 d9 68 ff 94 74 09 cd c6 11 f9 2c b2 5b 54 13 95 85 6f 15 2a 3c f4 88 1b 59>,
<Buffer 5f e3 73 4c 3e 0a 52 fa f6 ba f4 c0 b3 d3 e4 a0 ba 05 96 db 22 a5 c4 a4 33 82 b5 12 ae 62 93 88>,
<Buffer 24 1b 75 ca dc b1 7c bc 09 0a a0 99 a3 91 ed ea 5d e5 b0 f4 48 f7 50 e6 e5 0c d2 df ba 01 ef 20>,
<Buffer 3e 66 35 f6 13 d6 b7 40 b1 dd e2 20 ce 5b 15 4d 0c 8b 8a 53 cf 31 a7 01 55 dd f9 ef 2a b7 54 0d>,
<Buffer c5 a0 ec 1f 20 6f 66 b3 32 97 1b 49 9f d0 f3 c6 9d c3 9b fc c0 40 28 49 01 e1 b4 6c e3 27 e8 e3>,
<Buffer 53 f1 64 01 65 a3 27 81 b6 e7 37 c5 33 57 ff 8a f8 e6 c2 99 42 02 e9 28 32 70 1e 66 3c 30 5f b5>,
<Buffer 46 17 bb 92 60 2d 10 fb 77 dd 7d 36 10 1e 48 dd 9e 05 df d0 8f e1 c4 64 7e 6c a8 87 43 8e 63 37>,
<Buffer 02 71 75 bc 66 04 97 c1 e5 8d 84 cb d3 8c 5c 46 b1 8e 27 23 20 93 51 e4 cb d7 97 21 6f b0 ca db>,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer > ],
[ <Buffer e4 31 c7 3c f1 a5 83 97 c6 d9 cd 00 31 eb 9a 3e 58 6b e0 32 40 5e d0 33 04 92 57 b2 c6 52 76 b6>,
<Buffer b5 bc eb b9 d3 b0 5b e6 45 17 f2 60 41 fe 22 98 5f c9 80 ba f9 59 7a 38 92 9e 7f cb ba ab 04 da>,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer >,
<Buffer > ],
[ <Buffer 20>,
<Buffer f8 85 81 d8 85 2e 90 ed d0 00 82 d5 ec 94 1f 4e 7d b8 51 4e c4 e9 94 67 a8 d2 ee 3a 63 09 4a 90 4e 7a 80 a0 6c 9f fc fa ed 82 0c 36 b8 96 41 8c df dc ... 85 more bytes> ] ],
txIndex: '0x0' }
@zmitton
Copy link
Author

zmitton commented Mar 6, 2019

Because tx index 0 gets encoded to 80 it key sits by itself in the patricia tree. no other key can start with 80. the next key for tx index 1 is 01 and then 02 and so on. After tx index 128 (7f) the next key, index 128, get encoded as 81 80. Nothing except tx[0] can start with 80 in rlp, so this txProof is about half the size of others

Proof size for the txProof only (not header) is nearly constant 566
headers are about ~520 bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment