ergoplatform / ergo

Ergo protocol description & reference client implementation
https://ergoplatform.org/
Creative Commons Zero v1.0 Universal
499 stars 169 forks source link

API: /script/execute or /script/executeWithContext #902

Closed jasondavies closed 4 years ago

jasondavies commented 5 years ago

From morphic on Slack:

Not exactly, the script has to be executed in the target context and the resulting SigmaProp (which is tree data structure in general) should be investigated. Then existing keys should be matched with those in the tree. If there are AND, OR or THRESHOLD connectives in the tree, corresponding sigma protocol operations have to be executed to generate signatures. (proofs in Sigma terminology)

I think along with #901, we also need the ability to execute a script in a given target context so that we can generate proofs for the resulting SigmaProp.

aslesarenko commented 5 years ago

Implementation steps:

In general, this involves many subsystems, so you may need to dig along these steps. Ping me with questions in comments below if necessary.

To understand which Json to send, for example, you can make ErgoLikeContext and serialize it to Json via ergoLikeContextEncoder.

NOTE: The work should be done using v3.0.3 branch of Sigma.