-
Notifications
You must be signed in to change notification settings - Fork 173
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
Add test vectors for other implementations of scripts #648
Conversation
covenantKeys := generateKeys(t, numCovenantKeys) | ||
finalityKeys := generateKeys(t, numFinalityKeys) | ||
stakerKeys := generateKeys(t, 1) |
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.
Do you think we need to make the test vector generation deterministic, such that everytime we run the test case we get the same vectors?
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.
at this point, I do not see a need to do that. This generator at this point is mostly a helper to avoid filling jsons manually.
Downstream consumers do not need to re-generate the testvectores themselves, they need to:
- parse
vectors.json
file - build staking output/unbonding transaction/scripts based on
parameters
in this json - check whether locally built objects are the same as
expected
.
return &cases | ||
} | ||
|
||
type Parameters struct { |
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.
Maybe not in this PR: do we want test vectors for Schnorr/adaptor signatures over staking/slashing/unbonding txs?
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.
I will think about this, this is not that easy as schnorr sigs have this randomness parameter inside which means, we cannot just bytes equality for signatures, we can only check signature/adaptor validity. I wonder whether it is worth it.
This is definitely something for sparate pr to improve on.
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.
we can only check signature/adaptor validity. I wonder whether it is worth it.
This is needed in BTC staking integration where the consumer side needs to verify the Schnorr/adaptor signatures over these txs received from Babylon. If the signatures are invalid then the consumer is supposed to reject the corresponding BTC delegation.
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.
hmm good point. Probably more imporant would be to test adaptor sigs verifcations, as verifing stand schnorr signatures is probably available in libraries in most languages. Created issue to track it- #653
Adding intial implementation of test vectors to test combatiblity between implementations of our scripts.
Added @SebastianElvis and @gbarkhatov as reviewers as they are working with rust and js implementation of our scripts.