Format:V8 startup snapshot
| Magic | none (first u32 is the context count) |
|---|---|
| Endianness | little-endian |
| On this wiki | Facts · Code · Notes · Topics |
Serialized V8 heap (snapshot_blob.bin, v8_context_snapshot.bin, or embedded in the binary): a little-endian header with context count, rehashability, checksums, a 64-byte version string and section offsets, followed by read-only, startup, shared-heap and context snapshot data.
Header (src/snapshot/snapshot.cc, SnapshotImpl)
| Offset | Size | Field |
|---|---|---|
| 0 | u32 | number of contexts N (> 0 for a valid blob) |
| 4 | u32 | rehashability |
| 8 | u32 | checksum of everything after the read-only checksum slot |
| 12 | u32 | read-only snapshot checksum |
| 16 | 64 bytes | version string, NUL padded (for example 13.1.201.15)
|
| 80 | u32 | offset to the startup snapshot |
| 84 | u32 | offset to the shared heap snapshot |
| 88 | u32 | offset to context 0, then one u32 per further context |
Following the offsets table (pointer aligned): read-only snapshot, startup snapshot, shared heap snapshot, then one snapshot per context. The version string must equal Version::GetString of the loading V8 or loading fails (version mismatch check, CheckVersion).
Identification
There is no magic. A blob is recognized by: small N (1 to 3 typically), an ASCII version string at offset 16, and the dotted version matching the host application. The version string tells the exact V8 (and often the Electron/Node release).
Notes
The layout is from the head of V8 main (V8 15.8 candidate) and has gained fields over time (the shared heap and read-only checksum fields are recent): older V8 versions have the version string at an earlier offset. Check the offset by locating the dotted version text.
Code & repositories
- https://github.com/v8/v8 @
6f9454b67e19ec749aebb8d9d8036735947d5489· license: BSD-3-Clause (declared by the contributor for the files used; GitHub reports BSD-3-Clause (read from LICENSE; GitHub's API was busy) for the repository)
V8 source (BSD-3-Clause). Useful without running: src/snapshot/snapshot.cc (blob header), src/snapshot/code-serializer.{h,cc} (code cache header), src/utils/version.cc, src/flags/flags.cc (ComputeFlagListHash).
Tested on: source read, not run: source read, not run · checked 2026-10-18