ALIBI

Commission authority without wallet access. A marketplace can earn its cut. It cannot spend your money.

Inspiration

African creatives are building audiences, producing digital work and finding customers, but payment infrastructure still creates barriers between creative work and income.

Caribou's November 2026 Youth Voices report surveyed 313 young creatives across Nigeria, Uganda, Rwanda and Senegal. 48% reported at least one payment challenge in the previous year. 27% said digital payments were blocked by their location, while 20% had used complex workarounds to receive money they had already earned. Among respondents, payment difficulties were reported by 53% in Nigeria and 41% in Senegal. The report describes its survey as directional, not nationally representative.

This does not mean every creator needs Bitcoin, or that conventional marketplaces routinely request access to creators' wallets. I focused on a more specific opportunity in the Bitcoin ecosystem:

When a self-custodial Lightning marketplace makes a sale, how can it collect its agreed commission without taking custody of the creator's gross payment or receiving unrestricted authority over the creator's wallet?

The Nostr Wallet Connect community's experimental Commission Payments proposal identifies this missing mechanism. I built Alibi as a reference implementation exploring that approach.

What Alibi does

Alibi binds a marketplace commission to the specific Lightning sale that earned it.

The creator configures a maximum commission rate, an approved commission recipient and a spending budget. A marketplace can request a commission-bound sale, but it cannot use that permission to make arbitrary payments from the creator's wallet.

The creator's wallet enforces the policy.

One sale, two linked Lightning payments

Consider a 100,000-sat digital-product sale:

  1. The creator approves a 5% commission limit and the marketplace's payment destination.
  2. The marketplace requests a sale tied to a specific commission invoice.
  3. The buyer pays one 100,000-sat sale invoice.
  4. The creator's wallet separately pays the marketplace's 5,000-sat commission.
  5. Alibi verifies the outgoing commission payment against the expected payment hash, amount and fee policy.
  6. Only after verification is the buyer's held payment released.

The marketplace receives 5,000 sats. The creator receives 95,000 sats before routing fees.

These are two linked Lightning payment legs, not one invoice automatically split between two recipients.

How I built it

I built Alibi with JavaScript and Node.js, using Bitcoin Core and three LND nodes in a controlled Bitcoin regtest environment.

The core implementation includes:

  • BOLT11 invoice decoding and validation.
  • Vendor-side commission rate and payee enforcement.
  • Integer-based monetary calculations using BigInt.
  • Fee-aware budget reservation.
  • Duplicate payment-hash and replay protection.
  • Hold-invoice creation and settlement-state validation.
  • Verification of the creator's actual outgoing commission payment before releasing the buyer's payment.
  • SQLite-backed transaction and budget state in REAL mode, configured to fail closed when storage is unavailable.

I also implemented an Nostr Wallet Connect transport using signed NIP-47 events, NIP-44 encryption and signature verification. Its authorization boundary has a separate test suite covering approved connections, revocation and restricted methods.

An independent verifier queries the LND nodes directly rather than trusting Alibi's database or application-level success messages.

Security and verification

I wanted the central payment rule to be proven, not merely described.

The committed evidence records:

  • 16/16 commission-policy adversarial checks passed.
  • 4/4 mutation checks confirmed that the tested security guards are load-bearing.
  • 8/8 budget-concurrency checks passed within the tested scope.
  • 13/13 NWC authority checks passed.
  • 17/17 stages passed in the production-service settlement flow.
  • 25/25 independent verification checks passed against three LND nodes.

The production settlement test demonstrates the central invariant: the buyer's held payment cannot be released while the outgoing commission payment is absent. Once that payment is independently verified, settlement can proceed.

The independent verifier checks the invoice states, payment hash, amount, outgoing payment, fee policy and reconciliation of the sale.

These are controlled regtest results, not mainnet transaction statistics or proof of Bitcoin consensus.

Challenges I ran into

The difficult part was coordinating two payment legs without treating an application response as proof that money had moved.

I had to distinguish an HTLC being accepted from one being settled, link the sale and commission through their payment hash, account for routing fees before reserving budget, and prevent premature or repeated settlement.

I also tested unauthorized marketplace callers, unauthorized commission recipients, excessive commission requests, exhausted budgets, duplicate hashes and invalid NWC requests.

One important limitation is the shared-preimage design: the marketplace may learn the preimage before the buyer pays. PTLC-based mitigation is future work, not something I claim to have solved.

What I am proud of

Alibi is not just a commission calculator. It demonstrates a specific wallet-authority boundary and verifies the resulting payment states against actual LND nodes.

The mutation tests are particularly important to me: I deliberately disable individual production policy guards and check that the corresponding security tests fail. This gives evidence that the protections are load-bearing rather than decorative.

What's next

My next milestone is to integrate Alibi with a self-custodial Lightning marketplace and validate the workflow with a small cohort of African digital creators.

I want to measure completed sales, commission-settlement success, creator net proceeds, failed checkouts and repeat usage. I also plan to improve low-bandwidth mobile checkout, connection-management UX, cancellation and crash recovery, and mitigation of the shared-preimage limitation.

A proposed initial validation would involve one marketplace integration and ten creators. This is a target for a pilot, not an existing deployment.

I built Alibi to explore a simple rule: a marketplace should be able to collect the commission it earned without receiving general authority over the creator's wallet.

Built With

Share this project:

Updates

Submission history