Skip to content
LogoLogo
LitheLithe

Secure contracts by construction.

Lithe is a smart-contract language for the EVM. Entrypoints are state transitions with explicit effects, typed failures, and deterministic storage. The compiler enforces the security rules that Solidity leaves to convention.

import "std/evm";
 
error InsufficientBalance of record {
  available : wei;
  required : wei;
}
 
event Withdrawn of record {
  indexed account : address;
  amount : wei;
}
 
storage is record {
  balances : map(address, wei);
}
 
external payable function deposit() is {
  storage.balances[Evm.sender()] := storage.balances[Evm.sender()] + Evm.value();
}
 
external function withdraw(const amount : wei)
  raises InsufficientBalance
is {
  const balance : wei := storage.balances[Evm.sender()];
  assert(
    balance >= amount,
    InsufficientBalance { available = balance; required = amount; }
  );
  storage.balances[Evm.sender()] := balance - amount;
  emit Withdrawn { account = Evm.sender(); amount = amount; };
  defer Evm.transfer(Evm.sender(), amount);
}

Why now

Smart contracts are now written with AI and attacked with AI. In Anthropic's SCONE-bench, AI agents produced working exploits for 51% of 405 real exploited contracts, and scanning a new contract for bugs cost about $1.22.

The bugs that lose the most money are not exotic. In 2024, access-control flaws caused about two thirds of smart-contract losses: a missing caller check, an open initializer, an unguarded upgrade. Reentrancy caused under 3%. Lithe turns these conventions into compiler rules, so neither the developer nor the model has to remember them.

What you get