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.
How payment links work
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.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.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.Creating a payment link
Address of the HideMeToken to charge. Must be a token deployed via HideMeFactory.
Amount in raw token units (6 decimals). For example,
50_000_000 = 50 tokens.Human-readable description shown to the payer (e.g.
"Invoice #42", "Monthly subscription").Unix timestamp after which the link expires. Pass
0 for no expiry.bytes32 linkId — the unique identifier for this payment link, derived from a keccak256 hash of the parameters and block timestamp.
Paying a link
FHE.asEuint64(amount) — no browser WASM required from the payer.
Cancelling a link
LinkCancelledEvent event is emitted.
Querying links
PaymentLink fields
The HideMeToken contract address.
Address that created the link and will receive the payment.
Fixed payment amount in token units (6 decimals).
Human-readable description set at creation time.
Unix timestamp for expiry.
0 means no expiry.Whether the link has been fulfilled.
Whether the merchant cancelled the link.
Address that paid the link (
address(0) if unpaid).Block timestamp when payment was made (
0 if unpaid).Events
| Event | Parameters | Description |
|---|---|---|
LinkCreated | linkId, merchant, token | Emitted when a new payment link is created |
LinkPaid | linkId, payer, paidAt | Emitted when a link is successfully paid |
LinkCancelledEvent | linkId | Emitted when a merchant cancels an unpaid link |
Custom errors
| Error | When thrown |
|---|---|
LinkNotFound | linkId does not exist |
LinkAlreadyPaid | Link has already been fulfilled |
LinkExpired | Current timestamp exceeds expiry |
LinkNotExpired | (reserved for future use) |
NotMerchant | Caller is not the link creator |
LinkCancelled | Link 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.