[Feature] Pay for peer files: local wallet (on-chain/LN/ecash) or invoice+QR to seller node #46
Closed
opened 2026-06-17 09:00:51 +00:00 by lfg2025
·
5 comments
No Branch/Tag Specified
main
ux-at-last
fix/mesh-send-content-inline-federation-fallback
cashu-error-messages
gsd/phase-13-aiui-functional-conversational-node-control-and-content-surf
feat/podsteadr-app-package
rotate-release-root
chore/aiui-monorepo-migration
wip/phase-13-p13-02
wip/phase-13-p13-01
companion/0.5.27-clipboard-qr-restart
fix/bitcoin-conf-conflict-crash-loop
demo-build
archy-hwconfig
openwrt-enhancements
a3-10-endpoint-fallback
public-prelaunch
release/1.7.115-prep
fix/web-listener-ipv6
fips-companion-5g-hardening
fix/connection-accept-deadlock
fix/demo-images-path-filter
fix/companion-autologin-replay-intro
networking-profits-dashboard
identities-mobile-polish
companion-qr-scan-fix
companion-qr-pairing
intro-reliability-video-perf
login-bg-continuity
audio-bottom-bar
demo-intro-every-visit
intro-entrance-fixes
cloud-feedback-demo-content
cloud-tabs-search
ark-wallet-ui-demo
demo-nginx-app-assets
demo-ui-fixes
ark-wallet-barkd
v1.7.129-alpha
v1.7.128-alpha
v1.7.127-alpha
v1.7.126-alpha
v1.7.125-alpha
v1.7.124-alpha
v1.7.123-alpha
v1.7.122-alpha
v1.7.121-alpha
v1.7.120-alpha
v1.7.119-alpha
v1.7.118-alpha
v1.7.117-alpha
v1.7.116-alpha
v1.7.115-alpha
v1.7.114-alpha
v1.7.113-alpha
v1.7.112-alpha
companion-v0.5.10
companion-v0.5.9
companion-v0.5.6
v1.7.111-alpha
v1.7.110-alpha
v1.7.109-alpha
v1.7.108-alpha
v1.7.106-alpha
v1.7.105-alpha
v1.7.104-alpha
v1.7.103-alpha
v1.7.102-alpha
v1.7.101-alpha
v1.7.100-alpha
v1.7.99-alpha
v1.7.98-alpha
v1.7.97-alpha
v1.7.96-alpha
v1.7.95-alpha
v1.7.94-alpha
v1.7.93-alpha
v1.7.92-alpha
v1.7.91-alpha
v1.7.90-alpha
v1.7.89-alpha
v1.7.88-alpha
v1.7.87-alpha
v1.7.86-alpha
v1.7.85-alpha
v1.7.84-alpha
v1.7.83-alpha
v1.7.82-alpha
v1.7.81-alpha
v1.7.80-alpha
v1.7.79-alpha
v1.7.78-alpha
v1.7.77-alpha
v1.7.76-alpha
v1.7.75-alpha
v1.7.74-alpha
v1.7.73-alpha
v1.7.72-alpha
v1.7.71-alpha
v1.7.70-alpha
v1.7.69-alpha
v1.7.68-alpha
v1.7.67-alpha
v1.7.66-alpha
v1.7.65-alpha
v1.7.64-alpha
v1.7.63-alpha
v1.7.62-alpha
v1.7.61-alpha
v1.7.60-alpha
v1.7.59-alpha
v1.7.58-alpha
v1.7.57-alpha
v1.7.56-alpha
v1.7.55-alpha
v1.7.54-alpha
v1.7.53-alpha
v1.7.52-alpha
v1.7.51-alpha
v1.7.50-alpha
v1.7.49-alpha
v1.7.48-alpha
v1.7.47-alpha
v1.7.46-alpha
v1.7.45-alpha
v1.7.44-alpha
v1.7.43-alpha
v1.7.42-alpha
v1.7.41-alpha
v1.7.40-alpha
v1.7.39-alpha
v1.7.38-alpha
v1.7.37-alpha
v1.7.36-alpha
v1.7.35-alpha
v1.7.34-alpha
v1.7.33-alpha
v1.7.32-alpha
v1.7.31-alpha
v1.7.30-alpha
v1.7.29-alpha
v1.7.28-alpha
v1.7.27-alpha
v1.7.26-alpha
v1.7.25-alpha
v1.7.24-alpha
v1.7.23-alpha
v1.7.22-alpha
v1.7.21-alpha
v1.7.20-alpha
v1.7.19-alpha
v1.7.18-alpha
v1.7.17-alpha
v1.7.16-alpha
v1.7.15-alpha
v1.7.14-alpha
v1.7.13-alpha
v1.7.12-alpha
v1.7.11-alpha
v1.7.10-alpha
v1.7.9-alpha
v1.7.8-alpha
v1.7.7-alpha
v1.7.6-alpha
v1.7.5-alpha
v1.7.4-alpha
v1.7.3-alpha
v1.7.2-alpha
v1.7.1-alpha
v1.7.0-alpha
v1.3.4
v1.3.3
v1.3.2
v1.2.0-alpha.8
v1.2.0-alpha.7
v1.2.0-alpha.6
v1.2.0-alpha.5
v1.2.0-alpha.4
v1.2.0-alpha.3
v1.2.0-alpha.2
v1.2.0-alpha.1
Labels
No items
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: lfg2025/archy#46
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When downloading/buying a file from a peer node, the buyer should be able to pay with their local wallet (on-chain / Lightning / ecash), OR pay via an invoice with a QR code drawn on the selling node's wallet.
Scope:
Files: neode-ui/src/views/PeerFiles.vue (purchase/download flow), wallet/LND + ecash RPCs, peer-content paid proxy. Ties into paid-preview/#35 work.
GROUNDWORK LANDING: the DHT Phase 4 'paid swarm streaming' work (cross-mint ecash swap, fetch-side auto-pay, Shape-A paid-blobs ALPN, streaming.prepare-payment RPC) is being merged into main now (behind the iroh-swarm feature, off by default). It provides the ecash/payment plumbing this feature can build the PeerFiles purchase UX on. The user-facing 'pay with local wallet (on-chain/LN/ecash) or invoice+QR to the seller node' flow in PeerFiles is still TODO on top of it.
Phase 1 (Lightning invoice + QR + release) implemented — open for Phase 2/3.
The buyer can now choose how to pay a paid peer file:
Backend:
content_invoice.rs: seller-side pending-entitlement store keyed by payment hash (in-memory, 1h TTL).GET /content/{id}/invoice(mints a bolt11 on the seller's LND, records entitlement) andGET /content/{id}/invoice-status/{hash}(polls its own LND, marks paid on settlement).content_server::serve_contentgained an invoice-paid path: anX-Invoice-Hashheader is honoured alongside the ecashX-Payment-Token. The seller only releases for a hash it issued + confirmed settled, scoped to that content_id.create_invoice(returns bolt11 + hex payment hash) andinvoice_is_settled.content.request-invoice,content.invoice-status,content.download-peer-invoice.Frontend (
PeerFiles.vue): payment-method picker modal; renders the invoice as a QR (qrcodelib), shows amount + live "waiting for payment…", auto-downloads on settlement.cargo check+vue-tscpass. Verify live: .116 seller + .198 buyer with a funded LN wallet — buyer picks QR, pays from a 3rd wallet, file releases; then re-test the ecash path.Remaining (keeping this open): Phase 2 = on-chain invoice (
lnd.newaddress+ address watch); Phase 3 = local LN/on-chain payment methods (the "local wallet on-chain/LN" half of the title). Needs live funded-wallet testing regardless.Phase 2 (pay from your own node's Lightning wallet) implemented.
PeerFiles purchase modal now offers a third option, "Pay with my Lightning node", alongside the existing ecash fast-path and the external-wallet QR:
payWithLightning()inneode-ui/src/views/PeerFiles.vue: asks the seller for a bolt11 (content.request-invoice), pays it from this node vialnd.payinvoice, then releases the file withcontent.download-peer-invoiceusing the returned payment hash. No QR/polling —lnd.payinvoiceonly returns after settlement, so the hash is immediately valid as the download gate token.All three pay paths now covered (ecash / local LN / external QR). On-chain (
lnd.sendcoins) remains an optional follow-up. Pending the same fleet deploy+verify gate before close.Closing — Phase 1 (Lightning invoice + QR + release, alongside the existing ecash path) is implemented and compiles. On-chain and local-LN payment methods remain as future enhancements; will track separately if needed.
On-chain path implemented — all four pay options now present, closing as code-complete.
Added: seller issues a fresh address (
lnd.newaddress) and records a pending entitlement keyed by the address; buyer pays from its own node (lnd.sendcoins) and polls; seller releases on conservative detection (gettransactions: exact address + amount ≥ price + ≥1 confirmation). Gate viaX-Onchain-Address, reusing the shared entitlement store. New buyer RPCscontent.request-onchain/onchain-status/download-peer-onchain; seller handlers + router added. FE: "Pay on-chain from my node" button (PeerFiles).Pay paths: this-node ecash / own-node Lightning / external-wallet QR / on-chain. Frontend typechecks + backend
cargo checkboth clean.GATE before trusting with real value: the on-chain release is new money-handling code — validate the full flow on regtest, and exercise it once on a real deploy. Reopen if verification fails.