Write a smart contract. Run it. Actually understand it.
35 lessons across contracts, deployment and the AI network.
19 of them are exercises where your code executes in the real Animica VM —
the same vm_py engine that runs contracts on-chain. Not a simulator, not a sandboxed
guess at the semantics.
Nothing here is aspirational. Every command was run against the installed CLI
before it was written down, every code sample was executed, and the AI-network numbers are
measurements taken on 2026-08-20 rather than targets. Where something is slow or unfinished,
the lesson says so.
⛓
Smart contract fundamentals
6 lessons
Storage, reverts, callers, events, mappings. Six runnable exercises — your code executes in the real Animica VM, not a simulator.
A contract is a Python module whose functions the chain can call. State lives in storage — and storage holds bytes, nothing else.
≈ 8 min
runnable exercise
Storage holds bytes, but contracts count things. The conversion pattern below is used by every Animica contract, including the token standard.
≈ 10 min
runnable exercise
A contract that accepts bad input corrupts its own state forever. abi.require is how you refuse.
≈ 8 min
runnable exercise
Without knowing the caller, every function is public to everyone. This is how access control works.
≈ 10 min
runnable exercise
Storage is what your contract knows. Events are what it announces. Indexers, wallets and explorers read events, not storage.
≈ 8 min
runnable exercise
There is no dict in storage. You build one by composing keys — and the prefix you choose is a security boundary.
≈ 9 min
runnable exercise
🚀
Compile, deploy, call
5 lessons
Manifests and ABIs, the compile step, getting on-chain, and the one misunderstanding that costs people real money.
One pip package ships the wallet, the node runner, the contract tooling and the miner.
≈ 5 min
walkthrough
Your .py file is the code. The manifest declares what the outside world may call, and with what types.
≈ 9 min
walkthrough
Turn source into an artifact with a code hash. This is also your first real correctness check.
≈ 6 min
walkthrough
Put the artifact on-chain, then read from it for free and write to it with a transaction.
≈ 12 min
walkthrough
The single most expensive misunderstanding in blockchain integration work — and it is not specific to Animica.
≈ 7 min
walkthrough
🧠
The AI network
5 lessons
Free keyless inference, prompting small models well, streaming, and what a contract can and cannot ask a model to do.
An OpenAI-compatible endpoint with no API key. What it is, what it costs, and why the first call is slow.
≈ 7 min
walkthrough
Techniques that matter more, not less, when the model is small and the latency is high.
≈ 10 min
walkthrough
Twenty seconds of blank screen feels broken. The same twenty seconds with tokens arriving feels fast.
≈ 9 min
walkthrough
A contract may commission inference but never receive the answer in the same breath. Understanding why explains most of the AICF design.
≈ 8 min
walkthrough
Discovery, price comparison and payment — the loop that makes an autonomous agent more than a chatbot.
≈ 12 min
walkthrough
🪙
Build a token, step by step
4 lessons
Balances, allowances, supply caps and safe ownership transfer. Four exercises that add up to the working core of a real token.
Mint, read a balance, move value between accounts. This is the core every fungible token shares.
≈ 14 min
runnable exercise
Letting a third party spend on your behalf — the mechanism every exchange and marketplace depends on, and its famous footgun.
≈ 14 min
runnable exercise
A maximum supply is a promise. Enforce it in code, because that is the only place anyone can verify it.
≈ 11 min
runnable exercise
One-step ownership transfer means one typo loses the contract forever. Two steps make the mistake recoverable.
≈ 10 min
runnable exercise
🧰
Build real things
4 lessons
Escrow, multisig, a name registry and on-chain voting — four exercises that mirror contracts shipped in the Animica repo.
A buyer, a seller, and a contract that will only ever do one of two things with the money.
≈ 15 min
runnable exercise
No single key can act alone. The pattern behind every treasury that has not been drained by one compromised laptop.
≈ 16 min
runnable exercise
First come, first served — and the transfer rules that decide whether a name is really yours.
≈ 12 min
runnable exercise
Proposals, a deadline, one vote per address, and a result nobody can quietly change afterwards.
≈ 14 min
runnable exercise
⛓️
Working with the chain
3 lessons
Reading state over free RPC, what bech32m and post-quantum signatures mean in practice, and the real timings of a transaction.
Two free, no-auth ways to ask the network what is true — and the small mistakes that make each one fail.
≈ 11 min
walkthrough
Why Animica addresses look the way they do, and why the signature scheme is unusual — and larger than you expect.
≈ 12 min
walkthrough
The full lifecycle with real timings, measured by paying out this academy's own lesson rewards.
≈ 13 min
walkthrough
🔐
Patterns worth knowing
3 lessons
Hashing, commit-reveal for a secret ballot on a public chain, and vesting arithmetic that does not strand dust.
A one-way fingerprint of any data. The building block for commitments, ids and integrity checks — with one important footgun on this chain.
≈ 10 min
runnable exercise
Everything in storage is public forever. This is how you run a secret ballot anyway.
≈ 16 min
runnable exercise
A cliff, then a straight line. The arithmetic that governs most team and investor allocations.
≈ 14 min
runnable exercise
🛡
Security and composition
5 lessons
The authorization bug that drains vaults, reentrancy, commissioning off-chain inference, determinism, and testing before you deploy.
Two functions that look interchangeable. Using the wrong one hands your contract to anyone who can get you to click something.
≈ 12 min
runnable exercise
A contract cannot receive a model's answer — but it can commission one deterministically. Including what that primitive does and does not do today.
≈ 11 min
runnable exercise
The moment your contract calls another one, it can be re-entered before it finishes. Order your writes accordingly.
≈ 13 min
walkthrough
Every restriction in the contract VM traces back to one requirement: every node must compute the identical result, forever.
≈ 10 min
walkthrough
Deployed code is permanent and public. Everything you can find locally costs nothing to fix.
≈ 11 min
walkthrough