unit-e icon indicating copy to clipboard operation
unit-e copied to clipboard

Put Meta information in abandoned fields in vin[0]

Open scravy opened this issue 7 years ago • 0 comments

A bitcoin-coinbase-transaction has the COutput part of vin[0] all zeroed out. Currently this is the same in a unit-e-coinbase-transaction. The scriptSig of vin[0] carries the block height and other meta data (extra nonce for example) in bitcoin. The scriptSig of vin[0] in unit-e is more strict and contains the snapshot hash as well as the block height.

These two items which we put in scriptSig are actually exactly the same datatypes as a txid and an index (snapshot hash: uint256, block height: uint32). Thus the zeroed out fields could carry exactly that information and we'd safe 36 bytes per transaction.

Came up in: https://github.com/dtr-org/unit-e/pull/397/files#r243751175

scravy avatar Dec 28 '18 10:12 scravy