-
Notifications
You must be signed in to change notification settings - Fork 48
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
Introduce Single Sender transaction authenticator #84
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xmaayan
force-pushed
the
secpk
branch
5 times, most recently
from
October 19, 2023 23:43
e41dd9a
to
8a42ca4
Compare
0xmaayan
commented
Oct 19, 2023
0xmaayan
commented
Oct 19, 2023
0xmaayan
commented
Oct 19, 2023
0xmaayan
commented
Oct 19, 2023
0xmaayan
commented
Oct 19, 2023
0xmaayan
commented
Oct 19, 2023
0xmaayan
commented
Oct 19, 2023
xbtmatt
reviewed
Oct 20, 2023
0xmaayan
force-pushed
the
secpk
branch
3 times, most recently
from
October 20, 2023 17:50
564ee2d
to
7db6323
Compare
0xmaayan
requested review from
gregnazario,
0xmigo,
heliuchuan and
a team
as code owners
October 20, 2023 17:50
gregnazario
reviewed
Oct 23, 2023
0xmigo
reviewed
Oct 23, 2023
0xmaayan
commented
Oct 24, 2023
0xmaayan
commented
Oct 24, 2023
gregnazario
approved these changes
Oct 24, 2023
xbtmatt
reviewed
Oct 24, 2023
xbtmatt
reviewed
Oct 24, 2023
xbtmatt
reviewed
Oct 24, 2023
xbtmatt
reviewed
Oct 24, 2023
xbtmatt
reviewed
Oct 24, 2023
xbtmatt
reviewed
Oct 25, 2023
xbtmatt
reviewed
Oct 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support to the new Single Sender introduced in AIP-55
We mostly have things represented in a way that reflects the rust code.
We introduce 2 new modules
AnyPublicKey
that holds a reference to aPublicKey
, we use it to represent any Single Sender key.AnySignature
that holds a reference to aSignature
, we use it to represent any Single Sender signature.When generating new keys (i.e creating an Account) we default to generate the new keys as
SingleSigner
but also support an optionallegacy
argument to generate keys based on the legacy ED25519 scheme.When want to get the account from an existing and known private key, i.e
await aptos.deriveAccountFromPrivateKey
, we derive the public and auth keys from the provided private key and then generating an Account based on the Account configured signing scheme - Legacy ED25519 or Single Sender. Note that this function is now an async function since we need to make api calls to chain.The transaction builder resolves to the correct signing scheme.
AnyPublicKey
we create aAccountAuthenticatorSingleKey
based on thePublicKey
the class holds reference to.SingleKey
we create aAccountAuthenticatorSingleKey
based on thePublicKey
the account uses.SingleKeyAuthenticator
we create aSingleSenderTransactionAuthenticator
to create aSignedTransaction
with.Also not, we remove
fromPrivateKeyAndAddress
static method asfromPrivateKey
basically does it nowTest Plan
Indexer doesnt support the new Single Sender yet, so tests are breaking. Was able to successfully run it locally without indexer
Related Links
AIP-55