RC
0/21
AUDIO READY — click anywhere to start
SECTION_13

Under the Hood

Understand what Caffeine actually builds — Motoko, actors, and on-chain magic.

[You Don't Need to Write Code]

Caffeine writes all the Motoko for you. This section exists so you understand what it writes — because that understanding makes your prompts dramatically more precise and your apps significantly more reliable.

> What is Motoko?

OriginCreated by DFINITY Foundation, designed specifically for the Internet Computer — not adapted from an existing language.
CompilationCompiles to WebAssembly and runs natively on ICP canisters. No virtual machine layer, no container runtime.
ModelActor-based — every canister IS an actor. Each canister holds its own state and communicates via async messages.
SyntaxFamiliar to anyone who has used JavaScript, TypeScript, Swift, or ML. Designed to be readable without deep CS background.

[Why This Matters for Prompting]

Caffeine writes Motoko so you don't have to — but understanding what it writes helps you prompt smarter. When you know the language is actor-based and uses stable variables, you can write prompts that explicitly request the right patterns.

> The Actor Model — Every Canister is an Actor

Isolated State

An actor holds its own state. No shared memory with other canisters — this is a security and reliability guarantee, not a limitation.

Async Messages

Actors communicate by sending messages. All public Motoko functions are async by default, which is why ICP apps are non-blocking.

1:1 Mapping

One Motoko actor = one ICP canister. When Caffeine deploys your app, it becomes a live actor on the network with a unique canister ID.

No Race Conditions

Because actors process one message at a time, you get sequential execution without locks. Concurrent safety is built in.

[Mental Model]

Think of a canister like a self-contained server that never shares memory with anything else. It has its own CPU quota, its own storage, and its own inbox. Every call to it is a message that gets processed and answered.

> Orthogonal Persistence — stable var Magic

01

Traditional programming

To persist data across server restarts, you need a database, an ORM, migration scripts, and backup strategies. Upgrades are risky — data can be lost.

02

Motoko with stable var

Add the stable keyword to a variable. That's it. Data survives every upgrade automatically — no database, no ORM, no migration scripts.

03

Enhanced orthogonal persistence

Since compiler v0.15.0, enhanced orthogonal persistence is the default. It's faster than the original implementation and scales beyond 4 GB of state.

stable var — the difference
// Without stable — data LOST on canister upgrade
var counter : Nat = 0;

// With stable — data survives upgrades FOREVER
stable var counter : Nat = 0;

[Prompt Tip — Stable Variables]

When prompting Caffeine, explicitly say: "store all important data in stable variables so it survives upgrades". Caffeine will apply the correct pattern. This one line can protect your users' data for the lifetime of the app.

> Why Motoko + Caffeine = The Right Stack

"First Programming Language for AI"

Dominic Williams (DFINITY founder) describes Motoko as the first programming language designed for AI authorship. This isn't just marketing — Motoko's design means AI can write substantially less complex code to achieve the same results compared to Rust or Solidity. Fewer lines of code means fewer bugs and lower AI error rates.

PropertyTraditional CloudICP + Motoko
Data on upgradeRequires migration scriptsAutomatically preserved
InfrastructureRented cloud serversDecentralized ICP network
Code languageMany options, mixed AI qualityMotoko — optimized for AI authorship
Uptime guaranteeSLA-based (99.9%)Protocol-level — no single point of failure
Data ownershipCloud vendor controls infraYou own the canister — fully sovereign

[Sovereignty Guarantee]

Your app runs on the Internet Computer — not AWS, not GCP, not Azure. No cloud vendor can take it down, throttle it, or change the terms. The network enforces uptime at the protocol level. This is what "fully on-chain" actually means.

> OpenChat — Proof It Works at Scale

OpenChat is a fully functioning messaging app — think WhatsApp — running 100% on the Internet Computer with no servers, no cloud provider, and no company that can shut it down. Real users. Real messages. Zero traditional infrastructure.

It's governed by a DAO (Service Nervous System / SNS): tens of thousands of token holders vote on every code update before it goes live. No CEO can unilaterally change the product. The community owns and controls the protocol.

This is what Motoko + ICP makes possible — production apps, real users, on-chain governance. The same stack Caffeine uses to build your apps.

> VISIT OPENCHAT — oc.app

> A Full Motoko Canister — Annotated

This is a real, deployable Motoko canister. Every line is annotated so you can see exactly what Caffeine produces when you build an app.

counter.mo — a real ICP canister
// A simple on-chain counter — deployed on the Internet Computer
actor Counter {

  // stable = this value survives every upgrade automatically
  stable var count : Nat = 0;

  // update call — modifies state, costs a tiny cycle fee
  public shared func increment() : async Nat {
    count += 1;
    return count;
  };

  // query call — read-only, completely free and fast
  public query func getCount() : async Nat {
    return count;
  };

  // reset — only possible via update call (writes to state)
  public shared func reset() : async () {
    count := 0;
  };

};
actor

Declares a canister. Everything inside is isolated, self-contained state and logic.

stable var

Marks the variable as persistent. Survives every upgrade — no database needed.

public shared func

An update call. Can write to state. Costs a tiny cycle fee. Returns async.

public query func

A read-only call. Cannot modify state. Completely free and fast — no cycles consumed.

> What This Means for You as a Caffeine Builder

[Use Stable Variables Explicitly]

You never write Motoko — Caffeine does. But knowing what stable var means lets you prompt: "store all user data in stable variables so it survives upgrades". Caffeine will apply exactly the right pattern, and your users' data will never be lost during a version update.

[Query Calls are Free — Ask for Them]

Query calls are read-only and cost zero cycles. Update calls write to state and cost a small fee. If you want something fast and free (like loading a list, fetching a profile, or displaying stats), ask Caffeine explicitly: "use a query function for this read operation". Your app will be faster and more efficient.

[Go Deeper with ICP Skills]

For deeper Motoko reading and official ICP development standards, visit skills.internetcomputer.org. Use the JSON option for each skill (as covered in Section 2) to give Caffeine precise, targeted context for any Motoko pattern.

> The Three Things to Remember

  1. Every Caffeine app is a Motoko actor — isolated, self-contained, and sovereign on the ICP network.
  2. stable var is the key to data safety — always ask Caffeine to use it for any data that matters.
  3. Query functions are free and fast — reserve update calls for writes that need to change state.

> Version History — Every Build Is Tracked

Since Caffeine V3, every draft build is automatically versioned. You can revert to any earlier version of your app — no Git, no manual backups. This is especially useful when a prompt steers your app in an unwanted direction.

How It Works

Every build creates a new version entry in the Caffeine dashboard. Click an earlier version to load it as your current draft. The current version is not deleted — you can always switch back to the latest.

[When to Use It]

When a prompt breaks your app or introduces unwanted changes, revert to the last working version instead of burning correction prompts. This saves credits and frustration.

> Build Credit Hold — Reserved Before Building

Since April 16, 2026 Caffeine reserves build credits upfront. If the build fails, the credits are released immediately. This prevents you from paying for failed or aborted builds.

What This Means for You

You see the credit reservation in the dashboard before the build starts. On success it's consumed. On failure or if you cancel, it's immediately reset. No more lost credits from timeout errors or aborted builds.

> Introductory Pricing — New Users Only

Since April 29, 2026 introductory pricing (e.g. $2 instead of $5 for the first month of Host) applies only to new users. Existing users switching plans or starting new projects pay the regular price.

Important to Know

When you create your first Caffeine account, make the most of the introductory price — start with the Host plan right away to test the full feature set. The price rises to the regular rate after the first month.

[Pricing Transparency]

All current prices are in Section 9 (Credits & Costs) of this guide. The numbers there are updated whenever pricing changes.

> Want to Go Deeper?

The ICP Developer Liftoff is a free, self-paced video series on docs.internetcomputer.org that takes you from zero to building full dApps on the Internet Computer. It's organized into 5 levels — from "What is a blockchain?" all the way to deploying multi-canister apps and integrating tokens. If Rosetta Caffeine gave you the spark, Liftoff is the full training program.

Level 0Pre-flight checklist — ICP fundamentals
Level 1Lift off — First canister, Motoko basics
Level 2Orbit — Frontend integration, tokens
Level 3Spaceship — Advanced Motoko, timers, upgrades
Level 4Galactic explorer — SNS governance, multi-canister
> OPEN ICP DEVELOPER LIFTOFF →

> Hosted MCP Connector — Drive Caffeine From Any AI Assistant

Since June 16, 2026 (alpha), Caffeine operates a hosted MCP server at https://mcp.caffeine.ai/mcp. You talk to Caffeine directly from your preferred AI tool — no need to switch to a separate browser window.

SUPPORTED ASSISTANTS

  • ChatGPT
  • Claude
  • Cursor
  • VS Code with GitHub Copilot
  • OpenAI Codex
  • Perplexity

CAPABILITIES

  • List projects
  • Start or resume build sessions
  • Retrieve transcripts
  • Generate project URLs

[Auth & Security]

Authentication uses OAuth and is handled entirely by each connected AI tool. The MCP server forwards requests to the Caffeine infrastructure — it executes no code on your machine. Desktop environments like Claude Code or Cursor additionally receive step-by-step CLI instructions, so you can drive Caffeine from the terminal too.

> Direct Anthropic Claude Integration — Build Apps Without Leaving Claude

Since June 30, 2026, a direct integration with Anthropic Claude enables production-ready app generation from natural language prompts — without leaving the Claude environment. You describe what you want to build; Claude orchestrates the build through the Caffeine infrastructure and returns a deploy-ready result.

WHAT THIS CHANGES

  • No more context switching between the prompt window and the build dashboard — everything happens in Claude.
  • Production-ready app generation straight from the chat history.
  • The same Caffeine infrastructure (Motoko backend, React frontend, on-chain deployment) works in the background.

> Looking Ahead — Cloud Engines, Open SaaS, and ICP as the AI-Centric Stack

Dominic Williams has signaled an upcoming suite of Cloud Engines and an "Open SaaS" suite built using ICP's "AIware" technology for enterprises putting AI at the center of operations. The idea: ICP becomes the new stack for organizations that treat AI not as an add-on but as the core of their architecture.

DOMINIC WILLIAMS

"For enterprises that want to put AI at their heart, ICP will be the new stack they seek."

Cloud Engines

Upcoming ICP-based compute engines that run AI workloads natively on the decentralized network.

Open SaaS

A suite of SaaS applications built on ICP's AIware technology, giving enterprises an open, sovereign alternative to closed cloud SaaS offerings.

AIware

ICP's term for software designed from the ground up for AI-driven generation, maintenance, and evolution.

[Why This Matters for You]

Caffeine is today's tool for building apps from words. Cloud Engines and Open SaaS are the next layer: the same ICP architecture that powers your Caffeine apps becomes the foundation for AI-centric enterprise software. Builders who use Caffeine on ICP today are learning exactly the stack that is poised to become the standard for enterprises tomorrow.