Created on 5th June 2025
•
1Shot API is an onchain automation platform that turns smart contracts into smart tools. Specifically, 1Shot API lets you read and and write to any EVM network from your AI automation workflow built in n8n, IFTTT, and Make or any application without the need to import signers, contract ABIs, or manually monitor for transaction state.
In this submission, we've created an open-source implementation of an n8n community node which could serve as an example for other projects wishing to build crypto-focused n8n community nodes. The node brings all of 1Shot API's functionality into the n8n workflow context, including reading from and writing to smart contracts functions, managing 1Shot API wallets, querying transaction history and triggering on webhook callbacks.
Importantly, we've created a production-ready x402 gateway workflow that allows creators to permissionlessly monetize any workflow that they can build in n8n. The user needs to simply install the 1Shot API node into their n8n instance, then import the x402 workflow json into a project and authenticate against their 1Shot API account; 1Shot API functions as the facilitator role. A full walkthrough is covered in the YouTube tutorial.
We think one of the most powerful features of our n8n x402 gateway is that it can easily be combined with our 1Shot Prompts feature. 1Shot API users can write prompts for specific smart contracts at the level of the contract, contract function, inputs and outputs. The contract can then be exposed to an agent framework as a set of MCP tools than can be constructed on the fly. This means that appropriate smart contracts can be searched for and imported into the toolset based on the task the agent is trying to perform, keeping the reasoning context as small as possible to enable the best chance that the agent will invoke the correct onchain function, be it read or write.
Overall, the x402 scheme was straightforward to implement. One aspect that I ran into earlier on was related to the payment verification step. The signed user payload that is passed to the x402 endpoint doesn't explicitly state the contract address of the payment token it was supplied for. Therefor, if the x402 gateway accepts more than one payment token, you would likely have to guess the asset and attempt a verification then iterate through all possible assets until you found the correct one. This is not a problem if the gateway accepts only a single payment asset per chain.
Tracks Applied (1)
Technologies used