LNP-BP / LNPBPs

LNP/BP standards for bitcoin layer 2 & 3 protocols
https://standards.lnp-bp.org
202 stars 39 forks source link

LNPBP-5: Unset value of tx position and input/output index fields #22

Open inaltoasinistra opened 4 years ago

inaltoasinistra commented 4 years ago

hello! the two fields 32-47 and 49-63 use 0 to encode no value. This has a couple of drawbacks:

I think that the encoding would be simpler if N is encoded as N, and INT_MAX(bits) is used to encode UNSET.

I would define the constants

I would redefine the entity Block; On-chain

First bit set to 0, bits 32-47 set to UNSET_TX_INDEX, bit 48 set to 0, bits 49-63 set to UNSET_IO_INDEX

and the entity Transaction; On-chain to

First bit set to 0, bit 48 set to 0, bits 49-63 set to UNSET_IO_INDEX

dr-orlovsky commented 4 years ago

@cdecker what do you think on this enhancement to universal bitcoin ids?