cairo-contracts icon indicating copy to clipboard operation
cairo-contracts copied to clipboard

EIP-712 / SNIP-12

Open EdgarBarrantes opened this issue 3 years ago • 2 comments

🧐 Motivation

EIP-712 is implemented in a draft in the solidity contracts. It seems like a good idea to implement in cairo as well considering that Argent-X seems to be using it it.

📝 Details

I'm not entirely sure about Cairo's capabilities for this. The standard library does support keccak. Everything would be a felt as well. Any guidance on how one would approach this is highly appreciated.

EdgarBarrantes avatar Aug 01 '22 11:08 EdgarBarrantes

The repository developed by @0xChqrles offers a good start for initiating this PR. It enables computing typed data hash, checking their signature, and consuming them.

@martriay What changes do you think are needed to integrate this feature into OZ? I believe it's an important feature because all wallets rely on an EIP-712 signature method implemented by starknetjs, and it's important to have the capability to recompute this hash on-chain.

remiroyc avatar Dec 09 '23 10:12 remiroyc

Thank you for mentioning my repo ! It only supports SNIP-12 revision 0 but I would be glad to help supporting revision 1 too !

0xChqrles avatar Dec 09 '23 10:12 0xChqrles