From 91b488f9a541f5dd69f0bb2db4249356733a2ed3 Mon Sep 17 00:00:00 2001 From: YOSHIDA Masanori Date: Thu, 7 Mar 2019 22:02:13 +0900 Subject: [PATCH] docs: fix the reverse of meaning in spec (#3387) https://tools.ietf.org/html/rfc6962#section-2.1 "The largest power of two less than the number of items" is actually correct! For n > 1, let k be the largest power of two smaller than n (i.e., k < n <= 2k). --- docs/spec/blockchain/encoding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/blockchain/encoding.md b/docs/spec/blockchain/encoding.md index 1b999335b..e8258e4a9 100644 --- a/docs/spec/blockchain/encoding.md +++ b/docs/spec/blockchain/encoding.md @@ -175,7 +175,7 @@ The differences between RFC 6962 and the simplest form a merkle tree are that: The leaf nodes are `SHA256(0x00 || leaf_data)`, and inner nodes are `SHA256(0x01 || left_hash || right_hash)`. 2) When the number of items isn't a power of two, the left half of the tree is as big as it could be. - (The smallest power of two less than the number of items) This allows new leaves to be added with less + (The largest power of two less than the number of items) This allows new leaves to be added with less recomputation. For example: ```