Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Serialize using write instead of read #46

Open
RobinLinus opened this issue Jan 5, 2023 · 1 comment
Open

feat: Serialize using write instead of read #46

RobinLinus opened this issue Jan 5, 2023 · 1 comment
Labels
enhancement Enhancement of the code, not introducing new features. no-stale This is exempt from the stale bot.

Comments

@RobinLinus
Copy link
Member

RobinLinus commented Jan 5, 2023

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

  1. Implement remaining low-level write functions in serialize.cairo.
  2. Use the ZeroSync Parser to provide via hints TX data as high-level objects
  3. Implement a conditional writer that can serialize all TX hashes (TXID, for each input all sighash types, wTXID)
  4. Implement high-level write functions for Transaction and Block
@RobinLinus RobinLinus added the enhancement Enhancement of the code, not introducing new features. label Jan 5, 2023
@github-actions
Copy link

github-actions bot commented Feb 5, 2023

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features. no-stale This is exempt from the stale bot.
Projects
None yet
Development

No branches or pull requests

2 participants