Install

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

CommandWhat it doesChapter
tare buildCompiles the workspace with stock Anchor and with Tare.Build
tare weighMeasures gross, tare and net for every instruction.Weigh
tare proveRuns both builds over the same inputs and compares every result.Prove
tare attestWrites the proof to a record on chain.tare attest
tare checkRebuilds and reruns a record from the record alone.tare check
tare flagFiles 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

  1. Install the tare binary.
  2. In your program’s workspace, tare build. You get the stock program and the Tare program side by side.
  3. tare weigh prints the three weights for every instruction.
  4. tare prove shows the two builds behave identically on a corpus of inputs.
  5. tare attest publishes that proof. Anyone can run tare check on the record.
  6. Deploy the Tare build as an upgrade of the same program.

In this chapter