Skip to main content
Ralph is the smart contract programming language built specifically for Alephium. It is statically typed, compiled, and designed around the UTXO model, which makes it fundamentally different from Solidity and most EVM-compatible languages.

How Ralph differs from Solidity

Contracts and scripts

Ralph has two top-level constructs: Contracts hold state and can be called repeatedly. They live at a fixed address on-chain and persist between transactions. TxScripts are one-shot transaction scripts. They execute once as part of a transaction and have no persistent address. Use them to interact with contracts, transfer assets, call functions, deploy new contracts.

Mutable and immutable fields

Every contract declares its fields upfront. Fields are either mut (can change after deployment) or immutable (set once at deployment, cheaper to read):
Attempting to modify an immutable field is a compile error.

Asset permissions

Ralph uses annotations to declare when a function touches assets. This prevents accidental asset loss and makes auditing straightforward:

Events

Contracts emit events to log activity. Events are indexed by the explorer and queryable via the API:

Next steps

Deploying contracts

Deploy a Ralph contract via the Ralph Studio IDE

Interacting with contracts

Call functions on deployed contracts