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

Base32 followups, Features serialization #3308

Open
optout21 opened this issue Sep 10, 2024 · 2 comments
Open

Base32 followups, Features serialization #3308

optout21 opened this issue Sep 10, 2024 · 2 comments

Comments

@optout21
Copy link
Contributor

optout21 commented Sep 10, 2024

Some followups to Base32/Bech32 changes #3270

Bolt11InvoiceFeatures are serialized to 5-bit values internally, but in a way that is not compatible with Bech32. The grouping of bits is done in reverse (both byte order and bit order). The current native implementation could be switch to be based on rust-bech32 (increased reuse), and iterative approach (less allocations). See:
#3270 (comment)

Change fn from_base32(b32: &[Fe32]) to take iterator instead of slice; see #3270 (comment)

Also: (minor) #3270 (comment)

@TheBlueMatt
Copy link
Collaborator

Also, after we bump our MSRV we can drop all the Boxes we added in serialization.

@optout21
Copy link
Contributor Author

In rust-bech32, option with no-trimming 5-bit-to-8-bit conversion is on its way. When it's available (in a new release), the pre-padding in LDK can be removed -- in Bolt11Features serialization and in invoice hash computation.
rust-bitcoin/rust-bech32#201

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

No branches or pull requests

2 participants