Skip to main content
Payment data types produce standardised cryptocurrency payment request URIs that are recognised by all major wallet applications. A single scan pre-fills the recipient address, the requested amount, and optional metadata so the payer never has to type an address by hand.
These data types generate standard bitcoin: and ethereum: scheme URIs. They are compatible with wallets including MetaMask, Trust Wallet, Coinbase Wallet, BlueWallet, Muun, and any other app that implements BIP-21 (Bitcoin) or EIP-681 (Ethereum).

Bitcoin (BTC)

QrCode::BTC() produces a BIP-21 bitcoin: payment URI. Pass the recipient address and amount, with optional label, message, and return URL.

Signature

string
required
The recipient Bitcoin address. Must be a non-empty string.
float|string
required
The amount in BTC. Must be a positive numeric value. Pass as a string (e.g. '0.005') to avoid floating-point precision issues with very small values.
string
A human-readable label for the payment destination, shown in the wallet UI (maps to the label query parameter).
string
A message or note to attach to the payment request (maps to the message query parameter).
string
A URL the wallet should redirect to after the transaction is broadcast (maps to the r query parameter).

Examples

Passing an empty address or a non-numeric amount throws an InvalidBTCArgumentException. Always validate wallet addresses from user input before encoding them.

Ethereum

QrCode::Ethereum() produces an EIP-681 ethereum: payment URI. Pass the wallet address and an optional amount denominated in ETH.

Signature

string
required
The recipient Ethereum address. Must be a non-empty string (e.g. an EIP-55 checksummed address).
float|string|null
The requested amount in ETH. Omit or pass null to create an address-only QR code with no fixed amount.

Examples

Pass the amount as a string (e.g. '0.005') rather than a float when dealing with very small values to avoid PHP floating-point representation issues producing an invalid URI.
An empty address or a non-numeric amount throws an InvalidEthereumArgumentException. Validate the address format before encoding user-supplied values.