-
Notifications
You must be signed in to change notification settings - Fork 84
DRAND Encrypt To Round calldata encoding bindings for Rust/JavaScript #400
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
base: main
Are you sure you want to change the base?
Conversation
| if signature.is_zero() { | ||
| Option::None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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