Secure Static Web on Freenet
February 14, 2026 ยท View on GitHub
This project deploys a secure, signature-gated static website on the Freenet network. Unlike a simple file upload, this architecture ensures that only the owner (holder of the private key) can update the website content.
Project Structure
web-container-contract/: The Rust smart contract that serves the website and verifies signatures on updates.delegates/web-delegate/: A local agent that securely manages your private key and signs updates.public/: Your static web assets (HTML, CSS, JS).signer/: A custom CLI tool for generating keys and signed metadata.Makefile.toml: The build automation script (usescargo-make).
Prerequisites
- Rust & Cargo: Install Rust
- WASM Target:
rustup target add wasm32-unknown-unknown - Freenet Dev Tool (
fdev):cargo install fdev - Cargo Make:
cargo install cargo-make - Local Node: A running Freenet node (
freenet local).
How to Deploy
How to Deploy
-
Start your Freenet Node:
freenet local -
Choose your Deployment Target:
Option A: Local Testing (Private) Best for development. The site is only visible on your machine.
cargo make deploy-localOption B: Public Network (Real) Propagates your contract to the Freenet network. Visible to anyone with the key.
cargo make deploy-realThe deployment script will automatically check prerequisites, build your site, and print the Contract URL at the end.
Updating the Site & Versioning
To update your website, modify files in public/.
Crucial: You should increment the version number for every update so the network (and search engines) detect the change.
VERSION=2 cargo make deploy-real
If you don't specify VERSION, it defaults to 1.
Security Model
This project implements a "Owner-Signed" update model:
-
Initialization:
- A unique Ed25519 Keypair is generated in
build/. - WARNING: Do not run
cargo make cleanunless you have backed up your keys! It will deletebuild/and you will lose control of your contract.
- A unique Ed25519 Keypair is generated in
-
The Contract (Gatekeeper):
- Stores the Public Key.
- On every update, it verifies the Digital Signature in the metadata against the Public Key.
-
The Delegate (Key Manager):
- Runs locally on your node.
- Safely holds the Private Key (never exposed to the network).
- Signs new content when you request an update.