Build a bot that verifies Solana payments before unlocking access
PayGateBot verifies that a user paid on Solana before it unlocks a Telegram group, Discord role, premium command, API key, or gated content link.
What PayGateBot integrates
PayGateBot can be added to an existing Telegram bot, Discord bot, SaaS backend, or content server. The bot does not need to sign transactions. It only verifies that a payment landed before granting access.
This is useful when users already have their own Solana wallets and you only need a reliable payment receipt.
Why payment verification is a product feature
A payment gate sounds simple until support starts handling edge cases. A user sends the wrong token. A user sends too little. A transaction is pending. A user sends to an old address. A user pays, then claims the bot never unlocked access.
The product value is not just collecting money. The value is reliable access control. PayGateBot gives you a repeatable way to turn a Solana transaction into a permission change in Telegram, Discord, an API, or a web app.
ROI for gated communities and APIs
Payment verification is high ROI because it replaces manual admin time. If an operator spends two hours per week verifying payments and handling access mistakes, automation pays for itself quickly. If the gated product sells at 10 USDC and automation prevents just a handful of unpaid access grants per month, the verification layer is already doing useful work.
The cleanest first product is one price, one destination address, one access outcome. For example: send 10 USDC to unlock a private Telegram group for 30 days. After that works, add tiers, renewals, and team plans.
Access unlock flow
- The bot displays a Solana deposit address and price.
- The user sends USDC and submits the transaction signature.
- The bot calls Viaclave to verify the transaction.
- The bot checks amount, token, destination, and confirmation state.
- The bot grants access only after the verification passes.
Access products to model
Model access products separately from payments. A payment is evidence. The product decides what evidence is enough and what the user receives.
type AccessProduct = {
productId: string;
name: string;
priceMicroUsdc: number;
destinationAddress: string;
durationDays: number;
};Verify and unlock
This function checks confirmation, token, amount, and destination. In production, also store the signature so it cannot be reused to unlock multiple accounts.
async function shouldUnlockAccess(signature: string, expectedAddress: string) {
const response = await fetch(
"https://api.viaclave.com/v1/transactions/" + signature,
{
headers: {
"Authorization": "Bearer vc_test_YOUR_KEY",
},
},
);
const tx = await response.json();
if (!tx.confirmed) return false;
return tx.transfers.some((transfer: { asset: string; amount: number; to: string }) => (
transfer.asset === "USDC" &&
transfer.amount >= 10000000 &&
transfer.to === expectedAddress
));
}Prevent replay and support problems
A transaction signature should only unlock one purchase once. Store every accepted signature with the user ID and product ID. If the same signature appears again, return the original access result instead of granting a new entitlement.
type VerifiedPayment = {
signature: string;
userId: string;
productId: string;
amountMicroUsdc: number;
verifiedAt: string;
};Where this works
- Telegram private groups and premium channels.
- Discord roles and invite links.
- Paid API key issuance.
- Token-gated reports, datasets, and dashboards.
- One-time purchases for bot commands or market alerts.
What to log
Store the user ID, signature, amount, token, destination address, access product, and unlock timestamp. That gives you a support trail when a user claims they paid but did not receive access.
Launch sequence
- Start with devnet and a test Telegram or Discord group.
- Use one fixed USDC price and one access product.
- Manually review the first 20 payments before fully automating access.
- Add alerts for underpayment, wrong token, wrong address, and duplicate signatures.
- Only then add recurring access, renewals, or multiple tiers.
Build this workflow in test mode
Create a test API key, connect the MCP server, or call the REST API directly. Viaclave's test mode lets you try wallet creation and test stablecoin payments without real funds.