How It Works
A revolutionary subscription system powered by NFTs and cross-chain automation. See how smart contracts, reactive programming, and blockchain technology work together.
System Architecture
Users
Merchants
Smart Contracts Layer
Deployed on Base, BSC, Avalanche, Sonic
SubscriptionManager
- • Payment processing
- • Merchant registry
- • Token management
SubscriptionNFT
- • ERC-1155 NFTs
- • Access control
- • Expiry tracking
Payment Tokens
- • Multi-token support
- • ERC-20 compatible
- • Price feeds
Reactive Network
Cross-chain automation layer
Event Listeners
Monitor payments
Auto Renewal
Process payments
CRON Jobs
Check expiry
Cross-Chain
Bridge events
Subscription Lifecycle
User Subscribes
Token Approval
Payment Sent
NFT Minted
Active Period
Auto Renewal
Subscription States
Integration Example
// 1. Register as merchant
const tx = await manager.registerMerchant(
walletAddress, // Payment receiver
2592000, // 30 days duration
259200, // 3 days grace period
);
// 2. Set payment tokens
await manager.setPaymentToken(
USDC_ADDRESS,
parseUnits("9.99", 6) // $9.99/month
);
// 3. Add metadata (off-chain)
await registerMetadata({
merchantId: 1,
name: "Premium Service",
logo: logoBase64
});// 1. Approve token spending
const approval = await token.approve(
SUBSCRIPTION_MANAGER,
parseUnits("9.99", 6)
);
await approval.wait();
// 2. Subscribe to merchant
const subscription = await manager.subscribe(
merchantId,
USDC_ADDRESS
);
// 3. Check NFT ownership
const isActive = await nft.balanceOf(
userAddress,
merchantId
) > 0;import { useSubscription, SubscriptionButton } from '@nft-sub/sdk';
function App() {
const { isActive, expiry, renew } = useSubscription(merchantId);
return (
<div>
{isActive ? (
<p>Subscription active until {expiry}</p>
) : (
<SubscriptionButton
merchantId={merchantId}
onSuccess={handleSuccess}
/>
)}
</div>
);
}Platform Features
Automated Renewals
No manual intervention needed - payments process automatically
Fully Decentralized
All logic runs on-chain with no centralized dependencies
Grace Periods
Configurable buffer time for payment issues
Multi-Token
Accept ETH, USDC, DAI, or any ERC-20 token
Cross-Chain
Deploy on multiple chains simultaneously
NFT Access Control
Subscription status represented by tradeable NFTs
Ready to Get Started?
Explore our comprehensive documentation to integrate subscription NFTs into your application.