Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Members-only content in public repositories, Environments and the secret scan. P
- **Secrets in a public push.** `git push` to a public repository checks every file it publishes for the first time. It refuses a new `.env` file, a PEM private key, an AWS key pair or a GitHub or GitLab token with a valid checksum (E807), and warns about `.envrc` files, random-looking values and keys in test folders. `-o allow-secret=<fingerprint>` or `.forge/secret-scan-allow` lets a checked finding through. See [Secrets in a push](docs/guides/quick-start.md#secrets-in-a-push).
- **Wallet sign-in keeps your encryption key.** The web app stores the encryption key the Dash Wallet registers in the browser's vault, every one of them across approvals, so private repositories and members-only content open after one unlock per tab. When the identity's key came from somewhere else, it says "Your encryption key is held elsewhere. Import it under Settings → Private repos."
- **Wallet sign-in with App Connect v2: one approval for all of Forge.** Where the network runs protocol 14 and Forge is deployed (devnet sakura today), the wallet tile comes first and shows an App Connect v2 request: the wallet adds one key for this browser that works on every Forge contract, capped at 0.05 DASH of spending and expiring after 90 days (a wallet may offer other limits), so the extra approvals of the older exchange are not asked for. The phone link returns to a new `/connect/` page, and the sign-in checks the wallet again when the tab regains focus. A key a wallet granted is renewed in that wallet (**Renew in your wallet**, in the low-funds banner, the top-up sheet and Settings → This browser's key); the identity file or recovery phrase still works. If your wallet's build has no App Connect v2, **Show the older code** gives today's request. A v2 sign-in does not bring an encryption key: set up private and members-only content in Settings. We know of no released Dash Wallet that speaks App Connect v2 yet; the [wallet sign-in notes](docs/design/wallet-login.md#app-connect-v2-one-approval-for-all-of-forge) say what works today.
- **Passkeys for other devices (web app).** **Settings → Devices & keys → Passkeys for other devices** adds a passkey that holds this browser's key, encrypted to it, on Platform. On another device, **Sign in with a passkey** brings that sign-in over: the same key and budget, checked against your identity before it is used. A passkey moves a session, it doesn't recover an account: when the key expires or is disabled it stops working, and you renew with your identity file, recovery phrase or wallet (a session restored from a passkey offers both **Renew in your wallet** and **Renew with identity file**). Keys without a spending limit or an expiry stay on the device that holds them, because the encrypted copy is public on Platform for good. Your encryption key is included only if you tick it, with a warning that it can't be taken back. After signing in, the web app offers a passkey once (twice at most, never after **Not now**). Revoking or disabling a key offers to remove the passkeys that hold it. Adding one costs about 0.0005 DASH from the key's budget; signing in is free. It works at forge.dashhq.org only. **It does nothing yet:** the controls stay hidden until forge-meta on the network has the new `vaultEntry` type, which is a pending forge-meta update on devnet sakura. See [Passkeys: the threat model](docs/security/passkey-vault.md) and [identity and keys](docs/guides/identity-and-keys.md#passkeys-for-other-devices).
- **Passkeys for other devices (web app).** **Settings → Devices & keys → Passkeys for other devices** adds a passkey that holds this browser's key, encrypted to it, on Platform. On another device, **Sign in with a passkey** brings that sign-in over: the same key and budget, checked against your identity before it is used. A passkey moves a session, it doesn't recover an account: when the key expires or is disabled it stops working, and you renew with your identity file, recovery phrase or wallet (a session restored from a passkey offers both **Renew in your wallet** and **Renew with identity file**). Keys without a spending limit or an expiry stay on the device that holds them, because the encrypted copy is public on Platform for good. Your encryption key is included only if you tick it, with a warning that it can't be taken back. After signing in, the web app offers a passkey once (twice at most, never after **Not now**). Revoking or disabling a key offers to remove the passkeys that hold it. Adding one costs about 0.0005 DASH from the key's budget; signing in is free. It works at forge.dashhq.org only. The controls show only where forge-meta has the new `vaultEntry` type: on testnet since its forge-meta update to version 2 (2026-10-26). See [Passkeys: the threat model](docs/security/passkey-vault.md) and [identity and keys](docs/guides/identity-and-keys.md#passkeys-for-other-devices).

### Changed

Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/forge-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ An update may add only optional properties, `enum` values appended at the end, a

**Size.** With UPDATE-1 the three contracts serialize to 17,462 / 17,633 / 17,513 B: 54, 225 and 105 B over the 17,408 B target (§7), all under the 17,832 B ceiling. The signed update transitions are about 17.5–17.7 KB of the 20,480 B limit, which leaves about 2.7 KB for any later update.

**UPDATE-2** (the passkey vault) is one more `DataContractUpdate`, of forge-meta alone: `vaultEntry` (§2, forge-meta), a new type with its own unique index and a `refersTo` to the owner's own authentication key, nothing on an existing type. It is the flag `passkey_vault` (`UPDATE2_FLAGS`, off in the registered v1 set; `stale_registered` turns it off with UPDATE-1's). On a network that is not registered yet (testnet, mainnet) it is part of the registration set and changes forge-meta's sha256, which the owner signs again; on devnet sakura, which registered forge-meta without it (`4CyD…`, source `04627b52…`), it ships as `deploy-v2.mjs --update meta` and `contract-validate --expect-update` accepts the new forge-meta as an update of the registered one (`ALLOWED (DataContractUpdate v1 -> v2)`; run by hand against `git show ec3c86f12:forge-contracts/contracts/mainnet/forge-meta.json`, the file sakura registered, since no `registered/devnet-sakura/` copy is frozen for CI). Its vectors (`vaultEntry` cases of the `U2` item: shapes, bounds, the immutable `credentialId` and `recipientKey`, the re-seal, the index) are generated for the four-contract set (`vectors.py --mainnet`), and the committed three-contract vectors only assert that the type is absent there.
**UPDATE-2** (the passkey vault) is one more `DataContractUpdate`, of forge-meta alone: `vaultEntry` (§2, forge-meta), a new type with its own unique index and a `refersTo` to the owner's own authentication key, nothing on an existing type. It is the flag `passkey_vault` (`UPDATE2_FLAGS`, off in the registered v1 set; `stale_registered` turns it off with UPDATE-1's). On a network that is not registered yet (mainnet) it is part of the registration set and changes forge-meta's sha256, which the owner signs again. Testnet (`6arQ…`) and devnet sakura (`4CyD…`) registered forge-meta without it (source `04627b52…`), so there it ships as `deploy-v2.mjs --update meta` (applied on testnet on 2026-10-26, forge-meta version 2; sakura is retired and was not updated) and `contract-validate --expect-update` accepts the new forge-meta as an update of the registered one (`ALLOWED (DataContractUpdate v1 -> v2)`; run by hand against `git show ec3c86f12:forge-contracts/contracts/mainnet/forge-meta.json`, the file sakura registered, since no `registered/devnet-sakura/` copy is frozen for CI). Its vectors (`vaultEntry` cases of the `U2` item: shapes, bounds, the immutable `credentialId` and `recipientKey`, the re-seal, the index) are generated for the four-contract set (`vectors.py --mainnet`), and the committed three-contract vectors only assert that the type is absent there.

**The mixed-visibility items (mainnet only).** dash-forge-qa `design/mixed-visibility/DESIGN.md` rev 4.1 §8.3 adds the layout and eleven items to `MAINNET_FLAGS`, in its order. Each is off in every devnet build and on with `build.py --mainnet`; `build.NEEDS` refuses a combination that cannot register (a `where` naming a property another item adds, or B1 without the room forge-meta leaves). Row numbers are DESIGN §8.2's. A refusal is 10422 (the first broken rule in name order), 40127 (a `where` mismatch) or 40120 (no document found), as M-C checks live.

Expand Down
2 changes: 1 addition & 1 deletion docs/economics.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ All in DASH, **measured on devnets** (to be re-measured on testnet); fiat figure
| Fork a repo | ~0.01 DASH for a small repository and 0.03 for a 36-pack one: one small manifest per pack and one ref update per branch; the parent's packs are referenced, never re-uploaded | same |
| Push 100 KiB source delta (~30 KiB packed) | about 0.015–0.02 DASH (~$0.45–0.60): 0.33–0.36 DASH/MiB for the packed bytes plus ~0.004–0.011 for the manifests, ref update and history index. Permanent | ~0.004–0.0055 DASH (~$0.12–0.17): manifests and the ref update only |
| 1,000 issues + 5,000 comments over a year | **~3.1–4.5 DASH** (~$95–135) for short bodies (issues 0.0006–0.001 each, comments 0.0005–0.0007 each; more with long bodies). Issues are permanent, comments refundable on delete | same (always on Platform) |
| Add a passkey for other devices, then sign in with it elsewhere | **~0.0005 DASH** for an identity's first (estimate: Yappr's 46–50M credits plus ~2–4M for Forge's larger 256-byte entry), ~0.0003 for each later one; re-sealing after a key change ~0.00003; removing one refunds ~0.0002–0.0003; signing in is free. Paid from the browser key's budget ([passkey vault](security/passkey-vault.md)) | same |
| Add a passkey for other devices, then sign in with it elsewhere | **~0.0005 DASH** for an identity's first (43–52M credits measured on testnet), ~0.0003 for each later one (33M); re-sealing after a key change ~0.00003; removing one refunds ~0.0003–0.0004; signing in is free. Paid from the browser key's budget ([passkey vault](security/passkey-vault.md)) | same |
| Remove one member from a 50-member repository with members-only content | ~0.035 DASH: the key is changed for the 49 who remain ([guides/costs.md](guides/costs.md#members-only-and-private-content)) | same |
| Force-push away 10 MiB of history, then repack | nothing recovered; the repack adds a deposit for the consolidated pack | delete the old objects in your bucket |
| Deployer: register the production set (once per network) | **~1.86 DASH for the four contracts** (0.5968 + 0.3963 + 0.5063 + 0.3636), measured on a Platform v5 devnet, and 1.873 DASH on testnet (2026-10-26); ~1.73 DASH for the three-contract devnet set ([Deploying Forge to a network](deploying-to-a-network.md#4-what-it-costs), [forge-v2.md §7](contracts/forge-v2.md#7-measured-size-and-cost)) | same |
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/costs.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ Packs are git packfiles: delta-compressed and deflated, typically 20–35% of th

### Passkeys for other devices

A passkey's entry is one small stored item, written with this browser's key (so it comes out of that key's budget, like any write). These are estimates from Yappr's measurements on a development network plus the extra bytes of Forge's fixed-size entry, not yet measured on testnet; the live test (`lib/auth/passkey-vault.live.test.ts`) prints what each step really cost.
A passkey's entry is one small stored item, written with this browser's key (so it comes out of that key's budget, like any write). Measured on testnet with the live test (`lib/auth/passkey-vault.live.test.ts`), which prints what each step costs.

| Action | About | Notes |
|---|---|---|
| First passkey on an identity | 0.0005 DASH | builds the identity's passkey list, so it costs more than the next ones |
| Each later passkey | 0.0003 DASH | |
| Update a passkey after a key change | 0.00003 DASH | a replace of its entry |
| Remove a passkey | refunds about 0.0002–0.0003 DASH | deleting returns the deposit |
| Remove a passkey | refunds about 0.0003–0.0004 DASH | deleting returns the deposit |
| Sign in with a passkey | free | reads only |

At most 10 passkeys per identity. An entry is always the same size, whatever keys it holds.
Expand Down
2 changes: 1 addition & 1 deletion docs/limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ What Forge cannot hold or do, in numbers, with where each number comes from. Som
| One `chunk` document (git pack bytes on Platform) | 3 fields, **14,700 bytes** of pack per chunk (about 14.4 KiB); a full chunk leaves at least 5 KiB for headers | `DOC_PAYLOAD_MAX` in `pack.rs` |
| A pack | **1 TiB**: the cap on the size a manifest records (**frozen**). Forge's tools add no smaller cap; on Platform a pack is split over as many chunks as it needs, each costing about 0.005 DASH | [forge-v2.md §9](contracts/forge-v2.md#9-frozen-at-mainnet); [Costs](guides/costs.md) |
| A contract (registration) | 20,480 bytes, and at least 2,000 bytes of headroom under that for the create transition | `deploy-v2.mjs` |
| A passkey vault entry (`vaultEntry`) | credential id 16 to 255 bytes, recipient key 32, encapsulated key 32, sealed bundle 32 to 256 (Forge writes 256). An update can loosen the sealed bundle's bounds but never make it fixed-length, and cannot take the credential id past 255 bytes or `version` past 255 (**frozen**). One entry per identity and credential. Fees are estimates until measured: about 46 to 50 million credits (about 0.0005 DASH) for an identity's first entry, 28 to 31 million for a later one, 2 to 3 million to re-seal; a delete refunds about 23 to 35 million, and a sign-in reads only | [forge-v2.md §2](contracts/forge-v2.md#forge-meta-mainnet-set-only) |
| A passkey vault entry (`vaultEntry`) | credential id 16 to 255 bytes, recipient key 32, encapsulated key 32, sealed bundle 32 to 256 (Forge writes 256). An update can loosen the sealed bundle's bounds but never make it fixed-length, and cannot take the credential id past 255 bytes or `version` past 255 (**frozen**). One entry per identity and credential. Fees measured on testnet: about 43 to 52 million credits (about 0.0005 DASH) for an identity's first entry, 33 million for a later one, 3 million to re-seal; a delete refunds about 27 to 37 million, and a sign-in reads only | [forge-v2.md §2](contracts/forge-v2.md#forge-meta-mainnet-set-only) |
| Keys in a passkey vault entry | at most **6**: the main key (a group-bound limited key with a budget and an expiry), up to 4 per-contract wallet grants (each also with a budget and an expiry: an unlimited one stays on its device) and one encryption key (only if asked). At most **10 passkeys** per identity | [Passkey vault](security/passkey-vault.md#what-an-entry-holds) |
| Pack download time | each copy gets `max(120 s, size ÷ 1 MiB/s)`; a manifest with no size allows 256 MiB | [Bring your own storage](guides/bring-your-own-storage.md) |
| Read-back check after an upload | a full download and SHA-256 up to 16 MiB; larger packs get a size check and byte-exact head and tail ranges | same |
Expand Down
12 changes: 8 additions & 4 deletions docs/security/passkey-vault.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Passkeys for other devices: the passkey vault and its threat model

Status: implemented in the web app and inert until forge-meta on a network has the `vaultEntry` type. On testnet and devnet sakura that is a pending `deploy-v2.mjs --update meta` (see [Deployment status](#deployment-status)). The contract is [forge-v2.md §2](../contracts/forge-v2.md#forge-meta-mainnet-set-only), and the user-facing guide is [identity and keys](../guides/identity-and-keys.md#passkeys-for-other-devices).
Status: implemented in the web app, and live wherever forge-meta has the `vaultEntry` type: on testnet since its forge-meta update to version 2 on 2026-10-26 (see [Deployment status](#deployment-status)). Elsewhere it stays hidden. The contract is [forge-v2.md §2](../contracts/forge-v2.md#forge-meta-mainnet-set-only), and the user-facing guide is [identity and keys](../guides/identity-and-keys.md#passkeys-for-other-devices).

## What it is

Expand Down Expand Up @@ -79,9 +79,13 @@ The keys then go into the browser vault, protected by the same passkey (its loca

## Deployment status

The `vaultEntry` type is in the committed forge-meta (`forge-contracts/contracts/mainnet/forge-meta.json`) but **not yet on devnet sakura or testnet**. On each it is one `DataContractUpdate` of forge-meta, `deploy-v2.mjs --set mainnet --update meta` signed by that network's deployer (on testnet also with `--expect-sha256` over sums the owner signed), followed by `snapshot-contracts.mjs` for the network and a rehearsal that a group-bound limited key can write `vaultEntry`. Testnet lists the flag in its `since` (`build.py` `NETWORK_REGISTRATIONS`), so `--check` still reproduces what testnet registered. None of it has been run: each update needs the owner's approval. On mainnet the type is part of the registration set.
The `vaultEntry` type is in the committed forge-meta (`forge-contracts/contracts/mainnet/forge-meta.json`).

Until the update lands the feature is **inert**: the web app reads forge-meta from Platform (a proved fetch, which bypasses the bundled snapshot) and shows no passkey tile, no passkeys section and no offer while the contract has no `vaultEntry`. A read that fails also hides them. Nothing breaks and nothing is spent.
- **Testnet: live.** forge-meta was updated in place to version 2 on 2026-10-26: one `DataContractUpdate`, `deploy-v2.mjs --set mainnet --update meta`, signed by the testnet deployer with `--expect-sha256`, then `snapshot-contracts.mjs`. The scratch set got the same update first. On both, the live test showed that a group-bound limited key writes `vaultEntry` ([evidence](../../forge-contracts/evidence/testnet/README.md#forge-meta-update-to-version-2-the-passkey-vault-2026-10-26)). Testnet lists the flag in its `since` (`build.py` `NETWORK_REGISTRATIONS`), so `--check` still reproduces what testnet registered.
- **Devnet sakura: not updated.** It is retired and unreachable; the same update, signed by its deployer, would be needed if it came back.
- **Mainnet:** the type is part of the registration set.

Where forge-meta has no `vaultEntry`, the feature is **inert**: the web app reads forge-meta from Platform (a proved fetch, which bypasses the bundled snapshot) and shows no passkey tile, no passkeys section and no offer while the contract has no `vaultEntry`. A read that fails also hides them. Nothing breaks and nothing is spent.

If forge-meta is ever re-registered with a new id (`--force-new`), every passkey stops working: the contract id is in the PRF input and in the user handle. The new contract starts empty, and each user adds passkeys again.

Expand All @@ -91,4 +95,4 @@ If forge-meta is ever re-registered with a new id (`--force-new`), every passkey
- `forge-web/lib/auth/passkey-vault/*.test.ts` and `lib/auth/passkey-session.test.ts`: enrol, sign in, store locally, planted keys refused (not on the identity, disabled, expired, no budget, unbounded, foreign group, **extras without a budget or an expiry**), the "not-vault" and "other-vault" handles, the cap, re-seals that touch only this device's entries, removal that signals only this device's credentials, wiped buffers.
- Component tests for the sign-in tile, the passkeys section, the one-time offer and the revoke and disable dialogs.
- `forge-web/e2e/passkey-vault.spec.ts`: Chromium with a virtual authenticator (CDP `WebAuthn.addVirtualAuthenticator`, PRF) on `http://localhost`. The hermetic cases run anywhere; the full flow needs `E2E_WRITE=1` and a forge-meta with `vaultEntry`.
- `forge-web/lib/auth/passkey-vault.live.test.ts` (`FORGE_LIVE=1`): a fake authenticator against sakura, printing each step's fee.
- `forge-web/lib/auth/passkey-vault.live.test.ts` (`FORGE_LIVE=1`): a fake authenticator on testnet (or a devnet), printing each step's fee.
4 changes: 2 additions & 2 deletions forge-contracts/deployments/contracts/testnet.json

Large diffs are not rendered by default.

Loading
Loading