- Rust 94.5%
- Nix 5.2%
- Just 0.3%
|
Some checks failed
CI / flake-check (push) Failing after 3s
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>
|
||
|---|---|---|
| .github | ||
| crates | ||
| docs | ||
| e2e | ||
| migrations | ||
| nix | ||
| .env.example | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CODE_STYLE.md | ||
| compose.yaml | ||
| deny.toml | ||
| DEVELOPMENT.md | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| OPERATIONS.md | ||
| PLAN.md | ||
| README.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
| SECURITY.md | ||
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.