Skip to content

Hello NPK

Build, prove, publish locally, and install a native NPK with the checked-in nexus and nip CLIs.

This proof is the first local Forge package pipeline: nexus orchestrates the proof, nip builds and installs the deterministic package, and BKDL evidence is the package artifact sidecar.

Run the proof

bash
cd nexus-forge/core/nip
./build.sh
cd ../../..
NEXUS_ROOT="$PWD"

export HOME=/tmp/nexus-npk-proof-home
export XDG_DATA_HOME=/tmp/nexus-npk-proof-home/.local/share
export XDG_CONFIG_HOME=/tmp/nexus-npk-proof-home/.config
export XDG_CACHE_HOME=/tmp/nexus-npk-proof-home/.cache
export NEXUS_HOME=/tmp/nexus-npk-proof-home/.nexus
rm -rf "$HOME"
mkdir -p "$HOME/work"
cd "$HOME/work"

"$NEXUS_ROOT/nexus-forge/core/nip/nip" init hello-npk
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge npk-proof hello-npk
"$NEXUS_ROOT/nexus-forge/scripts/nexus" bazaar validate --local
"$NEXUS_ROOT/nexus-forge/scripts/nexus" bazaar verify-cids --local
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge export-bundle hello-npk
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge validate-bundle "$NEXUS_HOME"/bundles/npk/hello-npk/*/*.npk-bundle.tar.gz
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge import-bundle "$NEXUS_HOME"/bundles/npk/hello-npk/*/*.npk-bundle.tar.gz
"$NEXUS_ROOT/nexus-forge/scripts/nexus" bazaar install --local hello-npk
"$XDG_DATA_HOME/nip/Links/Executables/hello-npk"

Expected final output:

text
hello from hello-npk

What the commands do

  • nip init hello-npk creates package.kdl and src/main.sh.
  • nexus forge npk-proof hello-npk calls nip build, emits hello-npk.npk.bkdl.json, signs that BKDL evidence with a local Ed25519 key, embeds the public key PEM in the .sig sidecar, verifies the artifact, publishes the proof into $NEXUS_HOME/artifacts/npk, and writes a local Bazaar registry entry whose artifacts block points at the stored NPK, BKDL evidence, and signature sidecar.
  • nexus bazaar validate --local checks the local trust badge metadata.
  • nexus bazaar verify-cids --local recomputes the artifact-backed Variant-CID from the BKDL evidence inputs.
  • nexus forge export-bundle hello-npk writes a portable .npk-bundle.tar.gz with the stored NPK, BKDL evidence, signature sidecar, and bundle manifest.
  • nexus forge validate-bundle <bundle> verifies the bundle checksum, manifest digests, BKDL evidence, signature sidecar, and bundled NPK.
  • nexus forge validate-bundle-manifest <manifest> checks an extracted bundle manifest against the checked-in Forge bundle schema.
  • nexus forge import-bundle <bundle> checks bundle provenance, publisher identity, local trust roots, and revocation policy before copying the bundle into the local Forge store and publishing a local Bazaar entry for this machine.
  • nexus bazaar install --local hello-npk validates local trust, verifies the stored artifact, delegates installation to nip, and registers the package in the local JSON database.

Runtime proof image

After the local package proof exists, project the package evidence into a bootable Micro runtime proof image:

bash
"$NEXUS_ROOT/nexus-forge/scripts/nexus" build --edition=micro --arch=x86_64 --local-proof
"$NEXUS_ROOT/nexus-forge/scripts/nexus" runtime install-proof \
  --local hello-npk \
  --image "$NEXUS_HOME/artifacts/nexus-micro-x86_64.img" \
  --output "$HOME/work/nexus-micro-runtime-hello.img"
"$NEXUS_ROOT/nexus-forge/scripts/nexus" verify "$HOME/work/nexus-micro-runtime-hello.img"

The output image has a nexus-runtime-package-proof/v1 manifest, BKDL evidence, and Ed25519 signature. Its runtime manifest records the package Variant-CID, NRP path, read-only NexFS /sysro projection, capability policy, and embedded runtime ledger sector. The QEMU regression verifies the ledger sector digest, boots the image, and checks that the serial output exposes the runtime ledger read from the image:

bash
nexus-forge/tests/test-runtime-package-proof.sh

This proves a development bridge from host package identity into boot-visible runtime evidence. The production nxs generation composer remains separate future work.