Introduction
Asset-Oriented Programming is the foundational programming paradigm of the Radix platform, in which digital assets — tokens, NFTs, badges — are treated as native, first-class primitives governed by the execution environment rather than by application code. Unlike the Ethereum account model where a token is merely a number in a mapping inside a smart contract (balances[address] = 100), on Radix resources are physical-like objects that can never be copied, accidentally destroyed, or lost.
This design is enforced by the Radix Engine's finite state machine constraint model. When a Scrypto component method accepts a Bucket of tokens, ownership of those tokens physically transfers to the component at the engine level — not by updating a balance entry, but by moving a container.
How It Differs from Ethereum
On Ethereum, transferring ERC-20 tokens involves calling the token contract's transfer function, which decrements the sender's balance and increments the receiver's. This creates several vulnerability classes:
- Reentrancy attacks — an external call can re-enter the contract before state updates complete (the cause of the 2016 DAO hack)
- Approval exploits — the
approve/transferFrompattern introduces a second attack surface - Accidental token loss — tokens sent to a contract with no withdrawal function are permanently locked
Asset-Oriented Programming eliminates these by design. Reentrancy is impossible because resources physically move rather than balances being updated. There is no approval pattern — you pass a Bucket directly. And the Radix Engine enforces that every Bucket must be deposited into a Vault by the end of a transaction, or the transaction fails.
Resources as Platform Primitives
Resources on Radix are created via built-in system calls with configurable behaviours: mintable, burnable, divisibility, metadata, and more. The platform enforces conservation — if 100 tokens enter a transaction, exactly 100 must leave it (unless authorised minting or burning occurs). This guarantee is provided at the engine level, not by application code, meaning that bugs in Scrypto components cannot violate resource conservation.
Because resources are native types, the Radix Wallet can display and manage any token or NFT without requiring per-token integration — unlike Ethereum wallets which must manually add each ERC-20 contract address.
External Links
- Scrypto: An Asset-Oriented Smart Contract Language — Radix Blog
- Resources — Radix Documentation
- radixdlt-scrypto — GitHub Repository
Connect your wallet to join the discussion.
