Modelo de Programación

AccountLoader (Anchor)

An Anchor account type that provides zero-copy access to large account data without deserializing the entire account upfront. AccountLoader wraps the raw account data and provides load() and load_mut() methods to access the data as a typed reference. It is used with #[account(zero_copy)] structs and is preferred over Account<T> when accounts exceed ~1KB, as it significantly reduces compute unit consumption.

IDaccount-loader

Lectura rápida

Empieza por la explicación más corta y útil antes de profundizar.

An Anchor account type that provides zero-copy access to large account data without deserializing the entire account upfront. AccountLoader wraps the raw account data and provides load() and load_mut() methods to access the data as a typed reference. It is used with #[account(zero_copy)] structs and is preferred over Account<T> when accounts exceed ~1KB, as it significantly reduces compute unit consumption.

Modelo mental

Usa primero la analogía corta para razonar mejor sobre el término cuando aparezca en código, docs o prompts.

Piensa en esto como una de las piezas centrales que tu programa lee, escribe o invoca durante la ejecución.

Contexto técnico

Ubica el término dentro de la capa de Solana en la que vive para razonar mejor sobre él.

Accounts, instrucciones, PDAs, transacciones y flujo de ejecución.

Por qué le importa a un builder

Convierte el término de vocabulario en algo operacional para producto e ingeniería.

Este término desbloquea conceptos adyacentes rápido, así que funciona mejor cuando lo tratas como un punto de conexión y no como una definición aislada.

Handoff para IA

Handoff para IA

Usa este bloque compacto cuando quieras dar contexto sólido a un agente o asistente sin volcar toda la página.

AccountLoader (Anchor) (account-loader)
Categoría: Modelo de Programación
Definición: An Anchor account type that provides zero-copy access to large account data without deserializing the entire account upfront. AccountLoader wraps the raw account data and provides load() and load_mut() methods to access the data as a typed reference. It is used with #[account(zero_copy)] structs and is preferred over Account<T> when accounts exceed ~1KB, as it significantly reduces compute unit consumption.
Relacionados: Zero-Copy Deserialization, Framework Anchor, Account Data
Glossary Copilot

Haz preguntas de Solana con contexto aterrizado sin salir del glosario.

Usa contexto del glosario, relaciones entre términos, modelos mentales y builder paths para recibir respuestas estructuradas en vez de output genérico.

Abrir workspace completa del Copilot
Explicar este código

Opcional: pega código Anchor, Solana o Rust para que el Copilot mapee primitivas de vuelta al glosario.

Haz una pregunta aterrizada en el glosario

Haz una pregunta aterrizada en el glosario

El Copilot responderá usando el término actual, conceptos relacionados, modelos mentales y el grafo alrededor del glosario.

Grafo conceptual

Ve el término como parte de una red, no como una definición aislada.

Estas ramas muestran qué conceptos toca este término directamente y qué existe una capa más allá de ellos.

Rama

Zero-Copy Deserialization

A technique for accessing on-chain account data directly from the underlying byte buffer without copying it into a new Rust struct, avoiding heap allocation and reducing compute unit usage. In Anchor, zero-copy is enabled via #[account(zero_copy)] on the account struct, which uses repr(C) layout and the AccountLoader type. Ideal for large accounts (>1KB) where Borsh deserialization would be expensive.

Rama

Framework Anchor

