C++ programs, in plain English
A C++ program is a smart contract that runs directly inside AppLayer. Here is what that really means.
An AppLayer C++ program is a smart contract written in C++.
It can remember data, receive calls, change state, and emit events. But instead of running as EVM bytecode, it runs as compiled machine code inside AppLayer.
Think of it like this:
- EVM code follows a list of tiny instructions.
- A C++ program takes a more direct route.
Why use one?
Use familiar EVM code when familiar tools and standards are the main need.
Use a C++ program when a job needs richer state, tighter control over data, or a more capable execution path.
The two can work together. Builders do not have to move the whole app to C++ just to use a C++ program for one important job.
Four rules keep the result safe
1. Same result on every validator
Every validator must get the same result when it runs the same transaction from the same starting state.
2. Clear data ownership
Each program clearly says what data it saves and owns.
3. No half-finished changes
If a transaction fails, half of its changes cannot remain. AppLayer rolls the job back.
4. Controlled upgrades
Everyone should be able to see who may upgrade a program and how.
Direct does not mean hidden
C++ programs keep familiar contract addresses and interfaces. Apps can still call them with familiar Web3 tools.
The code path is different. The goal is the same: clear rules, checked results, and one shared history.
Read the official C++ contract guide or see how AppLayer contracts work.