Just like binary heaps! From node i:
|
Array representation:
∅ | h(1‑8) | h(1‑4) | h(5‑8) | h(1‑2) | h(3‑4) | h(5‑6) | h(7‑8) | h(1) | h(2) | h(3) | h(4) | h(5) | h(6) | h(7) | h(8) |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|
|
|
|
|
As the top of the stack has true at the end, the script is verified and the transaction is valid
If the current key matches the current signature, advance both; otherwise, only advance the key index
|
|
|