Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dapp-builder

БесплатноБез исполняемых скриптовНе проверен

Build and maintain decentralized applications on Freenet using river as a template. Guides through designing contracts (shared state), delegates (private…

freenetот freenet★ 27 звёзд на GitHub16 установок в других каталогах

Об этом скилле

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

  1. update_state is 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 state validate_state accepts, 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. Read merge-law-compliance.md before adding a cap, removal or work bound.
  2. 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.
  3. 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.
  4. Use BTreeMap/BTreeSet, never HashMap/HashSet, in state and summaries. Peers decide they have converged by comparing bytes.
  5. get_state_delta to 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 through summarize / 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").
  6. 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.
  7. validate_state must 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.
  8. 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

  1. 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.
  2. 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-migrate release matching your stdlib (table in build-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.
  3. 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
Полный SKILL.md на GitHub

Установить dapp-builder в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdreferences/build-system.mdreferences/building-on-other-apps.mdreferences/contract-patterns.mdreferences/delegate-migration.mdreferences/delegate-patterns.mdreferences/facade-pattern.mdreferences/identity-and-addressing.mdreferences/merge-law-compliance.mdreferences/production-smoke-testing.mdreferences/state-authorization-patterns.mdreferences/sybil-resistance.mdreferences/ui-patterns.mdreferences/upgrade-and-migration.mdreferences/web-container-contract.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить dapp-builder с