SecretNetwork icon indicating copy to clipboard operation
SecretNetwork copied to clipboard

Idea: Add support for Ethereum signatures in Permits

Open Cashmaney opened this issue 2 years ago • 2 comments

Adding this here rather than the secret toolkit repo, though it would probably be more fitting there -

Would be interesting to be able to validate Ethereum EIP-712 signed messages as permits. This could allow contracts to give Ethereum/EVM users the option to view private data, which can be useful in applications such as private messaging, NFT ownership, lotteries, etc. For example, the Killroy Was Here mint could allow users to supply an Ethereum viewer address - that way they could view the movie without actually having a Secret address (or even installing Keplr), and if at a later stage they wanted to associate the NFT with an address on Secret to be able to sell/transfer it, the Ethereum permit could be supplied to the contract for ownership proof.

Since we already have secp256k1 signature validation as an API performance should be good (though RLP encoding/sha3 might not be super great - todo maybe we'll want to add sha3/keccak to the api for futureproofing).

Working with eth signatures is a bitch and a half, but with some tinkering this could be really interesting - thoughts?

Cashmaney avatar Jul 13 '22 11:07 Cashmaney

maybe we'll want to add sha3/keccak to the api for futureproofing

Yeah I've been wanting to add sha256 too

assafmo avatar Jul 13 '22 13:07 assafmo

Shade are doing this in their permit verification contract. Ref: https://github.com/securesecrets/query-authentication/pull/9

assafmo avatar Jul 18 '23 21:07 assafmo