1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*!
# 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`:
```toml
[dependencies]
arch_program = "0.4.0"
```
Then import the modules you need in your code:
```rust
use arch_program::account::AccountInfo;
use arch_program::pubkey::Pubkey;
use arch_program::instruction::Instruction;
// ... other imports as needed
```
*/
pub use bitcoin;
// Re-export commonly used functions
pub use ;
/// Account management and ownership verification
/// Atomic operations for u64 values
/// Time-related functionality for on-chain programs
/// Compute budget instruction definitions and processing
/// Utilities for debugging account data
/// Error handling for decoding operations
/// Program entrypoint definitions and processing
/// Hash type for 32-byte cryptographic hashes
/// Helper functions for common operations
/// Bitcoin transaction input signing utilities
/// Instruction definitions and processing
/// Logging functionality for on-chain programs
/// Program runtime interfaces and state management
/// Error types for program operations
/// Memory management for program execution
/// Optional value representation for programs
/// Data serialization and deserialization for on-chain storage
/// Stub implementations for program interfaces
/// Public key definitions and operations
/// Convenience macro to declare a static program ID and helper functions.
///
/// Input: a single literal base58 string representation of a program's ID.
///
/// This generates:
/// - A `const ID: Pubkey` — the program ID, decoded at compile time.
/// - A `fn check_id(id: &Pubkey) -> bool` — returns `true` if the given pubkey matches.
/// - A `const fn id() -> Pubkey` — returns the program ID.
///
/// # Example
///
/// ```ignore
/// use arch_program::declare_id;
///
/// declare_id!("MyProgram111111111111111111111111111111111");
///
/// assert_eq!(id(), ID);
/// assert!(check_id(&id()));
/// ```
/// Resharing defines.
/// Sanitization trait and error types for validating over-the-wire messages
/// Sanitized transaction processing
/// Secp256k1 signature recovery utilities
/// Stable memory layout implementations
/// System call interfaces for interacting with the runtime
/// System instruction definitions and creation
/// Bitcoin transaction signing utilities
/// Bitcoin UTXO (Unspent Transaction Output) management
extern crate serde_derive;
/// Rune management
/// Maximum size of a Bitcoin transaction in bytes
pub const MAX_BTC_TX_SIZE: usize = 3976;
/// Maximum size of a Bitcoin rune output in bytes
pub const MAX_BTC_RUNE_OUTPUT_SIZE: usize = 2048;
pub const MAX_SIGNERS: usize = 16;
pub const MAX_SEEDS: usize = 16;
pub const MAX_SEED_LEN: usize = 32;
/// Max Taproot inputs to keep tx size ≤ 4096 bytes.
/// Each input ≈ 161 bytes (base + witness).
/// 4096 / 161 ≈ 25
pub const MAX_BTC_TXN_INPUTS: usize = 25;