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

Re-write the weight/size API #2076

Merged
merged 3 commits into from
Sep 26, 2023
Merged

Commits on Sep 23, 2023

  1. Add segwit serialization constants

    One of our stated aims is to make it possible to learn bitcoin by using
    our library. To help with this aim add to private consts for the segwit
    transaction marker and flag serialization fields.
    tcharding committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    29f20c1 View commit details
    Browse the repository at this point in the history
  2. Add code comments to transaction serialization

    In an attempt to help super new devs add code comments about transaction
    serialization formats pre and post segwit.
    tcharding committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    73f7fbf View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2023

  1. Re-write size/weight API

    Recently we introduced a bug in the weight/size code, while
    investigating I found that our `Transaction`/`Block` weight/size APIs
    were in a total mess because:
    
    - The docs were stale
    - The concept of weight (weight units) and size (bytes) were mixed up
    
    I audited all the API functions, read some bips (141, 144) and re-wrote
    the API with the following goals:
    
    - Use terminology from the bips
    - Use abstractions that mirror the bips where possible
    tcharding committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    c34e3cc View commit details
    Browse the repository at this point in the history