Weft

Weft / Frontend language

Interfaces with provable behavior.

Write what a user can do and what each recipient can learn. Weft checks both, then checks the WebAssembly it ships.

Private ballotLIVE WASM

Your choice

0
North share
South share

Flip the bit, review it, then seal. The two shares appear here in your browser. XOR them to recover your choice.

The language

The rule lives beside the action.

The ballot’s review state drives the button and guards the transition. A separate channel rule says exactly when each recipient may receive a share.

Remove the review guard and the channel rule still applies. The build fails with a counterexample.

Inspect this page’s Weft ↗
site.weftBALLOT EXCERPT
channel north on seal only when reviewed and not sealed
action seal "Seal ballot" when reviewed and not sealed
  split choice to north, south
  set reviewed = 0
  set sealed = 1
  ensures final_choice = choice == old(choice)
end

Verification

What a build checks

Interaction

State invariants hold initially and after every legal action. Guards determine which controls are enabled, and postconditions constrain what an action can change.

Information flow

Each recipient’s modeled observations include the value of a message and whether one arrived. A protection rule can also cover recipients who combine their observations.

Compiled output

An independent decoder reads the emitted WASM. The verifier checks that each exported function returns the same state, view, and messages as the source.

The proofs cover the component model. The browser, DOM adapter, entropy source, and transport are trusted. Timing and visual layout are outside the confidentiality proof.

Learn to prove UI behavior and information flow →

Toolchain

Run Weft locally.

The C11 toolchain uses Z3 and Wasmtime. The Apple Silicon archive includes the compiler and its native dependencies.

From the extracted directory

bin/weft build examples/ballot.weft
bin/weft check examples/ballot.weft
bin/weft serve examples/ballot.weft
Read the quick start ↗