Expand description
§Arch Program
A Rust library for building programs that run inside the Arch Virtual Machine. This crate provides core functionality for creating instructions, managing accounts, handling program errors, and interacting with the Arch runtime environment.
§Features
- Bitcoin transaction and UTXO management
- Account data manipulation and ownership verification
- System instruction creation and processing
- Program error handling
- Logging utilities
- Cryptographic operations including secp256k1 signature recovery
- Memory management for on-chain programs
§Usage
Add this crate to your Cargo.toml
:
[dependencies]
arch_program = "0.4.0"
Then import the modules you need in your code:
use arch_program::account::AccountInfo;
use arch_program::pubkey::Pubkey;
use arch_program::instruction::Instruction;
// ... other imports as needed
Re-exports§
pub use bitcoin;
Modules§
- account
- Account management and ownership verification Core account abstractions and management functionality for blockchain accounts, including account information and metadata structures.
- atomic_
u64 - Atomic operations for u64 values
Atomic
u64
operations with 32-bit system fallback. - bpf_
loader - builtin
- clock
- Time-related functionality for on-chain programs Clock module provides time-related functionality for the program.
- compiled_
keys - debug_
account_ data - Utilities for debugging account data Debug-formatting of utxo data.
- decode_
error - Error handling for decoding operations Converting custom error codes to enums.
- entrypoint
- Program entrypoint definitions and processing
- helper
- Helper functions for common operations
- input_
to_ sign - Bitcoin transaction input signing utilities Input requiring signature.
- instruction
- Instruction definitions and processing
- keccak
- Hashing with the keccak (SHA-3) hash function.
- loader_
instruction - Instructions for the v4 built-in loader program.
- log
- Logging functionality for on-chain programs Logging utilities for Rust-based Solana programs.
- message
- Message format and processing utilities Message module provides functionality for creating, serializing, and hashing messages.
- native_
loader - program
- Program runtime interfaces and state management
- program_
error - Error types for program operations Error types and handling for Arch VM programs.
- program_
memory - Memory management for program execution Basic low-level memory operations.
- program_
option - Optional value representation for programs
A C representation of Rust’s
Option
, used across the FFI boundary for Solana program interfaces. - program_
pack - Data serialization and deserialization for on-chain storage
The [
Pack
] serialization trait. - program_
stubs - Stub implementations for program interfaces
Implementations of syscalls used when
arch-program
is built for non-SBF targets. - program_
utils - pubkey
- Public key definitions and operations Public key definitions and operations for the Arch VM environment.
- rune
- Rune management
- sanitize
- Sanitization trait and error types for validating over-the-wire messages A trait for sanitizing values and members of over the wire messages.
- sanitized
- Sanitized transaction processing
- sol_
secp256k1_ recover - Secp256k1 signature recovery utilities Secp256k1 elliptic curve cryptography recovery operations.
- stable_
layout - Stable memory layout implementations
- stake
- syscalls
- System call interfaces for interacting with the runtime
- system_
instruction - System instruction definitions and creation
- system_
program - transaction_
to_ sign - Bitcoin transaction signing utilities Transaction to sign representation for serialization and deserialization.
- utxo
- Bitcoin UTXO (Unspent Transaction Output) management Bitcoin UTXO (Unspent Transaction Output) management and processing.
- vote
Macros§
- custom_
heap_ default - custom_
panic_ default - entrypoint
- info
Deprecated - Print a message to the log.
- msg
- Print a message to the log.
Constants§
- MAX_
BTC_ RUNE_ OUTPUT_ SIZE - Maximum size of a Bitcoin rune output in bytes
- MAX_
BTC_ TX_ SIZE - Maximum size of a Bitcoin transaction in bytes