Verification guide
Proving information flow
Start with a question about a particular observer. Could this observer distinguish two executions that differ only in a secret? Weft checks both the values that reach that observer and the occasions on which anything arrives.
Define what a recipient can observe
For each declared observer, the default check compares runs with the same public state fields, event identities and order, and public payloads. Private fields and private payloads may differ. At each step the observer sees the public fields and its own message slot, including absence. Owner views and other recipients’ slots belong to their respective principals.
Noninterference means that changing private data cannot change the distribution of that observer’s complete modeled history under the same public schedule. At initialization the states must agree on the observable relation. At each step the checker pairs random choices, checks equal observations, and checks that the next states remain related. Repeating the argument covers any finite sequence of actions.
Sending a private field directly can reveal its value. A subtler leak sends a public constant only when the secret equals 1. A recipient can distinguish a message from silence. Both changes fail the vault example’s default browser check.
Keep a browser value local
In the downloadable ballot, the browser owns two private fields. Vote may eventually be reconstructed by two recipients. Private confidence may be edited and shown to the owner, while both recipients together must learn nothing about it from their modeled observations.
state confidence: u2 = 0 private
protect confidence from north, south with input annotate
view note "Private confidence (0–3)" = confidence
action annotate "Set confidence" input u2 private when not reviewing and not sealed
set confidence = value
endThe explicit protect rule compares two runs in which every field other than confidence agrees. The private payload of annotate may differ. All other payloads agree. The proof checks the joint messages of north and south and keeps every other field equal after each step. Without with input, the protected field may differ in the compared states, but all event payloads stay paired.
If the share action splits confidence instead of vote, either share in isolation still looks uniformly random. The two shares together reveal confidence, so the joint rule fails. Another consequence of the strong relation is that copying confidence into another private field can fail because that other field must stay equal.
To interpret “never leaves the client,” enumerate the external recipients and include the coalition you care about. A trusted host must route only their declared slots. Telemetry reading browser memory or DOM content falls outside the component’s model.
Keep a vault secret off the client
component "Vault status" on vault
observer browser
state key: u8 = external private
protect key from browser with input rotate
state online: u1 = 1 public
view health "Online" = online
action rotate "Rotate private key" input u8 private when true
set key = value
ensures key_updated = key == value
end
action status "Send health" when true
send online to browser
end
claim health_is_online = shown(health)Instantiate this module on the vault server. Obtain the external initializer and rotation input there. Deliver only the browser’s status slot to the browser. With that placement, knowledge of the modeled key cannot be acquired through the browser channel. The verifier cannot prevent an operator from shipping a key in a script, serializing the full owner state, or collecting the rotation input on a client.
Try changing send online to browser into send key to browser. Then try restoring the send and changing the status guard to key == 1. Each version fails noninterference / status / browser for a different reason.
Download the working vaultShare a value between two recipients
split vote to north, south
# Example with a u2 vote of 3 (binary 11)
# Fresh mask 2 (10) → north gets 2, south gets 3 XOR 2 = 1
# Reconstruction → 2 XOR 1 = 3For a fixed two-bit vote, a uniform mask can be 0, 1, 2, or 3. North sees those four values with equal probability. XOR with a fixed vote permutes those same four values, so south sees the same distribution. Both peers together can recover the vote.
The verifier checks reconstruction on every enabled split and every legal mask. For a right-only observer it relates masks by r′ = r XOR x XOR x′ so the two second shares agree. Applying the mapping twice returns the original mask and the new mask stays in range. For a left-only observer it pairs the same mask. These pairings preserve uniform probabilities.
Fresh independent masks are required across calls. Reusing a mask can expose relations between votes across messages. Hosts supply it using browser Web Crypto or the native OS random source. The built-in primitive supports exactly two shares with both needed for reconstruction. It supplies no authentication or threshold scheme for larger groups.
Inspect the ballot’s information-flow and reconstruction obligationsRead the guarantee in context
An observer may already know a secret from another source. Two user choices may be correlated. A user might signal their vote by choosing a particular public action or by delaying a click. The theorem fixes public event identities, order, and public input values and abstracts away timing, packet sizes, resource use, host logs, crashes, and transport behavior.
The ballot on the language homepage deliberately displays both shares to the owner in one browser. The generic local demo can deliver one share to each of two loopback processes. The operator of a machine running both processes can inspect both. Real recipient independence is a deployment property.