---
title: "1. Scrypto Fundamentals"
path: "/developers/scrypto/01-fundamentals"
version: "1.2.0"
author: "Hydrate"
createdAt: "2026-02-22T17:46:02.323Z"
updatedAt: "2026-03-16T18:26:09.830Z"
---

# 1. Scrypto Fundamentals

<Infobox>
| **[Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto) Fundamentals** |
| Difficulty | Beginner |
| Est. Time | 20 minutes |
| Prerequisites | [Your First Blueprint](/developers/getting-started/02-first-blueprint) |
| Language | [Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto) (Rust) |
| Official Docs | [Scrypto Overview](https://docs.radixdlt.com/docs/scrypto-overview) |
</Infobox>

## [Asset-Oriented](/developers/legacy-docs/essentials/asset-oriented) Programming

[Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto) is built on [asset-oriented programming](/contents/tech/core-concepts/asset-oriented-programming) — a paradigm where digital assets are first-class primitives managed by the [Radix Engine](/contents/tech/core-concepts/radix-engine), not arbitrary integers in a smart contract's storage.

In [Solidity](https://soliditylang.org), a token is a mapping of addresses to balances inside a contract. Transferring tokens means calling a function that modifies that mapping. Bugs in this logic cause real losses — reentrancy, integer overflow, and unauthorized access.

In [Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto), tokens are **resources** — objects with physical-like properties enforced by the engine. They cannot be duplicated, destroyed without authorization, or exist outside a container. The runtime guarantees that every resource is accounted for at the end of every transaction.

## [Blueprints](https://docs.radixdlt.com/docs/blueprints-and-components), Components, and Packages

[Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto)'s object model has three levels:

| Concept | Analogy | Description |
| --- | --- | --- |
| **Package** | Library / crate | Deployment unit containing one or more blueprints. Deployed once, referenced by address. |
| **Blueprint** | Class / template | Defines state shape and methods. Contains no state itself — it's a template. |
| **Component** | Instance / object | A live instantiation of a blueprint. Holds state, owns resources in [vaults](https://docs.radixdlt.com/docs/resources-and-data). |

A single blueprint can be instantiated many times — each component is independent with its own state and resource holdings.

### Code Structure

```rust
use scrypto::prelude::*;

#[blueprint]
mod my_blueprint {
    struct MyBlueprint {
        // State fields — persisted between transactions
        my_vault: Vault,
        count: u64,
    }

    impl MyBlueprint {
        // Functions: called on the blueprint (no &self)
        // Used for instantiation
        pub fn instantiate() -> Global<MyBlueprint> {
            Self { /* ... */ }
                .instantiate()
                .prepare_to_globalize(OwnerRole::None)
                .globalize()
        }

        // Methods: called on a component (&self or &mut self)
        pub fn get_count(&self) -> u64 {
            self.count
        }

        pub fn increment(&mut self) {
            self.count += 1;
        }
    }
}
```
The `#[blueprint]` macro handles serialization, state management, and ABI generation. You write plain Rust structs and methods.

## How [Radix Engine](/developers/legacy-docs/reference/radix-engine/radix-engine) Differs from EVM

| Aspect | EVM ([Solidity](https://soliditylang.org)) | [Radix Engine](/developers/legacy-docs/reference/radix-engine/radix-engine) ([Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto)) |
| --- | --- | --- |
| Assets | Contract storage mappings | First-class resources with engine-enforced rules |
| Transfer | Call a function that mutates state | Move a bucket between [vaults](https://docs.radixdlt.com/docs/resources-and-data) |
| Authorization | `msg.sender` checks | Badge-based [access rules](/developers/scrypto/03-authorization-and-badges) |
| Reentrancy | Must be guarded manually | Impossible — resources move, not references |
| Composability | External calls with ABI encoding | Native cross-component calls via [transaction manifests](/developers/transactions/01-manifest-language) |
| Scaling | Single global state | Shard-aware via [Cerberus](/contents/tech/core-concepts/cerberus-consensus) |

## Key Takeaways

- **Resources are real** — they behave like physical objects, not database entries
- **[Blueprints](https://docs.radixdlt.com/docs/blueprints-and-components) are templates** — they define behavior but hold no state
- **Components are instances** — each with independent state and resource [vaults](https://docs.radixdlt.com/docs/resources-and-data)
- **The engine enforces safety** — reentrancy, double-spend, and overflow bugs are prevented at the runtime level

## External Links

- [Scrypto Overview](https://docs.radixdlt.com/docs/scrypto-overview)
- [Asset-Oriented Programming](/contents/tech/core-concepts/asset-oriented-programming)
- [What is Radix Engine?](https://learn.radixdlt.com/article/what-is-radix-engine)
- [Components, Blueprints, and the Blueprint Catalog](https://learn.radixdlt.com/article/what-are-components-blueprints-and-the-blueprint-catalog)