M402 Bring Private AI Agent Payments come Midnight
Hack Buenos Aires project M402 add one privacy layer to x402 payments, make AI agents fit access paid API services without to expose who pay am publicly. The team show the process for Midnight test infrastructure with selective disclosure and relayed payments go Base.
By SongMarketCap
M402, one of the projects wey present among the Midnight hackathon winners for Buenos Aires, don demonstrate one system for private AI agent payments. The project keep the core x402 model for paid API access but add payer privacy through Midnight.
During the demo, one AI agent find one weather API, check available funds and start payment without any manual transaction handling. The current implementation still dey for test environment.
M402 Add Privacy to x402 Payments
x402 dey use the HTTP 402 Payment Required response to help applications and AI agents identify paid digital resources, complete payment and continue to access the requested service.
M402 keep that same workflow but change how dem take represent the payer during the transaction.
API providers still dey publish the service wey dem offer and the price. Privacy apply to the user or agent wey dey make the payment.
The project still carry Midnight’s selective disclosure capabilities join. Payment information fit remain private during normal use, but specific transaction details fit show later when dem need am for things like accounting or tax reporting.
NIGHT Turn Shielded Credit for API Access
One technical challenge wey the team address be say NIGHT na unshielded asset.
M402 dey use one vault where users go deposit
NIGHT and receive one internal shielded credit wey dem call mNIGHT. That credit fit then dey used inside the platform to pay for supported x402 services.
When one agent request a paid resource, the payment flow go provide proof say the required value don enter without to expose the same payer information wey for show for normal unshielded transaction.
The team describe two service models. One cover APIs wey dem build natively for Midnight. The second use one relayer to connect Midnight based agents with existing x402 services wey dey run for other networks.
For the demonstration, dem charge the agent through the Midnight side while the relayer pay the external service using test USDC on Base Sepolia.
CLI Demo Automate the Payment Flow
M402 still get one web interface to list API services and one command line tool wey dem design for AI agents.
During the live demonstration, dem instruct the agent to find one service wey dey provide weather information for Buenos Aires and pay for access if dem require am.
The CLI identify available services, synchronize the wallet, check the balance, determine the API price and proceed through the payment flow. The tool dey designed to hide Midnight wallet management and payment execution behind commands wey software agents fit call directly.
The project source code dey publicly available as part of the hackathon work. The team talk say the relayer still need public deployment and preparation for higher traffic before broader use.
Cardano L1 no be part of the payment path wey dem demonstrate for M402. The current architecture combine Midnight privacy infrastructure, x402 API payments and one relayer go Base Sepolia. The working testnet prototype don already cover private payer execution, selective disclosure and autonomous API payments, while mainnet deployment and production ready relayer still dey pending.