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
  1. Spec lookup: the contract address is looked up in the specs library
  2. Function identification: the 4-byte selector identifies which function is being called
  3. Calldata decoding: raw bytes are decoded into typed parameters using the ABI
  4. Intent evaluation: the DSL program selects a template and fills its holes
  5. External specifications resolution: addresses in the template are matched against other specs in the registry
  6. Verified display: the final sentence is shown
  7. Proof generation: a Groth16 proof is generated and verified in your browser
Specs library

Contracts/USDC/Display.lean

import Verity.Intent.DSL
 
namespace Contracts.USDC
open Verity.Intent.DSL
 
private def maxUint256 : Int := (2 ^ 256 : Nat) - 1
 
intent_spec "USDC" where
const decimals := 6
 
intent transfer(to : address, amount : uint256) where
when amount == maxUint256 =>
emit "Send all USDC to {to}"
otherwise =>
emit "Send {amount:fixed decimals} USDC to {to}"
 
intent approve(spender : address, amount : uint256) where
when 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) where
when 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.