DRAND Encrypt To Round calldata encoding bindings for Rust/JavaScript#400
DRAND Encrypt To Round calldata encoding bindings for Rust/JavaScript#400raugfer wants to merge 45 commits intokeep-starknet-strange:mainfrom
Conversation
| if signature.is_zero() { | ||
| Option::None |
There was a problem hiding this comment.
What we can do is the following:
full_proof_with_hints can be the concatenation of the DrandDecryptHint || DrandHint (optionally).
Therefore, if the sig is not available for this round, the contract can call the verify_round function with the rest of the array to get the signature.
Client side, the tooling would check if the sig is available for this round, and would append or not the DrandHint to the full_proof_with_hints array based on the contract storage having the sig ready or not.
Contract side, the flow can look like :
if signature.is_zero() {
let signature = verify_round(ref full_proof_with_hint) } // First deserialization using ref "advanced" the array (the DrandDecryptHint got popped out) so we can just pass it.
// flow continues.
Therefore, if contract has sig : Contract doesn't call verify_round/
client send drand decrypt + drand hint : it just dismiss the drand hint calldata
client send drand decrypt only : "optimal" case
if contract does not have the sig stored, Contract call verify_round :
client send drand decrypt + drand hint : "second part" of calldata is used there
client send drand decrypt only : Contract will fail at de serializing the second part since it's empty
There was a problem hiding this comment.
Thanks, I will make the changes
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information