The most popular framework for building Solana programs in Rust. Anchor provides macros (#[program], #[account], #[derive(Accounts)]) that auto-generate boilerplate for account validation, serialization, discriminators, and error handling. It includes a CLI (anchor init/build/test/deploy), IDL generation, and TypeScript client generation. Reduces program code by ~80% compared to native development.

Rama

Account Data

The byte array stored in an account that holds program-specific state. Data is typically serialized using Borsh and must be explicitly allocated at account creation. The maximum data size is 10MB. Programs are responsible for defining and managing their own data layout, including discriminators for type identification.

Siguientes conceptos para explorar

Mantén la cadena de aprendizaje en movimiento en lugar de parar en una sola definición.

Estos son los siguientes conceptos que vale la pena abrir si quieres que este término tenga más sentido dentro de un workflow real de Solana.

Modelo de Programación

Zero-Copy Deserialization

A technique for accessing on-chain account data directly from the underlying byte buffer without copying it into a new Rust struct, avoiding heap allocation and reducing compute unit usage. In Anchor, zero-copy is enabled via #[account(zero_copy)] on the account struct, which uses repr(C) layout and the AccountLoader type. Ideal for large accounts (>1KB) where Borsh deserialization would be expensive.

Herramientas de Dev

Framework Anchor

The most popular framework for building Solana programs in Rust. Anchor provides macros (#[program], #[account], #[derive(Accounts)]) that auto-generate boilerplate for account validation, serialization, discriminators, and error handling. It includes a CLI (anchor init/build/test/deploy), IDL generation, and TypeScript client generation. Reduces program code by ~80% compared to native development.

Modelo de Programación

Account Data

The byte array stored in an account that holds program-specific state. Data is typically serialized using Borsh and must be explicitly allocated at account creation. The maximum data size is 10MB. Programs are responsible for defining and managing their own data layout, including discriminators for type identification.

Modelo de Programación

Address Lookup Table (ALT)

An on-chain account that stores up to 256 pubkeys, enabling v0 transactions to reference accounts by 1-byte index instead of full 32-byte pubkeys. ALTs dramatically reduce transaction size when interacting with many accounts (e.g., DEX routing). ALTs must be created and populated in advance; entries become active after a slot delay.

Comúnmente confundido con

Términos cercanos en vocabulario, acrónimo o vecindad conceptual.

Estas entradas son fáciles de mezclar cuando lees rápido, haces prompting a un LLM o estás entrando en una nueva capa de Solana.

Modelo de Programaciónloader

Loader

A built-in program responsible for deploying, loading, and executing on-chain programs by interpreting their binary encoding. Solana has multiple loaders: the original BPF Loader (deprecated, immutable programs), BPF Loader 2 (deprecated), and the current Upgradeable BPF Loader that supports program upgrades and manages the program/program-data account split.

Modelo de Programaciónaccount-data

Account Data

The byte array stored in an account that holds program-specific state. Data is typically serialized using Borsh and must be explicitly allocated at account creation. The maximum data size is 10MB. Programs are responsible for defining and managing their own data layout, including discriminators for type identification.

Modelo de Programaciónbpf-loader

BPF Loader

A built-in program that loads and executes SBF programs. Solana has multiple loader versions: the deprecated BPF Loader (immutable programs), BPF Loader 2 (deprecated), and the current Upgradeable BPF Loader (BPFLoaderUpgradeable) that supports program upgrades. The loader verifies bytecode, manages deployment, and sets the executable flag.

Términos relacionados

Sigue los conceptos que realmente le dan contexto a este término.

Las entradas del glosario se vuelven útiles cuando están conectadas. Estos enlaces son el camino más corto hacia ideas adyacentes.

Modelo de Programaciónzero-copy-deserialization

Zero-Copy Deserialization

A technique for accessing on-chain account data directly from the underlying byte buffer without copying it into a new Rust struct, avoiding heap allocation and reducing compute unit usage. In Anchor, zero-copy is enabled via #[account(zero_copy)] on the account struct, which uses repr(C) layout and the AccountLoader type. Ideal for large accounts (>1KB) where Borsh deserialization would be expensive.

Herramientas de Devanchor

Framework Anchor

The most popular framework for building Solana programs in Rust. Anchor provides macros (#[program], #[account], #[derive(Accounts)]) that auto-generate boilerplate for account validation, serialization, discriminators, and error handling. It includes a CLI (anchor init/build/test/deploy), IDL generation, and TypeScript client generation. Reduces program code by ~80% compared to native development.

Modelo de Programaciónaccount-data

Account Data

The byte array stored in an account that holds program-specific state. Data is typically serialized using Borsh and must be explicitly allocated at account creation. The maximum data size is 10MB. Programs are responsible for defining and managing their own data layout, including discriminators for type identification.

Más en la categoría

Quédate en la misma capa y sigue construyendo contexto.

Estas entradas viven junto al término actual y ayudan a que la página se sienta parte de un grafo de conocimiento más amplio en lugar de un callejón sin salida.

Modelo de Programación

Cuenta

The fundamental data storage unit on Solana. Every piece of state is stored in an account identified by a 32-byte public key. Accounts hold a lamport balance, an owner program, a data byte array (up to 10MB), and an executable flag. Only the owning program can modify an account's data, but anyone can credit lamports to it.

Modelo de Programación

Programa

Executable code deployed on-chain, equivalent to a smart contract on other blockchains. Programs are stateless—they store no data themselves but read/write data in separate accounts they own. Programs are compiled to SBF bytecode and loaded via the BPF Loader. Every program has a unique Program ID (its account's public key).

Modelo de Programación

Instrucción

A single operation within a transaction that invokes a program. An instruction specifies: (1) the program ID to call, (2) an array of account metas (pubkey, is_signer, is_writable), and (3) an opaque data byte array. Programs decode the instruction data to determine which operation to perform.

Modelo de Programación

Transacción

An atomic unit of execution containing one or more instructions, a recent blockhash, and one or more signatures. All instructions in a transaction execute sequentially and atomically—if any instruction fails, the entire transaction reverts. Transactions have a 1,232-byte size limit (matching IPv6 MTU) and a default 200,000 CU budget.