Serialize using write instead of read
Describe the Feature Request
We have to change our architecture before we can efficiently implement Bitcoin Script. There's a problem arising from serialization read vs write.
Currently, we're using only read. This has the advantage that the data type of the hints providing the TX data is very simple. Also we can hash those hints as provided, which creates a strong backbone for the validity of a block.
However, reading might be the wrong approach overall, because we have to hash TXs in multiple different ways. For example, there's the TXID and a sighash for every input. So at some point we will have to use write instead of read for almost all hashes. That implies that it is probably easier to provide the TXs in high-level objects and then always use write and never read.
Describe Preferred Solution
- Implement remaining low-level write functions in serialize.cairo.
- Use the ZeroSync Parser to provide via hints TX data as high-level objects
- Implement a conditional writer that can serialize all TX hashes (TXID, for each input all sighash types, wTXID)
- Implement high-level write functions for Transaction and Block
Reactions are currently unavailable
Serialize using write instead of read
Describe the Feature Request
We have to change our architecture before we can efficiently implement Bitcoin Script. There's a problem arising from serialization read vs write.
Currently, we're using only read. This has the advantage that the data type of the hints providing the TX data is very simple. Also we can hash those hints as provided, which creates a strong backbone for the validity of a block.
However, reading might be the wrong approach overall, because we have to hash TXs in multiple different ways. For example, there's the TXID and a sighash for every input. So at some point we will have to use write instead of read for almost all hashes. That implies that it is probably easier to provide the TXs in high-level objects and then always use write and never read.
Describe Preferred Solution