-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
crypto: intent signing for TransactionData #6445
Conversation
f835d21
to
5c0ab0b
Compare
2dc8106
to
59868c3
Compare
59868c3
to
b75c421
Compare
b75c421
to
c1f7552
Compare
c1f7552
to
bae34a6
Compare
bae34a6
to
89bafc5
Compare
89bafc5
to
ba22b21
Compare
💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3623059503#artifacts |
ba22b21
to
496b6bb
Compare
💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3658596476#artifacts |
💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3659140538#artifacts |
crates/sui-core/src/gateway_state.rs
Outdated
@@ -0,0 +1,1843 @@ | |||
// Copyright (c) 2021, Facebook, Inc. and its affiliates |
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 file has been removed
💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3659196288#artifacts |
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
💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3660018696#artifacts |
What is Intent Signing
u8
to representation the intent scopeTransactionData
instead of the entire path:IntentMessage
struct is the Intent itself and the generic value (in the case of user transaction, this is the structTransactionData
). Specifically, the intent serializes to threeu8
bytes where they representedIntentScope
,Version
andAppId
.Client Facing Changes
In Rust, use
Signature::new_secure(intent_message, signer)
In Typescript, construct dataToSign using BCS serialized
IntentMessage<TransactionData>
. This means the signature needs to be committed to the intent bytes and the BCS serializedTransactionData
, note that there is no TYPE_TAG anymore.Changes in this PR
SenderSignedData
now containsIntentMessage<TransactionData>
instead ofTransactionData
(this accounts for majority of LOC here that are trivial to review)keystore.sign
is nowkeystore.sign_secure
onIntentMessage<TransactionData>
instead of TransactionDataTransactionData::from_signable_bytes(tx_bytes)
is replaced bybcs::from_bytes(tx_bytes)
. This eliminates the type tag and its dep on BCSSignable rust trait