No description
  • Rust 94.5%
  • Nix 5.2%
  • Just 0.3%
Find a file
tsk a6586459fc
Some checks failed
CI / flake-check (push) Failing after 3s
feat(usernames): price names individually and reserve names
Pricing rules from an optional JSON file (NixOS: usernamePricing) apply in
order: reserved names, named prices, prices by length, then the default
NPUBCASH_USERNAME_PRICE_SAT. Each 402 offers the requested name's price in
the Cashu request, the x402 terms, and the hold invoice; L402 proofs are
verified at their invoice's price. Reserved names return 403 and are never
offered.

GET /api/v2/username/{name} shows availability and price without
authentication, /api/v2/info lists the length prices, and /llms.txt
describes them. `npubcash-server usernames assign` (NixOS:
npubcash-usernames) gives a reserved or free name to an account without
payment, journaled as an OPERATOR payment (migration 0005).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:42:50 +00:00
.github init commit 2026-08-23 11:29:36 +00:00
crates feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
docs feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
e2e test: add opt-in end-to-end checks against LDK Server and a CDK test mint 2026-10-12 13:42:49 +00:00
migrations feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
nix feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
.env.example feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
.gitignore init commit 2026-08-23 11:29:36 +00:00
AGENTS.md init commit 2026-08-23 11:29:36 +00:00
Cargo.lock feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
Cargo.toml feat: sell usernames over Lightning (x402, L402) and pay out Cashu revenue 2026-10-09 12:23:56 +00:00
CODE_STYLE.md init commit 2026-08-23 11:29:36 +00:00
compose.yaml init commit 2026-08-23 11:29:36 +00:00
deny.toml feat: sell usernames over Lightning (x402, L402) and pay out Cashu revenue 2026-10-09 12:23:56 +00:00
DEVELOPMENT.md test: add opt-in end-to-end checks against LDK Server and a CDK test mint 2026-10-12 13:42:49 +00:00
flake.lock init commit 2026-08-23 11:29:36 +00:00
flake.nix feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
justfile test: add opt-in end-to-end checks against LDK Server and a CDK test mint 2026-10-12 13:42:49 +00:00
OPERATIONS.md feat(usernames): price names individually and reserve names 2026-10-12 13:42:50 +00:00
PLAN.md fix(api): expose locked-quote settings endpoint 2026-08-24 10:28:00 +00:00
README.md feat(http): describe username purchases for agents 2026-10-12 13:42:49 +00:00
rust-toolchain.toml init commit 2026-08-23 11:29:36 +00:00
rustfmt.toml init commit 2026-08-23 11:29:36 +00:00
SECURITY.md init commit 2026-08-23 11:29:36 +00:00

npubcash-rust

A Rust implementation of the npub.cash v2 protocol for the pinned cdk-nostr npub.cash client. Cashu operations are delegated to CDK and Nostr operations to the Rust Nostr crates.

The first-release implementation targets CDK v0.18.1. The compatibility contract and implementation decisions are in docs/contract/v2.md and docs/adr/0001-upstream-pins-and-operating-policy.md.

Development

nix develop
just quick-check

PostgreSQL is the sole application database. Start a local server, create a database, and export DATABASE_URL before running integration tests.

The flake provides an explicit runnable app:

nix run .# -- --version

Running the service requires PostgreSQL, applied migrations, runtime secrets, a NUT-04/NUT-20-compatible mint, and at least one reachable Nostr relay. Usernames are sold for Cashu, and optionally over Lightning (x402 and L402) through an LDK Server node, with Cashu revenue paid out to a NUT-18 request. Agents can read the purchase steps at /llms.txt, which is generated from the deployment's configuration and linked from every username 402. See docs/nixos-module.md for the recommended NixOS deployment, including automatic PostgreSQL provisioning and migrations.

See DEVELOPMENT.md for contributor workflows and OPERATIONS.md for configuration, secrets, backup, monitoring, upgrades, and rollback.