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

Persist and expose BIP353 addresses #718

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danielgranhao
Copy link
Contributor

@danielgranhao danielgranhao commented Feb 5, 2025

Resolves #714.

Depends on sdk-common PR: breez/breez-sdk-greenlight#1164

This PR adds the bip353 address to PaymentTxDetails, persisting it locally and syncing it to other devices. The address is then exposed as an additional field of PaymentDetails::Lightning. Technically, bip353 can also be used to fetch onchain addresses, but that isn't currently supported. We can add it to PaymentDetails::Bitcoin once it is.

Test notes

Paying to a BIP353 address that resolves to a BOLT12 or an LNURL Pay results in a payment entry that shows the bip353 that was used. Note that this will only be testable once Misty exposes the new field.

@@ -67,12 +67,19 @@ interface InputType {
Bolt12Offer(LNOffer offer);
NodeId(string node_id);
Url(string url);
Bip353Address(ResolvedBip353 resolved_bip353);
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to expose the Bip353Address to the user? It looks like the user will need to add extra logic to handle this (matching the internal structure). Just curious if there is an advantage vs resolving the internal structure automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

@roeierez After the integration, I didn't see much benefit to having the wrapper Bip353Address as an InputType. In fact, it made things a bit more complicated. It's better to add an optional bip353_address field to Bolt12Offer & LnUrlPay as such:

Bolt12Offer(LNOffer offer, string? bip353_address);
LnUrlPay(LnUrlPayRequestData request_data, string? bip353_address);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied @erdemyerebasmaz's suggestion. I didn't pursue it initially because it felt weird, but indeed it's simpler.

@danielgranhao danielgranhao force-pushed the daniel-persist-bip353-address branch 4 times, most recently from f02fe47 to 1dc140a Compare February 6, 2025 15:47
@danielgranhao danielgranhao force-pushed the daniel-persist-bip353-address branch from 1dc140a to deb1e23 Compare February 6, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist BIP 353 Address on Payment Details
3 participants