-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: Use serialized signature for execute_transaction endpoint (#7185)
## What Make `sui_executeTransaction` API the same as `sui_executeTransactionSerializedSig`. This `sui_executeTransaction` now requires the client to be responsible to serialize `flag || signature || pubkey` in one field and submit in the `signature` field. Instead of sending three separate fields previously (scheme, pubkey, signature). ## Why This simplifies future use cases for multisig and multi agent execute transaction. ## How to use In Rust: ``` let serialized_sig = crypto::Signature::from_bytes(&[&*flag, &*sig_bytes, &*pub_key].concat()).unwrap(); ``` In CLI: See usage of `sui keytool sign`. ```shell target/debug/sui keytool sign --address 0xb59ce11ef3ad15b6c247dda9890dce1b781f99df --data $DATA_TO_SIGN Intent message to sign: AAAAAAP986VtisOQSZxhH9M4A24xOaDppQDue7TlY/36sS2HyepBJa2PjB3RkxSAjb+7Pv1voJYk/RjX9AlYZ5+hAgAAAAAAAAAgghpx3ucYetjUIHnaFCho6iaUXnt4hczdAeLlgIw0GqsBAAAAAAAAAOgDAAAAAAAA Signer address: 0xb59ce11ef3ad15b6c247dda9890dce1b781f99df Serialized signature (`flag || sig || pk` in Base64): $SERIALIZED_SIG ``` In Typescript: ``` // Serialize signature field as: `flag || sig || pk` const serialized_sig = new Uint8Array( 1 + signature.getLength() + pubkey.toBytes().length ); serialized_sig.set([SIGNATURE_SCHEME_TO_FLAG[signatureScheme]]); serialized_sig.set(signature.getData(), 1); serialized_sig.set(pubkey.toBytes(), 1 + signature.getLength()); ``` Also fixed some ergonomics and bugs of keytool and offline signing docs.
- Loading branch information
Showing
13 changed files
with
190 additions
and
440 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@mysten/sui.js": minor | ||
--- | ||
|
||
Deprecate sui_executeTransaction in favor of sui_executeTransactionSerializedSig |
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
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
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
Oops, something went wrong.
5cd51dd
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.
Successfully deployed to the following URLs:
wallet-adapter – ./sdk/wallet-adapter/example
sui-wallet-adapter.vercel.app
wallet-adapter-git-main-mysten-labs.vercel.app
wallet-adapter-mysten-labs.vercel.app
5cd51dd
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.
Owned Transactions Benchmark Results
Shared Transactions Benchmark Results
Narwhal Benchmark Results