Looop
Serverless Metered Functions
A looop is a small program (a script, a tool, skill calls, code, in a full sandboxed workflow) published once to the network and callable from anywhere. Invoking it is the stacknet equivalent of calling a serverless function, except instead of a cloud provider’s fleet, the executor is elected from the network’s own nodes. Attribution, billing, and cryptographic proof of execution are built into the same call.
Quick start
# 1. Quote
curl $NODE/api/looops/$LOOOP_ID/quote
# 2. Invoke
curl -X POST $NODE/api/looops/$LOOOP_ID/invoke \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{ "input": { "message": "hello" } }'
# 3. Multi-agent
curl -X POST "$NODE/api/looops/$LOOOP_ID/invoke?replication=3" \
-H "Authorization: Bearer $API_KEY" \
-d '{ "input": { "message": "hello" } }'Use Cases
- Pricing Oracles
- Trustless API
- Agentic Function Calling
- Media processing
- Document editing
- RAG Querying
- Scheduled batch jobs & Routines
- Chatbots
- Data processing
- Trading bot with custom execution
Publishing a looop
A looop is published to a Rack repo under looop/<name> with a manifest (the contract) and vein bytes (the LODE-compiled program).
The manifest declares what the looop needs to run:
{
"name": "echo",
"requires": {
"runtimes": ["node"], // subset of node | python | shell | rust
"caps": ["chat_completion"], // subset of KNOWN_CAPABILITIES
"min_memory_mb": 256,
"needs_gpu": false,
"needs_tee": false
},
"runtime": { "entrypoint": "echo.js", "timeout_seconds": 30 },
"inputs": { "message": { "type": "string", "required": true } }
}Publish-time validation rejects anything out of scope, unknown runtime, unknown capability string, negative memory, malformed types. The looop is then addressable via a network-assigned UUID (looop_id) that is collision-free across creators and stable across renames.
What’s not a looop
- Stateful workloads. Serverless means stateless, a process that needs to hold a connection between invocations stays on the today’s non-looop path.
- Very-long-running jobs. The sandbox timeout is per-invoke. Long training runs aren’t looops; they’re rack jobs.