pub trait OnchainKeyRepresentable {
// Required method
fn to_ethereum_representation(&self) -> Result<U256, PrimitiveError>;
}Expand description
A trait for types that can be represented as a U256 on-chain.
Required Methods§
Sourcefn to_ethereum_representation(&self) -> Result<U256, PrimitiveError>
fn to_ethereum_representation(&self) -> Result<U256, PrimitiveError>
Converts an off-chain public key into a U256 representation for on-chain use in the WorldIDRegistry contract.
The U256 representation is a 32-byte little-endian encoding of the compressed (single point) public key.
§Errors
Will error if the public key unexpectedly fails to serialize.