Overview
This independent project explores what it takes to accept payments dependably. Invoices are created and controlled by the server, every payment attempt is verified against the chain, and the workflow is designed so retries and duplicate submissions cannot produce inconsistent results.
Payment systems fail in subtle ways: a browser reports a payment that never settled, a request is retried and processed twice, or a valid transaction is replayed against a different invoice. The project treats each of these as a design requirement rather than an edge case.
The challenge
The engineering requirements the work had to satisfy:
- Authenticate users and protect routes that manage invoices.
- Keep invoice amounts, tokens and recipients under server control.
- Record payment attempts and verify transactions on Solana and EVM networks.
- Prevent duplicate processing and transaction replay.
- Handle pending states so retries are always safe.
Role & contribution
- 01Designed and built the project independently, end to end.
- 02Implemented authentication, protected routes and server-controlled invoices.
- 03Built payment attempt tracking and transaction verification.
- 04Implemented invoice idempotency, nonce and replay protection, confirmation rules and retry-safe pending states.
- 05Verified network, token, recipient, amount and transaction identity before marking an invoice paid.
Technical architecture
01 Client
Next.js interface
Authenticated invoice and payment views
02 Server
Protected server routes
Invoices, attempts, verification
Idempotency + nonces
Duplicate and replay protection
03 Data
SQLite
Invoices, attempts and verification state
04 Networks
Solana
Transaction lookup and confirmation
EVM networks
Transaction lookup and confirmation
Key implemented features
Server-controlled invoices
Amounts, tokens and recipients are set by the server and cannot be altered by the client.
Payment attempts
Each attempt to pay is recorded and tracked through its lifecycle.
Transaction verification
Network, token, recipient, amount and transaction identity are all checked before acceptance.
Idempotent invoices
Repeated requests resolve to the same outcome instead of creating duplicates.
Nonce and replay protection
A transaction cannot be reused to settle a different invoice.
Retry-safe pending states
Unconfirmed payments wait in a pending state that can be re-checked safely.
Development approach
- Never trust the client
- The browser can report a transaction, but only server-side verification can mark an invoice paid.
- Explicit state machine
- Invoices move through defined states, with confirmation rules deciding when a payment is final.
- Design for retries
- Every step can be repeated without changing the result, so transient failures are recoverable.
- Chain-agnostic checks
- The same verification rules apply across Solana and EVM networks.
Technical stack
- Next.js
- TypeScript
- SQLite
- Solana
- EVM integrations
Key engineering considerations
Idempotency
Network failures and double-clicks are normal; the system must produce one outcome per invoice.
Replay resistance
Binding transactions to invoices with nonces prevents one payment from settling twice.
Confirmation rules
A transaction is only treated as final once it meets the configured confirmation criteria.
Honest limits
As an independent project, it demonstrates design principles; it has not undergone external security review.