Terms and Conditions
- I agree to the Grant Agreement terms if funded
- I agree to Provide KYC information if funded above $50,000 USD
- I agree to disclose conflicts of interest
- I understand that this grant program is only eligible for completed work, as it is a retroactive grant program. Applications for planned or partially completed work will not be considered. All completed work will be verified and accepted by its intended users or their representatives, who will confirm that the outputs meet the required quality, functionality, and usability before the work is listed as an option for Coinholder voting.
- I agree that for any new open-source software, I will create a CONTRIBUTING.md file that reflects the high standards of Zcash development, using the
librustzcashstyle guides as a primary reference. - I understand when contributing to existing Zcash code, I am required to adhere to the project specific contribution guidelines, paying close attention to any merge, branch, pull request, and commit guidelines as exemplified in the librustzcash repository.
- I understand all grants are valued in USD but will be disbursed in Shielded ZEC. I acknowledge and accept that disbursement amounts may fluctuate based on the ZEC/USD exchange rate at the time of payment.
Application Owners (@octocat, @octocat1)
@JayWebtech
Organization or Individual Name
Jethro Adamu
Additional Team Members
None
How did you learn about the Lockbox: Coinholder Retroactive Grants Program?
Requested Grant Amount (USD)
10500
Category
Non-Wallet Applications
Project Summary
PetraPay is a non-custodial, Stripe-style payment gateway: customers pay with 190+ tokens on any chain, and businesses receive shielded ZEC at a fresh Orchard address, online through invoices, payment links and a developer API, and in person through an Android point-of-sale app with printed receipts.
Project Description
Most people who could pay a Zcash merchant don't hold ZEC. They hold USDC, ETH, SOL or BTC. That forces merchants who want Zcash-level privacy to either turn those customers away or settle to a transparent wallet. PetraPay removes that trade-off: the customer pays with whatever they hold, and the merchant receives shielded ZEC.
What it does (online and in person):
- Invoices and reusable payment links (fixed price or customer-chooses) with optional custom checkout fields. Links can be edited at any time without changing their URL.
- Customers pay with 190+ tokens on any supported chain via a connected wallet (EVM/Solana) or QR, after seeing a signed quote with fees included. They can also pay shielded ZEC directly via a ZIP-321 QR.
- Exact settlement: the merchant receives the exact invoiced ZEC amount at an Orchard address.
- Built-in off-ramp: merchants can withdraw ZEC to any token on any supported chain.
- Drop-in checkout for any website: the open-source
petrapaynpm package adds a "Pay with PetraPay" button (React component, web component or plain JS) that opens the hosted checkout in a popup and notifies the site when the customer has paid. No API key in the browser. - Developer API for stores: secret API keys, a REST API to create checkouts (order reference, metadata, redirect URLs, expiry), idempotency keys, and HMAC-signed webhooks with automatic retries and a delivery log.
- Full documentation site: guides, API reference, SDK, webhook verification samples, testing and self-hosting.
- Non-custodial and self-hostable: PetraPay never holds funds or keys.
Point of sale (in-person payments):
- A native Android POS app for payment terminals with a built-in 58 mm thermal printer (tested on the Senraise H10), and other Android devices.
- The cashier enters an amount in USD or ZEC; the terminal shows a QR with a 15-minute timer. The customer scans it with their phone and pays with any supported token or shielded ZEC.
- When the payment lands, the terminal shows "Paid" and prints a receipt automatically, with a QR linking to the online receipt.
- Terminals pair with a one-time, 10-minute code. A terminal can only create and view its own sales and can be revoked instantly.
How it complements existing Zcash payment tools: processors like CipherPay serve customers who already hold ZEC and detect payments via the merchant's viewing key. PetraPay targets the far larger group who don't hold ZEC, converting their payments into shielded ZEC, online and at a physical counter. It never asks for a viewing key, and every PetraPay payment converts non-Zcash money into shielded ZEC.
Privacy model:
- Funds settle into the Orchard pool.
- Each payment uses a fresh unified address from a pool the merchant supplies (e.g. from Zashi)
- ZIP-316 parsing (validated against the official test vectors) rejects transparent and Sapling-only addresses; an Orchard receiver is required.
- No email or password: accounts are ed25519 keys derived from a 12-word phrase that never leaves the browser.
Technical Approach (how you did it)
Architecture: TypeScript monorepo (pnpm), about 31,000 lines of code.
- Web: Next.js (App Router), Tailwind; deployed on Vercel at petrapay.xyz.
- API: Node.js + Fastify, PostgreSQL via Prisma, background worker; deployed on Railway at api.petrapay.xyz.
- Shared package: Zcash utilities and API schemas (zod).
- POS: React Native Android app with Kotlin native modules.
- SDK:
petrapayon npm (ESM, CJS and a script-tag build), with React bindings.
Cross-chain routing: NEAR Intents 1Click API (official SDK). Customer payments are EXACT_OUTPUT quotes so the merchant receives an exact ZEC amount; withdrawals are EXACT_INPUT. Every quote's signature is verified (verifyQuoteSignature), and the echoed recipient, assets and refund address must match the request before a deposit address is shown. Memo-based deposit mode is used automatically for chains that need it (e.g. Stellar). A worker polls swap status and moves checkouts OPEN → PROCESSING → PAID. Refunds go to the payer's own address.
Zcash specifics:
- ZIP-316 unified address decoding (bech32m + F4Jumble) implemented and tested against the official test vectors; Orchard receiver required.
- ZIP-321 payment URIs for direct shielded payments.
- Per-payment address pool assigned with SELECT … FOR UPDATE SKIP LOCKED so concurrent checkouts never share an address.
- Verified against the live API that Orchard-only unified addresses are accepted as ZEC recipients.
Accounts and encryption: ed25519 identity derived from a BIP-39 phrase and held as a non-extractable WebCrypto key; challenge-response login. Checkout form answers are sealed with X25519 ECDH + HKDF-SHA256 + AES-GCM in the customer's browser.
Merchant API: SHA-256-hashed secret keys (pp_sk_), Stripe-style /v1 REST API, idempotency records (24h), per-key rate limiting, transactional webhook outbox with HMAC-SHA256 signatures, exponential backoff retries over ~2 days, and SSRF protection on webhook URLs.
Checkout SDK: the hosted checkout opens in a popup (so browser wallets work, and checkout pages keep X-Frame-Options: DENY). The checkout page posts payment.created / processing / paid events to the opening window; the SDK accepts them only from the popup it opened and from the PetraPay origin. Pay-what-you-want links accept a pre-filled amount, so a store can pass its cart total. Tested end to end in headless Chrome.
Point of sale:
- Printer: native module binding the terminal's built-in printer service (AIDL) for 58 mm receipts with text, QR and layout.
- Secure storage: terminal credentials kept in Android Keystore-backed encrypted storage.
- Pairing: one-time pairing codes (hashed, 10-minute expiry) exchanged for a scoped terminal token.
- Sales are normal checkouts (source: "pos"), reusing the same quote verification, address pool, settlement worker and webhooks as online payments.
Testing: 44 automated API tests (ZIP-316 vectors, auth, address pool, settlement state machine, payment links and editing, merchant API, webhook signing and retries, POS pairing and test mode) plus SDK unit tests.
Timeline: initial build late September 2026; payment links and encrypted forms early October; invoice editing, deployment and the merchant API/webhooks through October; POS app, test mode, documentation site, the npm SDK, link editing and the five merchant integrations in early November 2026.
Time Period of Work Completion
September 2026 – October 2026
Total Budget (USD)
10500
Budget Breakdown
-
Compensation:
- $(USD): $10,500
- Justification: 300 hours of solo design, development, testing and deployment at $35/hr, from Sep 29 to Nov 9, 2026 (about 6 weeks). Hours by workstream, each verifiable in the repository:
• Payments core and Zcash, 70 h: ZIP-316 unified address decoding (bech32m + F4Jumble) tested against the official vectors; Orchard-only validation; per-payment shielded address pool with row locking; signed-quote verification and request matching; settlement worker (OPEN → PROCESSING → PAID, refunds); ZIP-321 direct-pay URIs.
• Web app and hosted checkout, 80 h: merchant dashboard; invoices with editing; payment links (fixed or customer-chooses, editable, with form answers encrypted in the browser via X25519 + AES-GCM); hosted checkout for 190+ tokens with wallet connect and live quotes; withdrawals (ZEC to any token); recovery-phrase accounts.
• Merchant API and webhooks, 40 h: pp_sk_ secret keys (hashed at rest), Stripe-style /v1 REST API, idempotency keys, rate limiting, HMAC-signed webhooks with retries and a delivery log, SSRF protection, and the 44-test automated suite.
• Android POS app, 45 h: React Native app with Kotlin native modules for the terminal's built-in printer (58 mm receipts with QR) and Keystore-backed storage; one-time terminal pairing with scoped access; per-terminal test mode enforced server-side.
• npm SDK and documentation, 30 h: the
petrapaypackage (React, web component and script-tag builds) with popup checkout and payment events, tested end to end in headless Chrome; an 18-page documentation site with API reference and code samples. • Deployment, security and integrations, 35 h: production deployment (Vercel + Railway, custom domains); security hardening (CSP/frame protection, input validation, rate limits); integrating PetraPay into five live merchant sites alongside their existing payment methods. $35/hr is below the typical market rate for full-stack developers with blockchain experience; it reflects the value of the delivered work rather than a premium rate.
-
Total $(USD): $10,500
Previous Funding
No
Previous Funding Details
No response
Other Funding Sources
No
Other Funding Sources Details
No response
Success Metrics
-
Shipped and live: a working, deployed product, not a prototype. It includes invoices, payment links, cross-chain checkout, withdrawals, a merchant API with webhooks, an npm checkout SDK, documentation, and an Android point-of-sale app running on real payment hardware. • App: https://www.petrapay.xyz • Documentation: https://www.petrapay.xyz/docs • npm package: https://www.npmjs.com/package/petrapay
-
Live with five merchant sites in different industries. Each one added PetraPay next to its existing payment methods with a few lines of code, using the npm package: • Keri's Premier (food products store): https://buy.kerispremier.shop/ • Poultrix (poultry farm management SaaS): https://shop.poultrix.org/ • Human Stock (people-investing app): https://stock.tryhumanstock.xyz • Tetra (bounty platform): https://bounty.trytetra.xyz • YTech Engineering (solar and engineering equipment store): https://www.crypto.ytechengineering.com/
-
Expands who can pay Zcash merchants: anyone holding one of 190+ tokens on a supported chain can now pay a business and have it settle in shielded ZEC.
-
Brings shielded ZEC into physical retail: a shop can accept any token from a walk-in customer and settle to the Orchard pool, with a printed receipt, and neither side needs to run Zcash infrastructure.
-
Increases shielded adoption: every payment settles into the Orchard pool at a fresh address, so payments can't be linked on-chain.
-
Easy for developers to adopt: a site can add PetraPay with one npm install and a few lines of code (React, web component or plain script tag), with no API key in the browser. Stores that need more can use the documented REST API and signed webhooks.
-
Reusable for the ecosystem: open-source and self-hostable, with a documented ZIP-316 implementation, a Stripe-style API and a public npm package other Zcash projects can build on.
Proof of completion
Repository: https://github.com/JayWebtech/petrapay (Sep 29 – Nov 9, 2026; MIT license)
- Web + API: apps/web, apps/api
- Android POS app: apps/pos
- Checkout SDK: packages/petrapay-js
Deployment: https://www.petrapay.xyz API: https://api.petrapay.xyz Documentation: https://www.petrapay.xyz/docs npm package: https://www.npmjs.com/package/petrapay POS demo: https://vimeo.com/1245082077 POS APK: https://github.com/JayWebtech/petrapay/raw/main/apk/petrapay-pos-v1.0.apk Demo video: https://vimeo.com/1245079217
Live merchants (PetraPay offered alongside each site's existing payment methods):
- YTech Engineering (equipment store): https://www.crypto.ytechengineering.com/
- Keri's Premier (food products): https://buy.kerispremier.shop/
- Poultrix (farm management SaaS): https://shop.poultrix.org/
- Human Stock (people-investing app): https://stock.tryhumanstock.xyz
- Tetra (bounty platform): https://bounty.trytetra.xyz
Mainnet transactions:
- Online payment (e.g. USDC on Solana → shielded ZEC): https://www.petrapay.xyz/pay/6sXvLQrBeN8y
Conflict of Interest Disclosure
None with the program. I have no affiliation with any Keyholder Organization, the FPF, ZCG, or NEAR. PetraPay uses the NEAR Intents 1Click API as its routing layer; I have no financial relationship with NEAR beyond standard API usage.
Community Forum Posting
- I understand it is my responsibility to post a link to this issue on the Zcash Community Forums after this application has been submitted so the community can give input. I understand this is required in order for the community to discuss and vote on this grant application. Note: If you are unable to post on the forum (for example, due to new user restrictions), please leave a comment below, and we will adjust your posting permissions.