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

Replace publicKeyBase58 with publicKeyMultibase #82

Closed
wants to merge 3 commits into from
Closed

Replace publicKeyBase58 with publicKeyMultibase #82

wants to merge 3 commits into from

Conversation

bahner
Copy link

@bahner bahner commented Sep 10, 2023

Hepp! I believe this PR can be of use. The core says to start using multibase for encoding of keys, so I've attempted to add that. Don't be shy with civil criticisism.

@reinkrul
Copy link
Member

reinkrul commented Sep 11, 2023

See verification method properties of DID core data model: https://www.w3.org/TR/did-core/#verification-method-properties

Regarding backwards compatibility, it looks OK to me to replace the current property;

  • Nuts node the PublicKeyBase58 property in 1 place, which is easily fixed
  • We're not yet on 1.x, so theoretically API changes are fine
  • It's only populated for Edward-curves anyways

Copy link
Member

@reinkrul reinkrul left a comment

Choose a reason for hiding this comment

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

We use assert/require.NoError instead of nil check and t.Fatal (failure message is optional, but feel free to add the,).

did/document.go Outdated Show resolved Hide resolved
did/document_test.go Outdated Show resolved Hide resolved
did/test/did1-expected.json Outdated Show resolved Hide resolved
did/test/did1.json Outdated Show resolved Hide resolved
did/document_test.go Outdated Show resolved Hide resolved
did/document_test.go Outdated Show resolved Hide resolved
Co-authored-by: reinkrul <reinkrul@gmail.com>
did/document_test.go Outdated Show resolved Hide resolved
Copy link
Member

@woutslakhorst woutslakhorst left a comment

Choose a reason for hiding this comment

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

Thanks for the suggestion and work. I would suggest to keep PublicKeyBase58 in the VerificationMethod struct so we can always parse it (backwards compatible) and use the PublicKeyMultibase for adding new keys (via NewVerificationMethod).

This would require some added logic since either PublicKeyBase58 or PublicKeyMultibase must be filled, but not both.

@reinkrul
Copy link
Member

I would suggest to keep PublicKeyBase58 in the VerificationMethod struct so we can always parse it (backwards compatible) and use the PublicKeyMultibase for adding new keys (via NewVerificationMethod).

The spec now only specifies the multibase variant, so I'm fine with removing the base58 variant.

@woutslakhorst
Copy link
Member

I would suggest to keep PublicKeyBase58 in the VerificationMethod struct so we can always parse it (backwards compatible) and use the PublicKeyMultibase for adding new keys (via NewVerificationMethod).

The spec now only specifies the multibase variant, so I'm fine with removing the base58 variant.

Then the lib MUST go to a new major version and you have to support 2 versions

@bahner
Copy link
Author

bahner commented Sep 14, 2023

Hepp! I have had a few busy days at work. Fixed the bad test. Should be in accordance with @reinkrul wishes now. I understand @woutslakhorst objection. I thought about and assumed a major bump. But as @reinkrul stated elsewhere - we're not at 1.0 yet.

I'm good with either, but feel that supporting a deprecated version before 1.0 is being too nice. from my POV changes have finished as requested.

Co-authored-by: reinkrul <reinkrul@gmail.com>
@woutslakhorst
Copy link
Member

We're running the current version in production and there's no way we can move towards the new format.

@woutslakhorst
Copy link
Member

We're running the current version in production and there's no way we can move towards the new format.

I was mistaken, We only use PublicKeyJwk in production. However, even if we're not directly affected, others might. The best way is to add PublicKeyMultibase and deprecate PublicKeyBase58 with a message that it'll be removed in v1.x.y

@bahner
Copy link
Author

bahner commented Sep 19, 2023

Im sorry. I don't know how to solve that issue. Thanks for taking the time to review my suggestions.

@bahner bahner closed this Sep 19, 2023
@reinkrul
Copy link
Member

I'll give it a go.

@bahner
Copy link
Author

bahner commented Sep 25, 2023

Il miglior fabbro

@reinkrul
Copy link
Member

Im sorry. I don't know how to solve that issue. Thanks for taking the time to review my suggestions.

You deleted your branch, so I can't clone it. Do you still have it locally and can you push it again?

@bahner
Copy link
Author

bahner commented Sep 26, 2023 via email

@reinkrul
Copy link
Member

reinkrul commented Oct 8, 2023

Opened #86

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.

3 participants