Docs · Deploy
Deploy
Put a compiled model onchain from the site or from your code.
Deploying a model sends one transaction per blob of weights (24,544 bytes each) and one to register it with its metadata. The model id is known before you sign: it only depends on the weights.
From the site
Open Deploy, drop your .onnx (compiled in the page) or a .wired.json, connect a wallet on Robinhood Chain and sign.
From code
POST /deploy prepares the transactions; you sign them with your own key or wallet. The API never sees a key.
curl -X POST https://www.usewired.net/api/v1/deploy \
-H "content-type: application/json" \
-d '{"from": "0xYourAddress", "name": "Cats vs dogs", "model": …}'model is a .wired.json, or the whole answer of /compile. You can also send description.
{
"id": "0x018d404e…e3d1",
"registered": false,
"transactions": [
{ "step": "weights 1/1", "chainId": 4663, "from": "0x…", "nonce": 83, "to": null, "value": "0x0", "data": "0x…", "creates": "0x3fEE…a7A5" },
{ "step": "register", "chainId": 4663, "from": "0x…", "nonce": 84, "to": "0x320D078b873912cf8dDe00f750fd16240C457ca7", "value": "0x0", "data": "0x…" }
]
}Before answering, the API simulates the registration onchain with your blobs in place, so a model the registry would refuse fails here, not after you paid for the blobs.
- Send the transactions in order, from
from, with these nonces.to: nullcreates a contract. - The blob addresses follow from your nonce. If you send anything else from that address first, ask again.
- If these exact weights are already registered,
registeredistrue,transactionsis empty andmodeldescribes the existing one.
A complete script with viem:
import { readFile } from "node:fs/promises";
import { createPublicClient, createWalletClient, defineChain, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const robinhood = defineChain({
id: 4663,
name: "Robinhood Chain",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: { default: { http: ["https://rpc.mainnet.chain.robinhood.com"] } },
});
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const wallet = createWalletClient({ account, chain: robinhood, transport: http() });
const chain = createPublicClient({ chain: robinhood, transport: http() });
const compiled = JSON.parse(await readFile("compiled.json", "utf8"));
const plan = await fetch("https://www.usewired.net/api/v1/deploy", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ from: account.address, name: "Cats vs dogs", model: compiled }),
}).then((r) => r.json());
for (const tx of plan.transactions) {
const hash = await wallet.sendTransaction({ to: tx.to ?? undefined, data: tx.data, nonce: tx.nonce });
await chain.waitForTransactionReceipt({ hash });
}
console.log("model", plan.id);Keep the key in your environment, never in the code.
Metadata
The registry's uri field holds a data URI with JSON: no server, no IPFS.
{ "v": 1, "description": "…", "labels": ["cat", "dog"], "input": { "shape": [28, 28], "scale": 0.0078 }, "metrics": { "int8Accuracy": 0.97 } }The owner can update the name and the metadata with update(id, name, uri). The weights never change.
Cost
At 0.02 gwei, the digits model (7 KB of weights) deployed for about 0.00004 ETH. Robinhood Chain charges no L1 data fee today.