canvasxyz/canvas

eip712: Verify Ethereum verifiable sessions/actions in a contract

Closed this issue · 0 comments

Tracking issue for hicommonwealth/commonwealth#6065.

Create a smart contract to verify eth verifiable actions/sessions.

We want to verify Canvas actions/sessions onchain. We can do this all inside a test in the signer package created in hicommonwealth/commonwealth#6064.

Even though hardhat is not as bleeding-edge as Foundry, it has better JS bindings (compare to e.g. https://github.com/latticexyz/mud/blob/main/packages/common/src/foundry/index.ts) so we'll use that. We can just set up a test flow that starts a local Hardhat node, deploys the contracts to it, and calls the contracts with all data needed to complete verification.

Add offchain-only tests to @canvas-js/chain-ethereum-verifiable that create a signer, create an session, sign a few actions, and verify those actions. These should be basically identical to packages/chain-ethereum/test/signer.test.ts.
Add onchain verification inside a contract, to the tests for @canvas-js/chain-ethereum-verifiable.
...