Skip to Content
DocsGuidesRenting NFTs on Solana (USDC)

Renting NFTs on Solana (USDC)

Solana is the first officially supported chain for FX402, thanks to its fast finality and low fees.
This guide shows how to enable NFT rentals and verify usage on Solana using USDC.


⚙️ 1. Requirements

  • Solana wallet (Phantom, Backpack, Solflare)
  • USDC token with sufficient balance
  • FX402-compatible endpoint

🧩 2. Flow Overview

StepAction
1️⃣Client requests NFT metadata or content
2️⃣Server replies with 402 + R402 tiers
3️⃣User pays USDC to the pay_to.address
4️⃣Client resends with payment_proof.tx
5️⃣Server verifies, issues receipt, returns NFT data

💳 3. Payment Proof Structure

When using Solana, payments can be verified by scanning the transaction ID.

{ "payment_proof": { "chain": "solana", "currency": "USDC", "tx": "4sJQd2cA...FyW" } }

The facilitator checks:

  • That the token is USDC (verified mint)
  • That the amount matches the tier price
  • That the destination matches pay_to.address

🧠 4. Wallet Adapter Example (JS SDK)

Using the JS SDK:

import { r402Fetch, attachWallet } from "@fx402/r402"; attachWallet({ chain: "solana", async payUSDC({ to, amount }) { const wallet = await getPhantomWallet(); return wallet.transferUSDC(to, amount); }, }); const res = await r402Fetch("https://fx402.xyz/nft/rare-001.png"); const blob = await res.blob();

🔗 5. Resource Gating Patterns

  • Serve preview thumbnails for all users
  • Gate high-resolution files behind FX402
  • Store r402 receipt hashes in your backend logs for traceability

🧾 6. Example NFT Metadata (with R402 block)

{ "name": "Poster #001", "image": "ipfs://bafy...poster.png", "r402": { "endpoint": "https://fx402.xyz/rent/poster-001", "tiers": [ { "id": "7d", "price": "1.00", "currency": "USDC", "chain": "solana" } ], "modes": ["view", "remix"] } }

🧰 7. Tips

  • Prefer USDC for stability.
  • Use Solana devnet for testing before mainnet rollout.
  • Cache verified receipts in your DB to reduce facilitator load.
  • For premium content, use JWT receipts with signature validation.

📚 Next Steps

Time-boxed Tickets & Access Passes →

Last updated on