rialo_types/program_format.rs
1// Copyright (c) Subzero Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Program binary format magic bytes.
5//!
6//! These constants identify the binary format of on-chain program data
7//! by their leading 4-byte magic signatures.
8
9/// PVM magic bytes identifying PolkaVM/RISC-V bytecode.
10pub const PVM_MAGIC: &[u8; 4] = b"PVM\0";
11
12/// WASM magic bytes identifying WebAssembly modules and components.
13pub const WASM_MAGIC: &[u8; 4] = b"\0asm";
14
15/// WASM Component Model magic bytes (8 bytes).
16///
17/// - `\0asm` (4 bytes): WebAssembly magic number
18/// - `\x0d\x00`: Layer ID 13, identifying this as a Component (not a core module)
19/// - `\x01\x00`: Version 1 of the Component Model format
20pub const WASM_COMPONENT_MAGIC: &[u8; 8] = b"\0asm\x0d\x00\x01\x00";