Clarity Working Group — passing the baton from Setzeus

Clarity Working Group — Notes, Sept 29, 2026

Written from the call with Brice, Hugo, Ryan and others. Please correct or add in the thread below.


Clarity

Language redesign and spec (Brice)

  • A clean redesign of Clarity is under way. The goal is a precise written spec that becomes the source of truth, instead of whatever the interpreter happens to do.
  • Why it matters: today Clarity’s meaning is effectively defined by one implementation. A second implementation (such as the WASM compiler) has to copy that implementation exactly, because any difference between nodes is a consensus split. A spec gives both a target to be checked against.
  • Brice will share the draft publicly for feedback.

WASM compilation

  • Compiling Clarity to WebAssembly promises large execution speedups, especially for compute-heavy contracts and chains of contract calls, with a possible path to machine code.
  • It runs on standard, widely tested WASM engines, which means fewer bugs that exist only in Stacks.
  • It opens the door to other languages compiling to WASM and running on-chain later.
  • Cost tracking could use WASM’s native fuel metering. That simplifies gas accounting and may allow higher block limits while keeping costs under control.
  • The redesign and the spec feed directly into this: once it’s clear what the language should do, there’s nothing ambiguous left for the compiler to match.

Cost estimation (Hugo)

  • Clarinet already shows worst-case costs per function before deployment.
  • Exact costs depend on inputs and contract state. Pure functions are predictable; functions with variable inputs are not.
  • Simulating the transaction on mainnet or testnet, through Clarinet or the Stacks Core API, gives a near-real-time estimate before execution. Better static analysis could tighten the model, but full precision requires the state to stay the same between estimate and execution.

Formal verification

  • Everyone agreed it’s important, but there are few active projects. Hugo would welcome community tooling that could later plug into Clarinet for automated checks.
  • Jude is contributing to a public symbolic execution project.
  • The framing: formal verification complements testing and static analysis rather than replacing them. It matters more as AI-driven attacks get sharper.

Node-level events and indexing (Ryan)

  • A forked node now emits detailed writes (var sets, map inserts and deletes) and inner contract-to-contract calls, so indexers see what actually changed instead of only what a contract chose to print.
  • It’s built as a separate add-on, to avoid adding complexity to the core node, which was the main concern in code review.
  • Ryan offered to support open-source work on VM-style SDKs and tooling.
  • Hugo will share the upcoming TypeScript Stacks.js SDK built on the VM, and will keep syncing with Ryan.

Tooling

  • Clarinet 3.24.1 improves support for key ecosystem contracts, including pox-5 and sBTC. Please test it on testnet and report issues.
  • Mining visibility: Diwaker Gupta’s observatory at hub.stx.pub gives a clear view of Stacks mining. Ours is at juiceofbtc.com/mining.

Jing v6-3 (Rapha)

  • The submit + settle market, the maker rungs and the auto-swap vaults went through seven adversarial audit bounties with AIBTC agents. Every issue is fixed, and every decision is logged publicly.
  • Fork coverage on the current source: 17 stxer suites and 5,981 exact checks, all green. They reach 72% of expressions, and no branch goes unreached. Every remaining path not hit is documented as provably unreachable or as oracle data no real feed produces; none is reachable but untested.
  • The fork suites sit alongside 273 Clarinet unit tests against the real core, and Rendezvous fuzz campaigns.
  • Thanks to the AI agents and community members behind the bounties and adversarial testing.

Action items

  • Brice: share the redesigned Clarity spec draft.
  • Clarinet users: test the pox-5 and sBTC support in 3.24.1 on testnet and report issues.
  • Ryan: keep developing the indexing node fork and explore a modular integration with stacks-core.
  • Hugo: release the new VM-based Stacks.js TypeScript SDK; keep syncing with Ryan.
  • Clarinet team: look into integrating formal verification or static analysis.
  • Everyone: keep using Clarinet’s cost analysis and simulation to tune contracts.

Clarity Working Group — Notes, Oct 13, 2026

*Written from the call with Hugo, Friedger, Werner, Rapha and others. Please correct or add in the thread below.
*

Clarity

WASM runtime takes priority (Hugo)

