x402 Protocol

How x402 Works

An on-chain protocol for trustless instant payouts

1

Payment Received

USD payment is sent directly to x402 smart contract on Solana. No account creation required.

POST /api/x402/payment
{
"wallet": "5xK9...nQ2m",
"amount": "54.59",
"currency": "USD"
}
2

Case Opening

x402 verifies on-chain payment and executes case opening logic. Skin values are calculated based on rarity.

GET /api/x402/verify
{
"skins": [3, 1, 2, 2, 3],
"payout": "127.45",
"verified": true
}
3

Instant Payout

Smart contract automatically transfers USD to your wallet. Trustless, instant, non-custodial.

POST /api/x402/payout
{
"status": "success",
"txId": "7a3c9e...4f21",
"amount": "127.45"
}
End-to-End Flow Time: ~2-3 seconds

CS2 Skins Integration

How x402 connects skin values to instant USDC payouts

Smart Contract Integration

// x402 Payout Protocol - Solana Smart Contract
pub struct CaseOpening {
pub wallet: Pubkey,
pub case_id: u64,
pub skins: Vec<Skin>,
pub total_value: u64,
}
pub fn process_case_opening(ctx: Context<OpenCase>) -> Result<()> {
let vrf_result = get_verifiable_random();
let skins = determine_drops(vrf_result);
let total = skins.iter()
.map(|s| s.market_value)
.sum::<u64>();
invoke(
&transfer_usd(ctx.wallet, total),
&[ctx.accounts.x402_program]
)?;
emit!(CaseOpenedEvent {
wallet: ctx.wallet,
payout: total,
timestamp: Clock::get()?.unix_timestamp
});
Ok(())
}

The smart contract uses Chainlink VRF for provably fair randomness, calculates total skin value from Steam Market API data, and executes atomic USD transfers through x402 protocol. All transactions are recorded on Solana with sub-second finality.

Verifiable Randomness

Chainlink VRF provides cryptographic proof that case outcomes are fair and cannot be manipulated. Each opening is verifiable on-chain.

Real-Time Market Data

Skin values sync with Steam Market API every 15 minutes. Oracle network ensures accurate pricing for instant payouts.

Why x402?

x402 is an open on-chain protocol that cannot be stopped or censored. Your money goes directly to your wallet in USD without delays and without the platform holding it. Everything happens on-chain, verifiable, and trustless. No intermediaries, no custody, no trust required.