feat: use EVM authentication for units
bonustrack opened this issue · comments
Currently users sending units (similar to transaction) to Highlight are not authenticated, we only use an oracle to relay users message with this endpoint: https://github.com/snapshot-labs/highlight/blob/main/src/rpc.ts#L63-L98
We should remove the oracle system and instead authenticate user directly with the same interface than EVM based network. This mean each of the agent functions have a corresponding ABI file, transaction are encoded and sent to Highlight using Ethers.js like you would do with any EVM network. On Highlight transaction signature are verified and decoded.
I've started change on the Highlight.js SDK in this branch but it's not complete:
https://github.com/snapshot-labs/highlight.js/tree/fabien/evm-auth
Considerations
- Currently Highlight support sending multiple transaction at once, because EVM doesn't support that we will need to remove this ability.
- Transaction should have 0 gas cost.
- Technically it should work using Metamask with Highlight as network endpoint but this may require to add some RPC methods like "eth_chainId" and "eth_getBlockByNumber"