sui icon indicating copy to clipboard operation
sui copied to clipboard

doc: Provide instruction on offline signing

Open joyqvq opened this issue 3 years ago • 5 comments

joyqvq avatar Nov 04 '22 17:11 joyqvq

Thanks for jumping on this Joy!

Can we find a home for this in docs? CC @randall-Mysten

sblackshear avatar Nov 04 '22 21:11 sblackshear

Indeed. It sort of fits in the Devnet topic, but that topic needs a rework and new title. How about after the Client CLI topic until I can integrate it into the new site nav? Another option is in the Connect to Sui section - also needs a new name and most of those topics will be moved elsewhere with the refresh. If you want to merge it, I can move the file and add it to the doc site after a copyedit.

randall-Mysten avatar Nov 04 '22 23:11 randall-Mysten

Is there anyway to calculate tx_digest offline?

LanfordCai avatar Nov 06 '22 17:11 LanfordCai

Is there anyway to calculate tx_digest offline?

whats the use case here? this is possible, but it requires some work: you can calculate it by taking the sha3_256 of the BCS serialized sender signed data struct.

TransactionDigest::new(sha3_hash(&self.signed_data))
pub struct SenderSignedData {
    pub data: TransactionData,
    pub tx_signature: Signature,
}

joyqvq avatar Nov 07 '22 22:11 joyqvq

Is there anyway to calculate tx_digest offline?

whats the use case here? this is possible, but it requires some work: you can calculate it by taking the sha3_256 of the BCS serialized sender signed data struct.

TransactionDigest::new(sha3_hash(&self.signed_data))
pub struct SenderSignedData {
    pub data: TransactionData,
    pub tx_signature: Signature,
}

Yeah, I know how to get it by using Rust code now, but it would be better if it's available in TS SDK.

I'm working for a CEX. For the most chains, we build and sign the transaction offline, and save the offline generated txid(tx_digest in Sui) to our database. Then we will sync the blockchain to find the transaction with txids generated by our system. It's would be more convenient for third parties like us to integrate Sui if we can have the ability to generate tx_digest without broadcasting

LanfordCai avatar Nov 08 '22 04:11 LanfordCai

Is there anyway to calculate tx_digest offline?

whats the use case here? this is possible, but it requires some work: you can calculate it by taking the sha3_256 of the BCS serialized sender signed data struct.

TransactionDigest::new(sha3_hash(&self.signed_data))
pub struct SenderSignedData {
    pub data: TransactionData,
    pub tx_signature: Signature,
}

Yeah, I know how to get it by using Rust code now, but it would be better if it's available in TS SDK.

I'm working for a CEX. For the most chains, we build and sign the transaction offline, and save the offline generated txid(tx_digest in Sui) to our database. Then we will sync the blockchain to find the transaction with txids generated by our system. It's would be more convenient for third parties like us to integrate Sui if we can have the ability to generate tx_digest without broadcasting

makes sense - this PR should land soon https://github.com/MystenLabs/sui/pull/5010

joyqvq avatar Nov 08 '22 18:11 joyqvq