New Clarity language features are on hold while the WASM runtime comes first. The plan is to compile Clarity to WebAssembly and have the chain execute it.

  • Why it matters: stabilizing the spec is part of the same work. Hugo pointed to old edge cases and to newly found differences between the interpreter and the WASM build. All of them have to be resolved before a second execution path can run safely without a consensus split.
  • Timeline: still open. Hugo isn’t on the active implementation team, so he couldn’t give best- or worst-case dates. Work slowed while the focus was on Bitcoin staking, but WASM remains a top priority and progress updates should come soon.

Stacks.js revamp and type safety (Hugo)

The devtools team is unifying Stacks.js, the Clarinet SDK and related tools behind one interface that behaves the same across Simnet, Devnet, Testnet and Mainnet. This requires changes to Clarinet, because Simnet doesn’t yet fully match Mainnet behavior.

  • Type safety: the new interface should catch wrong argument counts and types before runtime. Static analysis is becoming more important now that AI coding agents write a growing share of contract code.
  • Capacity: Hugo sees the implementation as manageable with current Stacks Labs resources.
  • The hard part is migration from legacy Stacks.js: compatibility, breaking changes, package trust and safety, and the overall upgrade experience. Delivery depends on confirming it as a priority and committing to a short execution window.

Clarinet v4

  • Expected in November.
  • Includes breaking changes, but they shouldn’t materially affect builders.
  • No date yet for the new Stacks.js interface.

Bitcoin staking UX (Friedger, Rapha)

One-click Bitcoin staking is still unresolved. Rapha asked about depositing BTC into a contract and pooling or staking it into PoX-5.

  • The gap: nothing on-chain links a Bitcoin deposit to the user it belongs to and what it’s for. Verification gets complex across transaction parents and the range of Bitcoin address types.
  • A narrower first step could work: P2WPKH transactions can be verified and attributed to users, and the earlier BTC-to-sBTC flow showed that users accept this kind of UX.
  • Friedger will look up existing sender-verification work.

Automated STX payouts (Rapha)

An STX payout signer manager is targeted for launch next week. It receives sBTC rewards, swaps them, and distributes STX to pool participants.

  • Payout data is read directly from PoX-5 entries.
  • User staking safes can compound STX automatically through an optional keeper.

Two-phase swap

  1. sBTC rests on JingSwap’s pegged limit order book for two days, earning a 10 bps maker bonus paid by takers.
  2. Whatever remains is swapped actively across JingSwap, Bitflow and Velar, with more venues later.

Unconsumed rewards can be returned in sBTC and STX, not only STX.

Safeguards

  • Max slippage: 1% on Bitflow, 60 bps on Velar.
  • Fat-finger protection: swaps are blocked when the Pyth price falls outside 0.5x–2x of the STX miner reference price.

Configuration

  • Rapha proposed making max slippage a pool-admin setting rather than a per-user one. Participants who disagree can unstake and move to another pool.
  • A signal and cooldown period before parameter changes was raised but not settled.

Next session

In two weeks. Everyone is welcome to join and share updates.

Action items

  • [ ] Hugo: advance the Clarity WASM reimplementation.
  • [ ] Hugo: revamp Stacks.js and prepare the Clarinet v4 release.
  • [ ] Friedger: look up existing sender-verification work for BTC deposits.
  • [ ] Rapha: launch the STX payout signer manager.
  • [ ] Rapha: post these minutes on the Stacks forum and organize the next session.

Clarity Working Group — Notes, Oct 27, 2026
Written from the call with Hugo, Rapha and others. Everything below is under active development, and plans may change. Please correct or add in the thread below.

Clarity

Clarity WASM (Hugo, Rapha)
The team is rewriting the Clarity specification as preliminary work for a Clarity-to-WASM compiler. Hugo noted that WASM may speed up some operations, such as raw math, but it may not change much for I/O-heavy contracts. Under the current plan, the compiled binary would become the source of truth, and the team is looking at ways to verify that a given Clarity source produced a given binary, similar to contract verification on Ethereum.

