> ## Documentation Index
> Fetch the complete documentation index at: https://laravel-qrcode.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Crypto Payment QR Codes: Bitcoin & Ethereum

> Generate BIP-21 Bitcoin and EIP-681 Ethereum payment QR codes that work with every major crypto wallet app out of the box.

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.

<Note>
  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).
</Note>

***

## 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

```php theme={null}
QrCode::BTC(
    string       $address,
    float|string $amount,
    ?string      $label         = null,
    ?string      $message       = null,
    ?string      $returnAddress = null,
)
```

<ParamField body="address" type="string" required>
  The recipient Bitcoin address. Must be a non-empty string.
</ParamField>

<ParamField body="amount" type="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.
</ParamField>

<ParamField body="label" type="string">
  A human-readable label for the payment destination, shown in the wallet UI
  (maps to the `label` query parameter).
</ParamField>

<ParamField body="message" type="string">
  A message or note to attach to the payment request (maps to the `message`
  query parameter).
</ParamField>

<ParamField body="returnAddress" type="string">
  A URL the wallet should redirect to after the transaction is broadcast (maps
  to the `r` query parameter).
</ParamField>

### Examples

```php theme={null}
use Linkxtr\QrCode\Facades\QrCode;

// Minimal — address and amount only
$qr = QrCode::BTC('bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', 0.005);

// With label and message
$qr = QrCode::BTC(
    address: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
    amount:  0.0034,
    label:   'Donation',
    message: 'Thanks for supporting open source!',
);

// With a return URL
$qr = QrCode::BTC(
    address:       '1A1zP1eP5QGefi2DMPTfTL5SLmv7Divf',
    amount:        0.01,
    label:         'Order #1042',
    returnAddress: 'https://shop.example.com/orders/1042/confirm',
);

// Render as a 400 px SVG inline
echo QrCode::BTC('bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', 0.0034)
    ->size(400)
    ->generate();

// Save to disk as PNG
QrCode::BTC('bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', 0.005)
    ->format('png')
    ->size(400)
    ->generate(storage_path('app/qrcodes/btc-payment.png'));
```

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

***

## Ethereum

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

### Signature

```php theme={null}
QrCode::Ethereum(
    string            $address,
    float|string|null $amount = null,
)
```

<ParamField body="address" type="string" required>
  The recipient Ethereum address. Must be a non-empty string (e.g. an EIP-55
  checksummed address).
</ParamField>

<ParamField body="amount" type="float|string|null">
  The requested amount in ETH. Omit or pass `null` to create an address-only QR
  code with no fixed amount.
</ParamField>

### Examples

```php theme={null}
use Linkxtr\QrCode\Facades\QrCode;

// Address only — no fixed amount
$qr = QrCode::Ethereum('0x742d35Cc6634C0532925a3b8D2b2CE1e5bfb043d');

// With a fixed ETH amount
$qr = QrCode::Ethereum('0x742d35Cc6634C0532925a3b8D2b2CE1e5bfb043d', 1.5);

// Small amount — string form avoids floating-point precision issues
$qr = QrCode::Ethereum('0x742d35Cc6634C0532925a3b8D2b2CE1e5bfb043d', '0.005');

// Render inline as SVG
echo QrCode::Ethereum('0x742d35Cc6634C0532925a3b8D2b2CE1e5bfb043d', 0.1)
    ->size(400)
    ->generate();

// Save as PNG
QrCode::Ethereum('0x742d35Cc6634C0532925a3b8D2b2CE1e5bfb043d', 1.5)
    ->format('png')
    ->size(400)
    ->generate(storage_path('app/qrcodes/eth-payment.png'));
```

<Tip>
  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.
</Tip>

<Warning>
  An empty address or a non-numeric amount throws an
  `InvalidEthereumArgumentException`. Validate the address format before
  encoding user-supplied values.
</Warning>
