feat: Add OpenCryptoPay (OCP) payment standard support#14
Open
TaprootFreak wants to merge 1 commit into
Open
Conversation
Add OCP integration as a new service module alongside the existing WDK wallet service. Enables wallets to process multi-chain payments from static QR codes following the OpenCryptoPay standard. New files: - src/services/ocp/ — OCP service (detect, payment details, tx submit) - src/contexts/ocp-context.tsx — useOcp() hook and OcpProvider Flow: QR scan → LNURL decode → fetch payment details → user selects method/asset → WDK sends transaction → submit tx hash to OCP API. Supports Bitcoin, Ethereum, Arbitrum, Polygon, Lightning, Solana, Tron with BTC, USDT, XAUT assets. LUD-01 compliant LNURL handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenCryptoPay for WDK
OpenCryptoPay (OCP) is a permissionless, open payment standard that enables crypto payments in physical stores, web shops, and invoice payments. It extends LNURL with multi-chain, multi-asset support — allowing users to pay with USDT, BTC, XAUT across Ethereum, Polygon, Arbitrum, Bitcoin, Lightning and more, all from a single static QR code.
Why this matters for Tether
OCP is already in production. Major players have adopted the standard:
USDT is the most-used asset in OCP payments. Every OCP transaction with USDT strengthens Tether's core value proposition. Without this integration, the Tether Wallet is one of the few major wallets that cannot participate in OCP payments — even though USDT is the primary asset being used.
With this PR, a Tether Wallet user can walk into a SPAR store, scan the QR code, and pay with USDT. Without it, they can't.
Technical Overview
How OCP works
Every cash register has a static QR code. The QR contains an LNURL-encoded API URL. When scanned:
What this PR adds
A new
ocpservice module anduseOcp()React hook, alongside the existing wallet service:Usage
Why this is safe to merge
wdk-service/,wallet-context.tsx, worklets, or secret manager@scure/baseadded as peer dep — already transitively available viabip39→@scure/bip39src/services/ocp/andsrc/contexts/ocp-context.tsx— everything revertsuseReducercontext,import type, same error handlingSpec compliance details
@scure/base(same lib tree asbip39).onionURL validation per LUD-01{ status: "ERROR", reason: "..." }) properly handledstandard: "OpenCryptoPay"field in responsequote.paymentas path IDSupported payment paths
bitcoin(SegWit)ethereumarbitrumpolygonlightningsolanatronAs WDK adds support for more assets and chains, OCP coverage expands automatically through the mapping layer.
Links