Overview
Tare builds the Anchor program you already wrote into one that burns a fraction of the compute, and proves that it is the same program.
What Tare is
Tare is a build tool for Solana programs written in Anchor, and a public registry of what it built. It reads an existing Anchor workspace unchanged: no source edit, no manifest edit, no migration. Where you run anchor build today, you run tare build.
An Anchor program’s cost is not in your handlers. It is in what the framework generates around them: the entrypoint that builds every account, the validation, serialization in and out, allocation, the error paths. Tare is a second implementation of the Anchor language that generates the lean version of all of that from the same macros and types, and a bytecode stage over the linked program.
The commands
| Command | What it does | Chapter |
|---|---|---|
tare build | Compiles the workspace with stock Anchor and with Tare. | Build |
tare weigh | Measures gross, tare and net for every instruction. | Weigh |
tare prove | Runs both builds over the same inputs and compares every result. | Prove |
tare attest | Writes the proof to a record on chain. | tare attest |
tare check | Rebuilds and reruns a record from the record alone. | tare check |
tare flag | Files an input on which the two builds differ. | tare flag |
Building, weighing and proving run on your machine and cost nothing. Attesting carries a fee in SOL.
From a workspace to a record
- Install the
tarebinary. - In your program’s workspace,
tare build. You get the stock program and the Tare program side by side. tare weighprints the three weights for every instruction.tare proveshows the two builds behave identically on a corpus of inputs.tare attestpublishes that proof. Anyone can runtare checkon the record.- Deploy the Tare build as an upgrade of the same program.