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

Add a PSBT per-output field for BIP 353 DNSSEC Proofs #1657

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

TheBlueMatt
Copy link
Contributor

When using BIP 353 for on-chain addresses (incl silent payments),
it is useful to be able to include DNSSEC proof information in
outputs of a PSBT, which we enable here by defining a standard
field for it.

| None
| No key data
| <tt><RFC 9102-formatted DNSSEC Proof></tt>
| An RFC 9102 DNSSEC `Authentication Chain Data` without the `ExtSupportLifetime` field (i.e. a series of RFC 9102 `AuthenticationChain`s) providing a DNSSEC proof to a BIP 353 DNS TXT record.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| An RFC 9102 DNSSEC `Authentication Chain Data` without the `ExtSupportLifetime` field (i.e. a series of RFC 9102 `AuthenticationChain`s) providing a DNSSEC proof to a BIP 353 DNS TXT record.
| An RFC 9102 DNSSEC <tt>Authentication Chain Data</tt> without the <tt>ExtSupportLifetime</tt> field (i.e. a series of RFC 9102 <tt>AuthenticationChain</tt>s) providing a DNSSEC proof to a BIP 353 DNS TXT record.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to render fine either way, no? The <> version makes reading the plaintext much more difficult.

Copy link
Member

Choose a reason for hiding this comment

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

backticks don't render as code formatting, if that was what you were trying to do. Otherwise, I'd suggest using single quotes here instead of backticks.

@jonatack jonatack added the Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified label Jul 28, 2024
@TheBlueMatt
Copy link
Contributor Author

Realized this doesn't actually work without the name itself, so force-pushed that in.

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

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

Seems reasonable. @achow101, could you take a look please?

bip-0353.mediawiki Outdated Show resolved Hide resolved
It seems confusing to call BIP 353 names "addresses", and most of
the BIP refers to them as "names", but a few "human-readable
addresses" snuck in in a recent change, which are fixed here.
| None
| <tt><1-byte-length-prefixed BIP 353 human-readable name without the ₿ prefix><RFC 9102-formatted DNSSEC Proof></tt>
| A BIP 353 human-readable name (without the ₿ prefix), prefixed by a 1-byte length.
Followed by an RFC 9102 DNSSEC `Authentication Chain Data` without the `ExtSupportLifetime` field (i.e. a series of RFC 9102 `AuthenticationChain`s) providing a DNSSEC proof to a BIP 353 DNS TXT record.
Copy link
Member

@achow101 achow101 Aug 19, 2024

Choose a reason for hiding this comment

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

A link to the relevant RFC and section would be nice. But I find the RFC to be a bit vague here, so it might be easier to just write out what the serialization is supposed to be?

Copy link
Member

Choose a reason for hiding this comment

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

Since a single RRSIG can cover multiple RRs in the response, those RRs would need to be included in order to verify the signature. Does there need to be any specific handling and/or disallowing of such RRSets?

RRSIG also specifies a validity period for the signature. How should validators deal with those, especially since a PSBT can take a lot of time between updating and signing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A link to the relevant RFC and section would be nice.

You mean like an HTTP link?

But I find the RFC to be a bit vague here, so it might be easier to just write out what the serialization is supposed to be?

Not sure I can be much more accurate. Its basically just "a series of DNS records written out in DNS record format", but that's not exactly clear either...

Since a single RRSIG can cover multiple RRs in the response, those RRs would need to be included in order to verify the signature. Does there need to be any specific handling and/or disallowing of such RRSets?

Those would need to be included. I believe RFC 9102 is clear here - "In either case, the chain of RRsets MUST be accompanied by the full set of DNS records needed to authenticate the TLSA record set or its denial of existence up the DNS hierarchy to either the root zone or another trust anchor mutually configured by the TLS server and client."

RRSIG also specifies a validity period for the signature. How should validators deal with those, especially since a PSBT can take a lot of time between updating and signing.

That's deliberately left undefined here. The library I wrote exposes the proof validity start and end time as well as the TTL, but I imagine most users will ignore the TTL, and probably should, only paying attention to the proof validity start and end times.

@achow101
Copy link
Member

Realized this doesn't actually work without the name itself, so force-pushed that in.

Wouldn't the Authentication Chain already contain the name since it has the record itself?

! Versions Allowing Inclusion
|-
| BIP 353 DNSSEC proof
| <tt>PSBT_OUT_DNSSEC_PROOF = 0x35</tt>
Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice to just go in order... the next field available is 0x09.

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 liked the DNS port (53) :)
But I can do whatever, it doesn't matter...

@bitcoin bitcoin deleted a comment from kingcathy23 Aug 19, 2024
@bigspider
Copy link
Contributor

bigspider commented Aug 22, 2024

As I understand it, the semantic meaning is to provide a form of authentication of the output, in order to establish "this output belongs to a certain identity".

Perhaps it would be worth having a generic keytype called maybe PSBT_OUT_AUTHENTICATION_PROOF, and use the keydata to label the type of authentication, for example reserving keydata = 0x00 for the DNSSEC_PROOF as per the rest of the specs, and leaving the meaning undefined for any other keydata.
It costs a single additional byte per output, but avoids having to define a new keytype if/when other approaches to the authentication of outputs are proposed.

@TheBlueMatt
Copy link
Contributor Author

Wouldn't the Authentication Chain already contain the name since it has the record itself?

Technically yes, but the Authentication Chain is just a list of records "in no particular order", which makes it somewhat annoying to figure out the name. If you have a wildcard it could even be impossible.

When using BIP 353 for on-chain addresses (incl silent payments),
it is useful to be able to include DNSSEC proof information in
outputs of a PSBT, which we enable here by defining a standard
field for it.
@achow101
Copy link
Member

ACK b0d5a07

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

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

Looks good to me, merging this as it only adds specification for how to handle PSBTs and adjusts "human-readable address" to "human-readable name in the BIP text. Also has sign-off from BIP 174 author.

@murchandamus murchandamus merged commit 69d8eeb into bitcoin:master Aug 29, 2024
4 checks passed
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Post-merge lgtm

@jonatack jonatack removed the Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified label Aug 29, 2024
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.

6 participants