Skip to main content
Payment links let merchants create reusable payment requests tied to a specific HideMe confidential token and amount. When a payer fulfills the link, the transfer is encrypted on-chain via transferPlaintext — the on-chain balance changes are invisible even though the link amount is known off-chain.
Payment links work with HideMe native tokens (deployed via HideMeFactory). For sending any ERC-20 confidentially, see Confidential Payments.
1

Merchant creates a link

Call createPaymentLink() on the ConfidentialPayments contract with the token address, amount, memo, and optional expiry. You receive a bytes32 link ID.
2

Share the link ID

Share the linkId with your customer. The HideMe app hosts a payer UI at /pay/[txHash] — pass the transaction hash of the createPaymentLink call. The app resolves the linkId from the transaction receipt and presents a payment form to the payer.
3

Payer fulfills the link

The payer calls payLink(linkId). The contract calls token.transferPlaintext(merchant, amount), which encrypts the amount on-chain via FHE and transfers it from payer to merchant.
4

Link is marked paid

Once paid, the link cannot be reused. The LinkPaid event is emitted with the payer address and timestamp.
function createPaymentLink(
    address token,
    uint64 amount,
    string calldata memo,
    uint256 expiry
) external returns (bytes32 linkId)
token
address
required
Address of the HideMeToken to charge. Must be a token deployed via HideMeFactory.
amount
uint64
required
Amount in raw token units (6 decimals). For example, 50_000_000 = 50 tokens.
memo
string
required
Human-readable description shown to the payer (e.g. "Invoice #42", "Monthly subscription").
expiry
uint256
required
Unix timestamp after which the link expires. Pass 0 for no expiry.
Returns a bytes32 linkId — the unique identifier for this payment link, derived from a keccak256 hash of the parameters and block timestamp.
function payLink(bytes32 linkId) external
The caller’s HideMeToken balance is charged. The token contract encrypts the transfer on-chain via FHE.asEuint64(amount) — no browser WASM required from the payer.
The payer must hold sufficient balance in the specified HideMeToken. If their encrypted balance is insufficient, the transfer silently sends 0 (standard FHE behavior) and the link is still marked as paid.
function cancelLink(bytes32 linkId) external
Only the merchant (link creator) can cancel an unpaid link. Cancelled links cannot be fulfilled. The LinkCancelledEvent event is emitted.
// Get all link IDs for a merchant
function getMerchantLinks(address merchant) external view returns (bytes32[] memory)

// Get full details for a link
function getLink(bytes32 linkId) external view returns (
    address token,
    address merchant,
    uint64 amount,
    string memory memo,
    uint256 expiry,
    bool paid,
    bool cancelled,
    address payer,
    uint256 paidAt
)
token
address
The HideMeToken contract address.
merchant
address
Address that created the link and will receive the payment.
amount
uint64
Fixed payment amount in token units (6 decimals).
memo
string
Human-readable description set at creation time.
expiry
uint256
Unix timestamp for expiry. 0 means no expiry.
paid
bool
Whether the link has been fulfilled.
cancelled
bool
Whether the merchant cancelled the link.
payer
address
Address that paid the link (address(0) if unpaid).
paidAt
uint256
Block timestamp when payment was made (0 if unpaid).

Events

EventParametersDescription
LinkCreatedlinkId, merchant, tokenEmitted when a new payment link is created
LinkPaidlinkId, payer, paidAtEmitted when a link is successfully paid
LinkCancelledEventlinkIdEmitted when a merchant cancels an unpaid link

Custom errors

ErrorWhen thrown
LinkNotFoundlinkId does not exist
LinkAlreadyPaidLink has already been fulfilled
LinkExpiredCurrent timestamp exceeds expiry
LinkNotExpired(reserved for future use)
NotMerchantCaller is not the link creator
LinkCancelledLink was cancelled by the merchant

Contract address

Mainnet: 0xA12c43CFCe337f0f8b831551Fbd273A61b0488d5

Confidential Payments

Send any ERC-20 with encrypted amounts using the payment router.

ConfidentialPayments Contract

Full contract reference for ConfidentialPayments.

Build docs developers (and LLMs) love