coins: comments.

This commit is contained in:
Christopher Jeffrey 2016-12-01 04:48:00 -08:00
parent 9f11875736
commit 244af663bb
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -191,16 +191,20 @@ Coins.prototype.isEmpty = function isEmpty() {
* Coins serialization: * Coins serialization:
* version: varint * version: varint
* height: uint32 * height: uint32
* header-code: varint (31-bit fields | 1-bit coinbase-flag) * header-code: varint
* bit 1: coinbase
* bit 2: first output unspent
* bit 3: second output unspent
* bit 4-32: spent-field size
* spent-field: bitfield (0=spent, 1=unspent) * spent-field: bitfield (0=spent, 1=unspent)
* outputs (repeated): * outputs (repeated):
* value: varint * value: varint
* compressed-script: * compressed-script:
* prefix: * prefix: 0x00 = 20 byte pubkey hash
* 0x00 = 20 byte pubkey hash
* 0x01 = 20 byte script hash * 0x01 = 20 byte script hash
* 0x02-0x05 = 32 byte ec-key x-value * 0x02-0x05 = 32 byte ec-key x-value
* >=0x06 = varint-size + 10 | raw script * 0x06-0x09 = reserved
* >=0x10 = varint-size + 10 | raw script
* data: script data, dictated by the prefix * data: script data, dictated by the prefix
* *
* The compression below sacrifices some cpu in exchange * The compression below sacrifices some cpu in exchange