Skip to main content
Time to read: 1 min

Understanding Gas and Transactions

This module explains how transactions flow through the network, what gas is, and how the Ethereum Virtual Machine (EVM) executes smart contracts.

Gas, Transactions, and Blocks

Every transaction must pay gas to compensate miners/validators.
For EVM chains like Rootstock, gas is paid in rBTC.

A transaction flows through three steps:

  1. Submitted to the network
  2. Picked up by miners
  3. Included in a block

Transaction Components

FieldDescription
fromSender address
toRecipient address (or contract)
valueAmount of rBTC to send
dataContract call data (if applicable)
gasLimitMaximum gas units to spend
gasPricePrice per gas unit

Gas Calculation

Transaction Cost = Gas Used × Gas Price

If a transaction runs out of gas, it reverts but you still pay for the gas consumed.

EVM Overview

The Ethereum Virtual Machine (EVM) is a runtime environment for executing smart contracts.

Key concepts:

  • Bytecode execution — Contracts compile to bytecode
  • Storage, memory, stack — Different data locations
  • Opcodes — Low-level instructions
  • Contract ABI — Application Binary Interface for function calls

Rootstock is fully EVM-compatible, so Ethereum tools work with minimal or zero modification.

Bitcoin vs EVM Smart Contracts

Rootstock merges Bitcoin's security guarantees with Ethereum-compatible smart contracts.

FeatureBitcoinEVM-Compatible Chains
Smart ContractsLimited (Bitcoin Script)Full Solidity support
Token StandardNoneERC-20, ERC-721, etc.
VMBitcoin ScriptEVM
StrengthSecurity, finalityProgrammability

Rootstock sits at the intersection: Bitcoin-backed security + EVM programmability.

Summary

Before moving forward, ensure you understand:

  • How blockchains maintain shared state
  • How keys, wallets, and addresses work
  • What gas is and why it's required
  • How the EVM executes smart contracts

Next: Rootstock Architecture

Last updated on by Akanimorex