-
Notifications
You must be signed in to change notification settings - Fork 51
Description
References:
EIP-11
Improved distributed signatures
New code should be in prover::multi_sig module.
Generate commitments
fn generate_commitments(tx_context: TransactionContext, state_context: &ErgoStateContext) -> Result<TransactionHintsBag, _> function should be an equivalent of wallet/generateCommitments node API call, see implementation at https://github.com/ergoplatform/ergo/blob/95139ec990fc91f8f4c70a61468edf8834143329/ergo-wallet/src/main/scala/org/ergoplatform/wallet/interpreter/ErgoProvingInterpreter.scala#L182-L222
TransactionHintsBag type should be an equivalent of https://github.com/ergoplatform/ergo/blob/95139ec990fc91f8f4c70a61468edf8834143329/ergo-wallet/src/main/scala/org/ergoplatform/wallet/interpreter/TransactionHintsBag.scala#L5
Extract hints from signed(invalid) transaction
fn extract_hints(tx_context: TransactionContext, state_context: &ErgoStateContext, real_secrets_to_extract: Vec<SigmaBoolean>, simulated_secrets_to_extract: Vec<SigmaBoolean>) -> Result<TransactionHintsBag, _> should be an equivalent of script/extractHints node API call, see implementation at https://github.com/ergoplatform/ergo/blob/95139ec990fc91f8f4c70a61468edf8834143329/ergo-wallet/src/main/scala/org/ergoplatform/wallet/interpreter/ErgoProvingInterpreter.scala#L224-L263
Hints support in prover and tx signing
- Check how hints are used in prover and implement the missing parts compared to the Scala reference implementation at https://github.com/ScorexFoundation/sigmastate-interpreter/blob/455d4a3b5a82eec9301be89019d8ea675386474a/sigmastate/src/main/scala/sigmastate/interpreter/ProverInterpreter.scala#L68-L103
- add
tx_hints: TransactionHintsBagparameter toWallet::sign_*methods and pass it down to prover (asHintsBag);
Wasm API.
- Expose
TransactionHintsBagtype via wrapper; - Add
tx_hints: TransactionHintsBagparameters toWallet::sign_*methods; - Expose
generate_commitmentsandextract_hints(passing serialized SigmaBooleans) functions.
Testing.
- implement test scenarios from https://github.com/ScorexFoundation/sigmastate-interpreter/blob/prepare-v5.0-evaluator/sigmastate/src/test/scala/sigmastate/utxo/DistributedSigSpecification.scala
- tests for
generate_commitmentsshould be implemented after https://github.com/ScorexFoundation/sigmastate-interpreter/blob/455d4a3b5a82eec9301be89019d8ea675386474a/sigmastate/src/test/scala/sigmastate/utxo/ProverSpecification.scala#L17-L58