Your multisig signs whatever the screen shows; Bybit lost $1.5B with valid signatures. Chainwall puts the rules on chain: who can act, what they can touch, how many must approve, and the chain rechecks the exact action at execution and refuses anything else.
Chainwall CLI 0.3.2 shipped this week. I use the CLI for every Chainwall setup I do, so here's how Chainwall works and what the new version changes.
How an action gets approved
Say your treasury Safe needs to send USDC. In Chainwall that transfer is an interaction: a small script that names the contract it calls and the arguments it passes. A policy attached to it says which groups have to approve and how many people from each.
When someone proposes the transfer, Chainwall hashes the call together with the script and the policy, including the contracts the script reaches. Approvals are recorded against that operation. At execution the contracts recompute the hash and check group membership again. If the script or the policy changed after people approved, the transaction reverts. Approvals from people who have since left the group stop counting.
The Safe's guard only lets it send transactions to Chainwall's contracts. There's no plain Safe transaction that skips any of this.
The policy file
Policies are Lambdascript files. This is the spending policy template from the CLI's agent skill:
{
$require($subjectPolicy == {{policyId}}),
$require($subjectVault == {{vault}}),
$require($subjectId == {{interactionId}}),
$require($subjectNativeValue == 0),
$require($subjectArgCount == 2),
$require($subjectArg(1) > 0 && $subjectArg(1) <= {{maxAmount}})
}
Each $require is one condition, and the operation reverts if any of them is false. This one only passes for one policy, one vault and one interaction. It also needs zero native value and an amount above zero and at most {{maxAmount}}.
The {{...}} parts are placeholders. Fill in your policy ID, vault address, interaction ID and limit, then compile:
chainwall policies program compile spending-policy.ls --out spending-policy.json
That gives you MiniScript bytecode, which is what the Chainwall contracts run.
What's new in Chainwall CLI 0.3.2
The CLI is three Zig programs: chainwall for registry, account, policy and transaction work, chainwall-lsp as the Lambdascript language server, and miniscript as the bytecode compiler.
Most of this release is about errors you can read. If your RPC is on a different chain than your profile, the CLI says so. Contract reverts and Safe error codes come back decoded, in the normal output and in JSON. Pass a bad option and the error names it. Leave out an account or Safe address and the error tells you which one is missing.
Native balances now show even when no USD price feed is configured, along with how to add one. Each transaction hash you submit gets one explorer link, replacements included. chainwall doctor checks that your cast supports cast send --data. If it doesn't, doctor points you to the tested Foundry version, 1.8.6. The docs also gained pages on downloading and verifying the Chainwall terms, and on switching IPFS gateways.
Source builds need Zig 0.17.1 now, and binaries and archive names take their version from the package manifest. The language server and shell completion got two resource fixes. miniscript applies its 64 MiB input limit to stdin as well as files.
The rest is in the changelog.
Try it
Chainwall CLI 0.3.2 is on main, so clone the repo and build it. You need Zig 0.17.1 and Foundry's cast:
git clone https://github.com/okcontract/chainwall-cli-arbitrum
cd chainwall-cli-arbitrum
zig build -Doptimize=safe --prefix "$HOME/.local"
chainwall --version
On my Mac that prints:
Chainwall 0.3.2 (Zig 0.17.1)
https://chainwall.org
by OKcontract Labs
The install also puts the chainwall-operations agent skill on disk. If you'd rather have a coding agent run the setup, point it at the skill.
CLI: github.com/okcontract/chainwall-cli-arbitrum
Contracts: github.com/okcontract/chainwall
To set up your own Chainwall on Arbitrum One, follow the step by step guides at tutorials.chainwall.org.
Top comments (0)