feat: Stateless validation function receives public keys corresponding to each transaction#17841
Conversation
Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
|
@mattsse bump on this |
mattsse
left a comment
There was a problem hiding this comment.
some thoughts on trait support for recovery, but I'm also okay with proceeding with this
dbcb34a to
706de6a
Compare
a92ff86 to
e475deb
Compare
|
@mattsse public key type is no longer exposed in the interface and added feature flags for the two secp256k1 crates -- feature flags are a bit complex because the CI checks for --no-default-features and --all-features, will check it again in the morning to clean up |
| /// Verifies a transaction using its signature and the given public key. | ||
| /// | ||
| /// Note: If the signature or the public key is incorrect, then this method | ||
| /// will return an error. | ||
| /// | ||
| /// Returns the address derived from the public key. |
There was a problem hiding this comment.
This function and the ones below it could be placed into alloy next to recover_signer
|
@mattsse bump on this |
mattsse
left a comment
There was a problem hiding this comment.
fine with me,
left one more q
| let _: B256 = sig_hash; | ||
| let _: &Signature = sig; | ||
|
|
||
| unimplemented!("Must choose either k256 or secp256k1 feature") |
There was a problem hiding this comment.
should this even result in a compile_error! ?
There was a problem hiding this comment.
Tried to go with the suggested cleaner route, though it means that all methods called by this method would have a cfg(any(secp256k1 || k256)) too -- I may be missing something re making this cleaner without leaking it to all of the methods that call it
37c0757 to
e18d8f0
Compare
…g to each transaction (paradigmxyz#17841) Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
…g to each transaction (paradigmxyz#17841) Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
Taken and modified from: https://github.com/risc0/zeth/compare/wollac/wip/pre-recover
This PR changes the interface to use block and public keys, allowing the host to recover the public keys outside of the guest and do signature verification inside of the guest