Menu

Explorer & Settings

Tempo Explorer Submit Project
Back to all projects

url_x402

by Aayushgoyal00 · Updated 8 months ago

A decentralized URL shortener powered by x402 micropayments and blockchain storage on Base Sepolia

In the AI payments ecosystem

url_x402 is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on base-sepolia, x402. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like parlaycity, AutonomiX, omnioracle, x402-worker-middleware, agent-procure, truthmesh.

README.md View on GitHub →

URLx402 - Blockchain URL Shortener

A decentralized URL shortener powered by x402 micropayments and blockchain storage on Base Sepolia.

✨ Features

  • 🔗 URL Shortening - Pay $0.001 USDC to create shortened URLs
  • 🔍 URL Lookup - Free blockchain-based URL retrieval
  • 💳 x402 Payments - Seamless crypto micropayments via MetaMask
  • ⛓️ On-Chain Storage - Permanent URLs stored on Base Sepolia

🚀 Quick Start

Prerequisites

  • Node.js 18+ and pnpm
  • MetaMask with Base Sepolia network
  • Base Sepolia USDC for payments
  • Base Sepolia ETH for gas fees

Installation

# Install dependencies
pnpm install

# Copy environment template
cp env.template .env.local

Configuration

Edit .env.local:

# Your deployed contract address on Base Sepolia
NEXT_PUBLIC_CONTRACT_ADDRESS=0xYourContractAddress

# Base Sepolia RPC URL
NEXT_PUBLIC_BASE_SEPOLIA_RPC_URL=https://sepolia.base.org

# Server wallet private key (for contract interaction)
SERVER_PRIVATE_KEY=0xYourPrivateKey

# Payment receiver address (must be NEXT_PUBLIC_ for middleware)
NEXT_PUBLIC_X402_PAYMENT_ADDRESS=0xYourPaymentAddress

# App configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_CHAIN_ID=84532

Deploy Smart Contract

  1. Open Remix IDE
  2. Upload contracts/URLStorage_x402.sol
  3. Compile with Solidity 0.8.24
  4. Deploy to Base Sepolia testnet
  5. Authorize your server wallet:
    setServerAuthorization(yourServerAddress, true)
    

Run Development Server

pnpm dev

Open http://localhost:3000

🎯 How It Works

Shorten URL (Paid)

  1. Connect your MetaMask wallet
  2. Enter a URL to shorten
  3. Approve $0.001 USDC payment
  4. Get your shortened URL instantly

Lookup URL (Free)

  1. Enter any short code
  2. Retrieve original URL from blockchain
  3. View creator and creation date

💰 Pricing

Feature Cost Network
Standard URL $0.001 USDC Base Sepolia
URL Lookup Free Base Sepolia

📚 Resources

🤝 Contributing

Contributions are welcome! This is a testnet project demonstrating x402 micropayment capabilities.

🙏 Acknowledgments

Built with x402 Protocol by Coinbase for seamless HTTP 402 payments.


Note: This is a testnet application. All transactions use test tokens with no real value.

All Base projects →