Repository navigation
feat(license): Ed25519 license-verification core + startup gate (recover engine#19) - #21
Merged
Merged
Conversation
…ver engine#19) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-Authored-By: Claude Opus 4.8 <[email protected]>
hanzo-dev
pushed a commit
that referenced
this pull request
Jul 16, 2026
…ver engine#19) (#21) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-authored-by: Antje Worring <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
zeekay
pushed a commit
that referenced
this pull request
Jul 26, 2026
…ver engine#19) (#21) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-authored-by: Antje Worring <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
zeekay
pushed a commit
that referenced
this pull request
Jul 26, 2026
…ver engine#19) (#21) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-authored-by: Antje Worring <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
hanzo-dev
pushed a commit
that referenced
this pull request
Jul 27, 2026
…ver engine#19) (#21) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-authored-by: Antje Worring <[email protected]>
zeekay
pushed a commit
that referenced
this pull request
Sep 15, 2026
…ver engine#19) (#21) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-authored-by: Antje Worring <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
zeekay
pushed a commit
that referenced
this pull request
Sep 15, 2026
…ver engine#19) (#21) Engine-side license verification: the proprietary engine refuses to serve unless handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. Recovers the actual feature from #19 (a 430k-line fork-sync blob) onto current main as a focused ~5-file change. No fork-sync noise (route renames, ROCM defaults) is dragged in. - hanzo-engine/src/license.rs: Ed25519 verify core via ed25519-dalek. Token = base64url(JSON claims)"."base64url(ed25519 sig[64]); sig is over the encoded payload bytes so verify never re-canonicalizes JSON. Claims {v,app_id,holder,iat,exp,features,nonce}. verify_license / load_and_verify with distinct errors Missing/Malformed/BadSig/Expired/NotYetValid/WrongApp. Embedded HANZO_LICENSE_PUBKEY is a DEV key (clearly marked; prod pubkey from KMS swapped in at release). expected_app fixed per build via cargo features license-app-hanzo/lux/zoo (default "hanzo-dev"). 9 unit tests. - hanzo-engine/examples/license_issuer.rs: mints signed per-app tokens; private key from --signing-key-file / HANZO_LICENSE_SIGNING_KEY, never hardcoded; self-checks the freshly minted token. - Gate (cargo feature license-enforce, OFF by default): hanzo-cli/src/commands/serve.rs top of run_server (exit 78 on failure) and hanzo-server-core/src/hanzo_for_server_builder.rs top of build() (returns Err). No-op note when the feature is off. - workspace + engine dep: ed25519-dalek 2.1.1. license-dev-key/ holds the committed public key + README; the private seed is gitignored. Verified: - cargo test -p hanzo-engine --no-default-features license -> 9 passed. - cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo -> clean. - cargo build -p hanzo-engine --example license_issuer -> builds; mints a token that decodes to the exact claim schema and self-verifies. Co-authored-by: Antje Worring <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recovers the real feature from #19 onto current
mainas a focused, reviewable change. #19 is a 430k-line / 1402-file fork-sync blob (its merge-base withmainis from 2024); this PR extracts only the ~5-file license feature and drops all the fork-sync noise.What this is
Engine-side license verification: with the
license-enforcefeature on, the proprietary engine refuses to serve unless it is handed a valid, unexpired, correctly-scoped Hanzo-issued Ed25519 token for the right app. With the feature off (the default — dev/CLI/perf/test), both gate sites are a one-line no-op.Files (9 changed, +154; 3 new source/artifact files)
License core —
hanzo-engine/src/license.rsed25519-dalek.base64url(JSON(claims)) "." base64url(ed25519_sig[64]). The signature is over the ASCII bytes of the encoded payload, so verification never re-canonicalizes JSON. Claims:{v:u8, app_id, holder, iat, exp, features, nonce}.verify_license(token, pubkey, expected_app, now_unix) -> Result<License, LicenseError>with distinct errorsMissing/Malformed/BadSig/Expired/NotYetValid/WrongApp.load_and_verify()readsHANZO_ENGINE_LICENSE_TOKEN(fallback file viaHANZO_ENGINE_LICENSE_FILE), checks embedded pubkey + buildexpected_app+ current time.HANZO_LICENSE_PUBKEYis a DEV key, clearly markedDEV KEY -- replace with prod pubkey from KMS for release. The private seed is not committed (gitignoredlicense-dev-key/dev_signing_key.b64).expected_appfixed per build via cargo featureslicense-app-hanzo/license-app-lux/license-app-zoo(default"hanzo-dev"), so a Zoo token cannot run a Hanzo build.Issuer —
hanzo-engine/examples/license_issuer.rs--signing-key-fileorHANZO_LICENSE_SIGNING_KEY(base64url/base64 32-byte seed), never hardcoded. Self-checks the freshly minted token before printing.Gate (cargo feature
license-enforce, OFF by default)hanzo-cli/src/commands/serve.rs— top ofrun_server, beforeinitialize_logging(): on failure prints to stderr and hard-exits78(EX_CONFIG).hanzo-server-core/src/hanzo_for_server_builder.rs— top ofHanzoForServerBuilder::build(): returnsErrso the engine never binds its listener (covers every embedder that goes through the builder: node / CLI / pyo3-via-server).Wiring
ed25519-dalek = { version = "2.1.1", default-features = false, features = ["rand_core"] }(all other deps — base64, rand, serde_json, clap — were already present on current main at the exact versions used).license-enforce+license-app-{hanzo,lux,zoo}features added tohanzo-engine,hanzo-cli,hanzo-server-core.license-dev-key/holds the committed public key (dev_public_key.b64,dev_public_key.rs.txt) +README.md; private seed gitignored.Insertion points on current main
serve.rs:run_serveropens withinitialize_logging();— the gate call goes immediately above it; the two#[cfg]fn definitions go afterrun_servercloses (beforepub(crate) fn log_api_surfaces).hanzo_for_server_builder.rs: the two#[cfg]fns go after theuseblock (beforestruct ModelConfig);build()is at thepub async fn build(self) -> Result<SharedHanzoState>and the gate call is its first line.(These had "moved" only in the sense that #19's diff showed them as
new file— an artifact of the 2024 merge-base. On current main both files exist; the feature delta vs. #19's copies is exactly the gate, with the rest being fork-sync churn that is intentionally excluded.)Verification
cargo test -p hanzo-engine --no-default-features license-> 9 passed, 0 failed (incl.dev_keypair_matches_embedded_pubkey).cargo check -p hanzo-cli --no-default-features --features license-enforce,license-app-hanzo-> clean (both gate sites build under enforcement).cargo build -p hanzo-engine --example license_issuer-> builds; ran end-to-end and it mints a token decoding to the exact claim schema, self-verified.MISTRALRS_API_ROUTESrename, noRouteKind::MistralRs, noPAGED_ATTN_ROCM/is_rocm).Follow-ups (NOT in this PR)
HANZO_LICENSE_PUBKEYis a throwaway DEV key. Generate the prod keypair on a private host, hold the private key in KMS / CI secret, and swap this const before release.option_env!("HANZO_ENGINE_LICENSE_TOKEN")in the node-options structs and pass through to the sidecar env; add the 3 CI secrets; build per-app with thelicense-app-*feature.HanzoForServerBuilderare not gated here.Does not auto-merge (proprietary licensing code — needs human review). #19 left open intentionally; close it once this extraction is confirmed good.
🤖 Generated with Claude Code