Skip to content
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

[500 SigmaUSD] Distributed signatures support #367

Closed
greenhat opened this issue Aug 10, 2021 · 6 comments · Fixed by #470
Closed

[500 SigmaUSD] Distributed signatures support #367

greenhat opened this issue Aug 10, 2021 · 6 comments · Fixed by #470
Labels
bounty Bounty for resolving the issue help wanted
Milestone

Comments

@greenhat
Copy link
Member

greenhat commented Aug 10, 2021

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

Wasm API.

  • Expose TransactionHintsBag type via wrapper;
  • Add tx_hints: TransactionHintsBag parameters to Wallet::sign_* methods;
  • Expose generate_commitments and extract_hints (passing serialized SigmaBooleans) functions.

Testing.

@greenhat greenhat added this to the v1.0.0 milestone Aug 10, 2021
@sahandzou
Copy link
Contributor

I will take it.

@greenhat greenhat changed the title Distributed signatures support in Prover [500 SigmaUSD] Distributed signatures support Oct 27, 2021
@greenhat greenhat added bounty Bounty for resolving the issue help wanted labels Oct 27, 2021
@greenhat
Copy link
Member Author

greenhat commented Oct 27, 2021

@sahandzou I added requirements and implementation details in the description. Please keep in mind that I'm doing AtLeast implementation in #377 which makes a lot of small changes in sigma protocol implementation (see prover.rs file). I'd suggest you start your branch on top of mine. Feel free to make a draft PR and ask any questions during the process.

EDIT: Or alternatively you can branch from develop and start drafting prover::multi_sig module and then rebase after I merge #377 which I expect to happen early next week.

@sahandzou
Copy link
Contributor

thanks.

@greenhat
Copy link
Member Author

@sahandzou Build and tests are green in my #377 in case you want to branch off of it.

@greenhat greenhat mentioned this issue Nov 1, 2021
@greenhat greenhat linked a pull request Nov 8, 2021 that will close this issue
@sahandzou
Copy link
Contributor

sahandzou commented Nov 10, 2021

UPDATE: multi-sig test with two signers passed!

@greenhat
Copy link
Member Author

The bounty is sent. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty Bounty for resolving the issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants