Crate arch_program

Source
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
infoDeprecated
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