Clear Signing
Natural language interpretation of transaction intent, backed by zero-knowledge proofs.
When you sign an Ethereum transaction, your wallet shows you raw calldata, a hex blob that means nothing to a human. Clear signing translates this intent into natural language. But that translation is a new thing to trust. We propose an extension of the Verity DSL allowing to formalize natural language interpretation of user intents within the protocol specifications.
The compiler produces two artifacts from each spec: a JSON descriptor that any frontend can load to interpret calldata as natural language, and a Groth16 circuit that allows even an embedded device to verify the interpretation is correct.
How it works
- Spec lookup: the contract address is looked up in the specs library
- Function identification: the 4-byte selector identifies which function is being called
- Calldata decoding: raw bytes are decoded into typed parameters using the ABI
- Intent evaluation: the DSL program selects a template and fills its holes
- External specifications resolution: addresses in the template are matched against other specs in the registry
- Verified display: the final sentence is shown
- Proof generation: a Groth16 proof is generated and verified in your browser
Specs library
Contracts/USDC/Display.lean
import Verity.Intent.DSLnamespace Contracts.USDCopen Verity.Intent.DSLprivate def maxUint256 : Int := (2 ^ 256 : Nat) - 1intent_spec "USDC" whereconst decimals := 6intent transfer(to : address, amount : uint256) wherewhen amount == maxUint256 =>emit "Send all USDC to {to}"otherwise =>emit "Send {amount:fixed decimals} USDC to {to}"intent approve(spender : address, amount : uint256) wherewhen amount == maxUint256 =>emit "Approve {spender} to spend unlimited USDC"otherwise =>emit "Approve {spender} to spend {amount:fixed decimals} USDC"intent transferFrom(from : address, to : address, amount : uint256) wherewhen amount == maxUint256 =>emit "Transfer all USDC from {from} to {to}"otherwise =>emit "Transfer {amount:fixed decimals} USDC from {from} to {to}"end Contracts.USDC
Demo
Approve Uniswap to spend unlimited USDC: interpreting raw calldata through the full pipeline, from spec lookup to Groth16 proof verification.