Transparency (Rapha, Hugo)
Rapha asked whether compiled WASM code would stay human-readable and transparent enough for legal and audit purposes. Hugo said the team would like to offer tools, such as a CLI or a website, to check source code against binaries. There was also a brief discussion about attaching metadata to contracts, such as a repository link, a license, the author’s name, or the KYC-style fields some Ethereum contracts use.

Two questions remain open. Should providing source code at deployment be mandatory or optional? And how do we balance legal transparency and metadata with a move to compiled binaries?

Clarinet v4 (Hugo)
Hugo hopes to release Clarinet v4 around late this week or early next week. The aim is to make Simnet behave more like Mainnet by adding gas fees, post-conditions (including deny mode), and nonces. Because of this, some unit tests that rely on Simnet’s current behavior may fail. Clarinet would also reuse more of the Stacks node code, so unit tests and app code stay closer together. The upgrade won’t be mandatory, but Hugo suggested it for new projects.

Stacks.js (Hugo)
Later, Stacks.js may change so builders can use the same syntax to broadcast transactions on Simnet and Mainnet, instead of Clarinet’s own simnet.call syntax. The idea is to simulate full workflows, including fees and post-conditions.

Devnet vs Testnet (Hugo)
Devnet runs locally in Docker and resets when the container is destroyed, which suits quick, private iteration. Testnet is an external network where contracts stay deployed longer before Mainnet.

Off topic

Rapha is testing a pegged limit order book and automated loop market-making strategies written in Clarity. Rapha also wrote a simple Clarity contract that collects donations to help Africa build.

Next session
In two weeks. Everyone is welcome to join and share updates.

Action items
Everyone is invited to try the full app user flow on Clarinet Simnet once v4 iminutes on the Stacks forum and organize the next session.
Rapha is testing a pegged limit order book and automated loop market-making stRapha also wrote a simple Clarity contract that collects donations to help
Africa build.

Next session
In two weeks. Everyone is welcome to join and share updates.

Action items
Everyone is invited to run their test suites on Clarinet Simnet once v4 is out, including full user flows with fees and post-conditions. Rapha will post these minutes on the Stacks forum and organize the next session.

hi Rapha, could we take a short slot on Nov 24 (or Nov 10 if it’s open)?

we’d show the Fair Play Kit: small open tools for Stacks games. a Bitcoin block picks each day’s map, so nobody could pick it, and a tiny Clarity contract stores each week’s scoreboard fingerprint once and never lets it change. it’s on testnet; mainnet waits for an outside review, so hard feedback on the contract is exactly what we want.

we’re a small anon team, so we’d send a short recorded walkthrough to play in the slot, then answer questions here in the thread.

code (MIT): blip-labs/blip on GitHub, folder fairplay-kit

hi Rapha, following up on the slot ask above. Nov 24 still works for us if there’s room.

a few things changed since then, which should make it a better demo:

  • an outside reviewer (Carlos from Zealynx) went through the daily-draw and weekly-seal rules in our Genesis Run thread and found three real issues. all three are fixed: the daily anchor waits for 3 confirmations, it uses median time past so a miner’s clock can’t pull its block into the day, and weekly seals have to go strictly in order starting from a FIRST-WEEK set at deploy.
  • the fixed contract is on testnet as fairplay-board-v2 (Clarity 4), and the source is readable on the testnet explorer. our GitHub is down for now, so that’s the easiest place to read it.
  • we hope to have its first real weekly seal in before the 24th.

same plan as before: a short recorded walkthrough for the slot, then we answer questions here in the thread. if Nov 24 is full, any later slot is fine.

hi blip, thanks for following up, and nice work getting the three Zealynx findings fixed. Nov 24 works, the slot is yours. send the recorded walkthrough a day or two before so we can queue it, and we’ll point questions to this thread. a link to fairplay-board-v2 on the testnet explorer in the thread would help people read the contract ahead of time.

Clarity Working Group — Notes, Nov 10, 2026

Written from the call with Brice, Rapha and others. Everything below is under active development, and plans may change. Please correct or add in the thread below.

Clarity on WASM (Brice)

