← 🧮 Cryptography & Distributed Systems

🧮 Stack Machine: How Smart Contracts Execute

PC: 0
Opcode:
Drag — rotate · Scroll — zoom

🧮 Stack Machine: How Smart Contracts Execute

The simulation runs a small fixed bytecode program on a visualized stack-based virtual machine, showing PUSH, ADD, MUL and SSTORE opcodes manipulating a 3D stack of value-cubes and writing results into a persistent storage grid.

🔬 What It Demonstrates

The simulation runs a small fixed bytecode program on a visualized stack-based virtual machine, showing PUSH, ADD, MUL and SSTORE opcodes manipulating a 3D stack of value-cubes and writing results into a persistent storage grid.

🎮 How to Use

Watch the program counter and current opcode readout as instructions execute automatically, or pause and step through manually with the play/pause button; use rebuild to restart the program from the first instruction and adjust the speed slider to slow down or speed up execution.

💡 Did You Know?

Every opcode in a real stack-based VM like the EVM has a fixed gas cost, so a node can precisely predict the worst-case computational cost of a transaction before executing a single instruction.