9 Replies
have you tried it?
I have tried and failed
you can follow this thread
https://discord.com/channels/668903786361651200/840313005064585246/1245088903212433438
I am sure I was close
this is the only method found that has anything to do with directly signing
signMessage :
https://github.com/ScorexFoundation/sigmastate-interpreter/blob/18961181f1858c56cc149efcd0f035573c6351e5/interpreter/js/src/main/scala/sigma/interpreter/js/SigmaPropProver.scala#L89just published a new version v0.4.3, which now support generating commitements for ReducedTransaction and also passing such commitments to singing methods of SigmaProver. https://www.npmjs.com/package/sigmastate-js
See this PR for the changes https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1000
On very high level you need to follow these steps:
1) Create SigmaProver
2) Create Fleet's UnsignedTransaction
3) Reduce the tx to ReducedTransaction using SigmaProver
4) call generateCommitments for the reducedTx and get TransactionHintsBag
5) share commitments with cosigners
6) When all the hints are collected, call signReduced passing them to the method
The exact detail are tricky and you need to look at Minotaur's sources
Sigma-js provides only basic utility methods, but the whole process should be managed by the app.
@c8 @MGpai ^
also at the moment ProverHints is the blackbox, there are not methods to get and manipulate the content.
Let me know if some methods are missing.
i looked into minotaur, it's a great reference, also reported a multisig bug (still open), just to confirm, should i be able with those steps sign a SINGLE multisig input? @morphic
It currently not possible with sigma-rust wasm (maybe after this PR https://github.com/ergoplatform/sigma-rust/pull/751).
I am hoping to sign this transaction:
It looks great, i would love to use it for crystal-pool(https://savonarolalabs.github.io/crystal-pool/#/README), but i need to be able to sign individual inputs, and individual multisig inputs @morphic any chance to add it in the near future?
Strictly speaking this method is not necessary, as signing a single input can be done by adding special hints for the other inputs. But yes, such method is useful helper. Will add similar to SigmaProver.
today/tomorrow will be ready
input signing method added https://github.com/ScorexFoundation/sigmastate-interpreter/blob/04e7cb6870059c99d670340f48ac567650545aa5/sdk/js/src/main/scala/org/ergoplatform/sdk/js/SigmaProver.scala#L77
See also signReducedInput method.
Created a one liner test repo (check it out), where i tried signing with
sigmastate-js https://github.com/SavonarolaLabs/multisig-input:
1. Am i on the right track @morphic @MGpai and
2. How do i get previousStateDigest? https://github.com/SavonarolaLabs/multisig-input/blob/53f66d0a40d03cf0bada468a06bc8d0b964ac604/sign.test.ts#L65GitHub
multisig-input/sign.test.ts at 53f66d0a40d03cf0bada468a06bc8d0b964a...
Proof of concept for signing an AlicePK && BobPK multisig input - SavonarolaLabs/multisig-input
yes, thank you, now i understand what you ment by "i was close", i copied your map functions for headers, but i am still stuck with an undefined.