-
Notifications
You must be signed in to change notification settings - Fork 52
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
Strongly typed crypto proposal #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
CHANGELOG updates is missing
583b038
to
f8c3caf
Compare
ad77ec3
to
ededd97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the naming of some of the types are a bit confusing. Some may have been there from before this PR, but it would be great to clarify them if possible.
src/core/account/ed25519.ts
Outdated
* | ||
* Note: Generating a signer instance does not create the account on-chain. | ||
*/ | ||
export class Ed25519Account implements Account { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is representation of the "legacy" ed25519 right? I wonder if we should mention it and encourage using the new single key scheme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, the more I think of it, the more I think we should just always use the "legacy" ed25519 and possibly even discourage using the ed25519 variant of the single key authentication scheme.
We have to keep the legacy authentication scheme forever anyway. And if that's the case why should we over-complicate things and have two types of Ed25519 accounts around that can cause confusion and bugs.
Or maybe not? And maybe we can drop support in a year or two, and push users to rotate their authentication key.
And then we remove the code that handles the legacy authentication schemes..
I personally don't know what is the right call and I'm open to any of the solutions.
But the "laziest" for everyone would be what I proposed, where the only downside is to have to keep around the legacy authentication keys and authenticators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is an implementation decision question and @davidiw can help with it.
I assume we eventually would want to support by default single key scheme, for future new authentication schemes also.
Also, if aptos-core supports both schemes, I think the sdk should probably support it also. We already need to support single key scheme for secp and probably some in the future so why not support all single key schemes?
src/core/account/account.ts
Outdated
* | ||
* Note: Generating an account instance does not create the account on-chain. | ||
*/ | ||
export abstract class Account { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As part of the new wallet standard, we had the AccountInfo interface to hold an account of type Account
export interface AccountInfo = { account: Account, ansName?: string }
this was mostly done so it would be easier for us to resolve the account type (single signer/ multi signer) using the variant
field - was this changed with this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, where did AptosAccountVariant
enum go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some feedback regarding having both Signer
and Account
from @heliuchuan .
The argument is that it would be a breaking change, and the Signer
name wouldn't be as intuitive.
So in this PR we only have Account
and it has signing capabilities.
I think that for AccountInfo
we can have the following struct, which would be functionally equivalent and similar to what we had before:
export interface AccountInfo = { address: AccountAddress, publicKey: AccountPublicKey, ansName?: string }
would also be nice to make it BCS serializable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update the standard AIP then. The AIP currently relies on that change we planned to have
9639916
to
46bff83
Compare
@hardsetting once it lands, we might need to update the docs on aptos.dev if there is anything specific to call out |
b9828a4
to
117c3c7
Compare
there's no breaking change at this point |
Gathered all the feedback, and just rolled back more changes from the original PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending Oliver's feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
117c3c7
to
bb8d2e7
Compare
Simplified and cleaned up #147
Notably, I rolled back renaming the
Account
class intoSigner
to avoid a breaking change and following some naming discussions.Will add a better description in the AM.