BLOCKCHAIN REFERENCE
Reference
Concise reference for block fields, transaction fields, receipt fields, message types, chain query API, and node configuration parameters.
Block Fields
| Field | Type | Wire | Description |
version | Int | int | Block format version (1) |
chain_id | Int | int | 0 = test, 1 = main |
height | Int | int | Monotonic block number |
timestamp | Int | int | Unix seconds |
previous_block_hash | Bytes (32) | hash ptr | BLAKE3 hash of previous block |
nonce | Int | int | PoW nonce satisfying difficulty |
difficulty | Int | int | Required leading zero bits |
validator_public_key_bytes | Bytes (32) | bytes | Ed25519 public key of creator |
signature | Bytes (64) | bytes | Ed25519 over body hash |
accounts_hash | Bytes (32) | hash ptr | Accounts trie root hash |
transactions_hash | Bytes (32) | hash ptr | Transactions list hash |
receipts_hash | Bytes (32) | hash ptr | Receipts list hash |
bloom_hash | Bytes (32) | hash ptr | Bloom tree root hash |
previous_era_hash | Bytes (32) | hash ptr | Previous era bloom root |
total_transaction_fee | Int | int | Sum of tx fees in block |
total_storage_fee | Int | int | Sum of storage fees in block |
total_mint | Int | — | New tokens minted (runtime) |
statistics | [(Int)] | link | Cumulative fee/stake per era |
Transaction Fields
| Field | Type | Wire | Description |
version | Int | int | Format version (1) |
chain_id | Int | int | Target chain |
amount | Int | int | Transfer amount |
code | TransactionCode | int | Transaction type code |
cost_limit | Int | int | Max meter cost |
counter | Int | int | Sender nonce (replay protection) |
data | Expr | expr | Code or payload expression |
recipient | Bytes (32) | bytes | Recipient public key |
sender | Bytes (32) | bytes | Sender public key |
signature | Bytes (64) | bytes | Ed25519 over body hash |
Transaction Codes
| Code | Name | Subsystem |
0x00 | TRANSFER | Core |
0x10 | CHANNEL_UPDATE | Channel |
0x11 | CHANNEL_WITHDRAW | Channel |
0x12 | CHANNEL_CLOSE | Channel |
0x20 | TREASURY_DEPOSIT | Treasury |
0x21 | TREASURY_BORROW | Treasury |
0x22 | TREASURY_REPAY | Treasury |
0x23 | TREASURY_CLOSE | Treasury |
0x30 | STORAGE_CREATE | Storage |
0x31 | STORAGE_PAYMENT | Storage |
0x32 | STORAGE_REMOVE | Storage |
0x40 | CODE_ACCOUNT_CREATE | Code Account |
0x41 | CODE_ACCOUNT_CALL | Code Account |
Receipt Fields
| Field | Type | Wire | Description |
version | Int | int | Format version (1) |
transaction_hash | Bytes (32) | hash ptr | Hash of originating tx |
transaction_fee | Int | int | Base tx fee |
storage_fee | Int | int | On-chain storage fee |
data_fee | Int | int | Data payload fee |
execution_fee | Int | int | VM execution fee |
status | Int | int | 0 = success, 1 = failure |
logs_hash | Bytes (32) | hash ptr | Tx log expression hash |
mint | Int | int | Tokens minted |
Account Fields
| Field | Type | Wire | Description |
balance | Int | int | Token balance |
counter | Int | int | Current nonce |
code_hash | Bytes (32) | hash ptr | Deployed code hash |
data_hash | Bytes (32) | hash ptr | Key-value store root hash |
channels_hash | Bytes (32) | hash ptr | Payment channels root hash |
Fork Fields
| Field | Type | Description |
head | Bytes (32) | Fork tip block hash |
root | Bytes (32) | Genesis block hash |
verified_up_to | Bytes (32) | Earliest verified ancestor |
chain_fork_position | Bytes (32) | Block where fork diverged |
reached_genesis | Bool | Traced to genesis block |
malicious_block_hash | Bytes (32) | First invalid block (if any) |
peers | Set | Peers following this head |
Message Types
| Topic | Value | Direction | Description |
PING | 0 | bidirectional | Keep-alive with signed timestamp |
STORAGE_REQUEST | 1 | request | Request expression by hash with payment |
STORAGE_RESPONSE | 2 | response | Return requested expression |
ROUTE_REQUEST | 3 | request | Ask peer for nearby routing entries |
ROUTE_RESPONSE | 4 | response | Return routing table entries |
TRANSACTION | 5 | relay | Propagate signed transaction |
Query API
get_block
from astreum import get_block
block = get_block(node, height=5000)
# Returns Block or None
O(log N) block lookup by height using bloom tree binary descent from the node's latest block.
find_transactions
from astreum import find_transactions
txs = find_transactions(
node,
tx_hash=b"\x00" * 32, # or specific hash
sender=b"\x00" * 32, # or sender pubkey
receiver=b"\x00" * 32, # or receiver pubkey
key=b"\x00" * 32, # or bloom key
start_height=10000, # search from height
end_height=0, # stop at height (0 = genesis)
limit=10, # max results (0 = unlimited)
)
Bloom-filtered transaction search with AND semantics across all set filters. Uses era-skipping bloom tree search for efficiency.
Config Parameters
| Key | Default | Description |
chain | "main" | Chain name: main or test |
chain_id | 1 | Chain ID: 0 = test, 1 = main |
port | 52780 | UDP port for P2P |
use_ipv6 | False | Enable IPv6 dual-stack |
default_seed | bootstrap.astreum.org:52780 | Default bootstrap peer |
additional_seeds | [] | Extra bootstrap addresses |
peer_timeout | 900 s | Peer inactivity eviction time |
peer_timeout_interval | 10 s | Peer timeout check interval |
bootstrap_retry_interval | 30 s | Bootstrap retry interval |
incoming_queue_size_limit | 64 MiB | Max incoming queue size |
incoming_queue_timeout | 1.0 s | Incoming queue pop timeout |
fair_use_limit | 1 MiB | Fair-use tracking window |
fair_use_ratio | 0.5 | Max upload/download ratio |
hot_storage_limit | 1 GiB | In-memory cache limit |
cold_storage_limit | 10 GiB | On-disk storage limit |
cold_storage_scale | "MB" | Level rollup base unit |
cold_storage_path | auto | Cold storage directory |
storage_index_interval | 600 s | Ad scan interval |
storage_request_minimum_price | 1 | Min retrieval price |
storage_request_price_interval | 5.0 s | Price recalc interval |
storage_fetch_interval | 0.25 s | Fetch retry interval |
storage_fetch_retries | 8 | Max fetch retries |
validation_secret_key | None | Ed25519 key for block validation |
storage_secret_key | auto | Ed25519 key for storage identity |
relay_secret_key | auto | X25519 key for P2P encryption |
logging_enabled | True | Enable structured CSV logging |
logging_retention_days | 7 | Log file retention period |
verification_max_stale_seconds | 10 | Max block staleness for verification |
verification_max_future_skew | 2 | Max future timestamp tolerance |
verify_blockchain_interval | = peer_timeout_interval | Verification worker interval |
latest_block_hash | None | Override starting block hash |
verified_up_to | None | Override verified anchor |
Node API
from astreum import Node
node = Node(config={
"chain": "main",
"port": 52780,
"validation_secret_key": "hex...",
})
# Connect to P2P network
node.connect()
# Validate (create blocks as scheduled validator)
node.validate()
# Verify (track and verify forks)
node.verify()
# Query the chain
block = node.latest_block
# Storage
node.add_expr_advertisement(expr_hash)
node.add_expr_req(expr_hash)
Special Addresses
| Address | Hex |
| Treasury | 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff |
| Storage | 0x0000000000000000000000000000000000000000000000000000000000000000 |