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

Decision: use short form of btcr did if output index is 0 #5

Open
kimdhamilton opened this issue Aug 6, 2019 · 6 comments
Open

Decision: use short form of btcr did if output index is 0 #5

kimdhamilton opened this issue Aug 6, 2019 · 6 comments

Comments

@kimdhamilton
Copy link
Collaborator

This affects code samples, libraries and method spec

When txout is 0, the short form of the btcr did (with testnet, this yields the x prefix) should be used.

BIP136 supports both forms for index 0, but we are making the decision that BTCR supports only the short form when index==0.

Reason: shorter, and it's a potential security risk to allow 2 formats

@peacekeeper
Copy link
Member

Sounds good.. So for example if I try to resolve did:btcr:8kyt-fzzq-qqqq-ase0-d8, then the resolver should throw an error, whereas did:btcr:xkyt-fzzq-q4wq-f2d would work, right?

peacekeeper referenced this issue in decentralized-identity/universal-resolver-frontend Aug 7, 2019
Signed-off-by: Markus Sabadello <markus@danubetech.com>
@danpape
Copy link
Collaborator

danpape commented Aug 7, 2019 via email

@peacekeeper
Copy link
Member

programs should probably accept the long form as input

My sense is that @kimdhamilton is right that it's a potential security risk to allow 2 formats. I can also imagine semantic problems if you have 2 (different, but linked) identifiers for the same resource.

A generic txref library could continue to accept both, but on the DID resolver layer I think it's better to only allow one form.

@kimdhamilton
Copy link
Collaborator Author

+1 that only 1 should be accepted at the DID resolver layer. When we discussed yesterday, we mentioned 2 reasons:

  1. clarity for resolution implementers
  2. potential security issue

I thought we agreed on this yesterday, but let me know if you want to discuss further @danpape

@danpape
Copy link
Collaborator

danpape commented Aug 7, 2019 via email

@ChristopherA
Copy link
Member

A test for this should be:

For testnet transaction: f8cdaff3ebd9e862ed5885f8975489090595abe1470397f79780ead1c7528107

INVALID (as output index is 0): did:btcr:8yv2-xzpq-qqqq-9yce-nk

SHOULD BE: did:btcr:xyv2-xzpq-q9wa-p7t

-- Christopher Allen

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

4 participants