x402 protocol on TRON

Test x402 payments end-to-end on TRON.

The simplest possible agent. Send a message with an x402 micropayment, get it echoed back with full payment diagnostics.

Total Echoes
Uptime
Status

Four steps to verify payments

The x402 protocol adds a payment layer to HTTP. Echo Agent lets you test the full flow without building anything.

01

Request

Send a POST to /echo with your message. No payment header yet.

02

402 Challenge

Server returns 402 Payment Required with accepted tokens and price.

03

Sign & Pay

Your client signs an EIP-712 permit and retries with the PAYMENT-SIGNATURE header.

04

Echo

Payment is settled on-chain via the facilitator. Your message is echoed back with diagnostics.


Endpoints

The API runs on port 8402. All endpoints below are relative to the API base URL.

Base URL   https://echo.m2mregistry.io:8402
GET / Health check, network info, accepted tokens Free
POST /echo Echo message back with payment diagnostics x402
GET /echo?message=hello Echo via query parameter x402
GET /metrics Request counts, error rates, uptime Free

Test in 30 seconds

Use the Python test client or generate a payment header for curl/Postman.

# Clone and install
git clone https://github.com/M2M-TRC8004-Registry/Echo_bot.git
cd Echo_bot
pip install -r requirements.txt

# Copy config and set your TRON wallet address
cp .env.example .env

# Start the server
bash run-nile.sh

# In another terminal — test with payment
python test_echo.py YOUR_PRIVATE_KEY