Brice presented a proposal to replace the Clarity interpreter in Stacks Core with a WASM runtime. Clarity would be compiled off chain, and the result would stay verifiable through on-chain metadata and tooling. The first version is limited to Clarity, but the design stays open to other languages that compile to WASM. The team picked WASMI as the runtime to evaluate: it already runs on Stellar and Polkadot and is planned for XRP Ripple, its small codebase means fewer places for bugs, and it interprets rather than compiling just in time, which avoids JIT risks while still running faster than today’s interpreter in tests.

Specification (Brice)

The Clarity specification repository will move into the Clarity language organization on GitHub. The new spec covers the language, the runtime, the ABI, provenance, and how WASM plugs into Stacks Core. The full spec is available as generated documentation, and the EBNF grammar should merge soon. The on-chain WASM design would go through a SIP, and the first new Clarity version through a CLIP-style proposal.

Chain ABI (Brice)

Every WASM module has a runtime layer and an interpretation layer. The runtime layer only knows principals, unsigned integers and raw bytes, not the full Clarity type system. The interpretation layer carries the declared types and canonical encodings, so wallets and explorers can decode arguments and results. A wallet encodes arguments from this metadata before signing, and the compiled Clarity code checks the input types when it runs. A successful call commits its state; an error discards it, and post-conditions are checked before the result reaches the user.

Provenance and reproducible builds (Brice)

Each module’s on-chain metadata includes the compiler version, the hash of the Clarity source, and the hashes of the contracts it calls. Anyone can rebuild the module from source and check that the WASM matches. Wallets could cache that result and flag contracts that are provably compiled from Clarity.

Typed events (Brice)

A new emit function would replace print for events. Event names and data types become part of the metadata, so indexers can decode event bytes straight from the declared types.

Safety guarantees (Brice)

Engine-level isolation stays the same: a contract can’t read another contract’s data, and fuel budgets, read-only rules, reentrancy protection, rollback on failure, post-conditions and allowances are all still enforced. Uncatchable failures like divide-by-zero still reject the whole transaction. Clarity keeps its stronger guarantees on top: no recursion or unbounded loops, values bounded by their declared types, and worst-case and exact costs computable from the inputs. That opens the door to static analysis and proofs of contract invariants, including for DeFi.

Language additions (Brice)

Proposed additions include private generic functions, function overloading, macros, rest parameters, typed events, type aliases and reference kinds, plus a more readable match syntax. Built-in capabilities would also be available to developers in contract code.

Fuel and fees (Brice, Rapha)

WASM engines meter fuel natively. The proposed fee model is a fee rate plus a maximum fuel amount, instead of one fixed fee per transaction. Unused fuel is refunded, and a transaction that hits its limit stops and its results are discarded. Miners can rank transactions by fee rate while checking block capacity, and one fuel number is simpler for the runtime, miners and the mempool than today’s multi-dimensional costs. Because Clarity’s maximum cost can be computed statically, wallets can still show the maximum a user could pay. Brice clarified that other WASM languages can use the deterministic WASM subset but won’t get Clarity’s termination and cost guarantees.

Storage (Brice, Rapha)

Storage is limited today by block size plus the read and write costs in the current model; the fuel model would fold those into one fuel value. One open point, prompted by the large NFT data now stored on Stacks: a one-time storage charge may not cover nodes keeping that data forever, so long-term storage pricing needs more ideas.

Open questions

Compiling off chain puts the compiler in the trust path, so its correctness has to be established; formal type-system work and several verification approaches are planned to check that compiler and spec agree. New WASM contracts must keep calling existing interpreted contracts, so legacy contracts can’t be cut off, and the cost treatment between legacy and WASM execution still needs a proposal. Higher legacy costs came up as a possible incentive to migrate, not a decision. Clarity versions could evolve without a Stacks hard fork as long as the chain ABI stays compatible.

Next session

In two weeks, Nov 24. Everyone is welcome to join and share updates.

Action items

Brice will move the specification repository and share the slide deck and the documentation link. Rapha will send these notes to Brice for review, then post them on the Stacks forum.

Resources

Slides and documentation shared by Brice: Clarity Vision

Clarity on Wasm.pdf (618.7 KB)

@Rapha23 separate from the demo slot thing: we did a free private read of the live jing v6-4 set (commit 894a3f1) against your past bounty writeups. came up clean, just one small tidy-up note. where should we send it?