dapp-builder
БесплатноБез исполняемых скриптовНе проверенBuild and maintain decentralized applications on Freenet using river as a template. Guides through designing contracts (shared state), delegates (private…
Об этом скилле
Freenet dApp Builder
Build decentralized apps on Freenet. River is the
reference app: contracts/room-contract/, delegates/chat-delegate/, ui/, common/.
This file holds the model, the rules for every dApp, and the route to the right reference. Read the reference for your task before writing code.
The model
An app has three kinds of component, and most real apps have several contracts and delegates.
- Contract: WASM defining the shape and merge rules of shared state. It runs on untrusted peers and cannot hold secrets; all state is public unless the client encrypted it. The WASM is a table schema, and each parametrized instance is a row with its own key and state.
- Delegate: WASM on the user's node that holds secrets and does signing and encryption. It runs only when poked: an app message, a contract notification, or an event its manifest declares.
- UI: a web app talking to the local node over WebSocket, published as the state of a web container contract.
A key is BLAKE3(BLAKE3(wasm) ‖ params). Any WASM change, including a dependency or compiler
bump, moves the key. Most of the rules below follow from that.
Freenet has no supported full node on mobile, so an app that bundles a node means desktop. Do not generate a production mobile wrapper without warning about bandwidth, battery, thermal, CPU and background-execution problems. Treat it as experimental, require resource measurements, and do not present it as an official Freenet client without the Freenet Project's approval.
Rules for every dApp
Contract state
update_stateis the merge. It must be associative, commutative and idempotent on exact bytes (heal-guarded associativity is accepted where a cap or removal frees a slot), over every statevalidate_stateaccepts, not only those your clients produce. Delivery is at-least-once, so a re-delivered delta must be absorbed too: applying it again must not change the state. Readmerge-law-compliance.mdbefore adding a cap, removal or work bound.- Check it:
fdev verify-merge --wasm c.wasm --params params.bin --state s1.bin --state s2.bin. Without--params, a contract whose parameters do not decode from empty bytes comes back all inconclusive and still exits 0. Inconclusive is not a pass. - A contract must not read the host clock (
freenet_stdlib::time::now()): the merge has to be a function of its inputs, and the call is staged to trap (freenet-core#5465). Carry a client-signed timestamp and enforce only monotonicity. It is an untrusted hint. Delegates may read the clock. - Use
BTreeMap/BTreeSet, neverHashMap/HashSet, in state and summaries. Peers decide they have converged by comparing bytes. get_state_deltato an up-to-date peer returns an empty delta, never anything near state size, and a summary must be far smaller than the state. Test convergence throughsummarize/delta/apply. Core already enforces cost-pressure eviction on zero-demand heavy contracts (no subscribers and no recent genuine reads/writes, freenet-core#4861) and is rolling out per-contract outbound bandwidth budgets regardless of subscriber count (freenet-core#5057), which pace and coalesce updates when exceeded (slow propagation, not a core bug). Never store frequently updated live data inside a web container contract (contract-patterns.md→ "Outbound Bandwidth Budgets and Throttling").- Every field in state must be covered by a cryptographic signature, because peers can edit anything unsigned. Test that tampering with each signed field fails verification.
validate_statemust reach the same verdict on the same bytes forever. Reading another contract is safe only for immutable or once-true-always-true facts; gating validity on mutable state makes peers disagree permanently.- Keep each data contract instance well under 4 MB (the hard cap is 50 MiB): a GET transfers all of it before the UI can render. Shard unbounded data by the unit of write concurrency.
Keys and upgrades
- Anchor every durable reference (invites, links, membership) on an identity independent of the WASM, such as an owner key, and re-derive the contract key from it. With that, a routine stdlib bump migrates on refresh and invites keep working. Never recreate instances or warn of dead invites for a routine re-key.
- A new contract version must accept old state, so that any client can carry a user forward.
Keep a committed registry of past code hashes and use the
freenet-migraterelease matching your stdlib (table inbuild-system.md); do not hand-roll the sweep. Once you have users, changing how a record's id is derived is a breaking change to their data. - A delegate migration is forward-only. There is no node-level mechanism today. Do not wait for one: migrate at the app level. Status is tracked in freenet-core#2776. A predecessor's
Установить dapp-builder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dapp-builder?
Build and maintain decentralized applications on Freenet using river as a template. Guides through designing contracts (shared state), delegates (private state), and UI, and through upgrading a live dApp safely. Use when user wants to create a new Freenet dApp, design contract state, implement delegates, build a Freenet-connected UI, OR upgrade an existing dApp — bump freenet-stdlib, ship a new contract/delegate version (v2), fix a bug that re-keys the WASM, or migrate state across a contract/delegate key change without breaking invites or losing data. Also use when INTEGRATING with a contract or delegate published by another app — reading another project's contract state, depending on a platform delegate, or deciding how to address someone else's artifact so it survives their re-keys.
Как установить скилл dapp-builder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dapp-builder запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic