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

crawB Binary Token Serialization #507

Merged
merged 8 commits into from
Dec 19, 2024

Conversation

lollerfirst
Copy link
Contributor

@lollerfirst lollerfirst commented Dec 19, 2024

Description


ADDED

  • cdk: Ciborium transparent error for serialization
  • Token::to_raw_bytes serializes generic token to raw bytes, choosing between a TokenV3 or TokenV4 serialization.
  • Token::try_from for Vec<u8> constructs a generic token from raw bytes.
  • TokenV3::to_raw_bytes serializes a TokenV3 to raw bytes following the spec.
  • TokenV3::from for Vec<u8> constructs a TokenV3 from raw bytes.
  • TokenV4::to_raw_bytes() serializes a TokenV4 to raw bytes following the spec.
  • TokenV4::from for Vec<u8> constructs a TokenV4 from raw bytes.
  • roundtrip tests with the spec test vectors.
  • Wallet::receive_raw which receives raw binary tokens.

@lollerfirst lollerfirst marked this pull request as ready for review December 19, 2024 14:21
Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the plan is to remove support for V3 token binary cashubtc/nuts#202 so I think we should remove it here before merging to avoid having to take it out later.

@lollerfirst lollerfirst changed the title craw(A|B) Binary Token Serialization crawB Binary Token Serialization Dec 19, 2024
Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9b0cace

@thesimplekid thesimplekid merged commit 8055c0c into cashubtc:main Dec 19, 2024
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants