feat(parser_http_server): real bootProof from NSM - #452
Draft
pepe-anchor wants to merge 1 commit into
Draft
Conversation
Turnkey's gateway attaches bootProof today; the pivot has to produce it once it is the front door, or every attestation-verifying consumer breaks. Reproduces qos_core's post-boot attestation call directly against /dev/nsm: manifest hash in user_data, ephemeral pubkey in public_key, nonce None. Generated once at startup, because nonce: None means the doc is not request-bound and our reference verifier does not check its timestamp. The manifest fields are borsh, not the JSON sitting at /qos.manifest. The Go verifier borsh-deserializes both and compares sha256(borsh(manifest)) against user_data, so base64-ing the file bytes would produce a field nothing can verify. Co-Authored-By: Claude <noreply@anthropic.com>
pepe-anchor
force-pushed
the
pepefigueira/prs-581-06-boot-proof
branch
from
August 6, 2026 17:12
14c12e9 to
b201bb1
Compare
pepe-anchor
changed the base branch from
pepefigueira/prs-581-03-pivot-v1
to
pepefigueira/prs-581-05-xstamp-auth
August 6, 2026 17:12
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.
Why
Turnkey's gateway attaches
bootProofto every response today. Once the pivot is the front door it has to produce that itself, or every attestation-verifying consumer breaks. The x402 branch's HTTP envelope has nobootProoffield at all, so this is the piece that closes the wallet contract on the new path.What
Reproduces qos_core's post-boot attestation call directly against
/dev/nsm: manifest hash inuser_data, ephemeral pubkey inpublic_key,nonce: None. Same shape asqos_core/src/protocol/services/attestation.rs, which is what production serves today.NsmBootProofimplementing theBootProofSourcetrait from feat(parser_http_server): HTTP+JSON pivot for TVC public ingress #450, with awith_attestorseam so the behavior is testable without an enclave.nonce: Nonemeans it is not request-bound, and our reference verifier does not check its timestamp (visualsign-turnkeyclientcmd/verify.gosetsSkipTimestampCheck: true), so there is no freshness window to satisfy. No TTL, no refresh.--boot-proof-source <static|nsm>/BOOT_PROOF_SOURCE, defaulting tostatic, so local dev and CI are untouched andNsmBootProof::newfailing outside an enclave cannot break the default path.The manifest fields are borsh, not the JSON at
/qos.manifest. The Go verifier borsh-deserializes both and comparessha256(borsh(manifest))against the doc'suser_data, so base64-ing the file bytes would produce fields nothing can verify.Test evidence
qos_core'smockfeature is enabled only under[dev-dependencies](needed forManifestEnvelope::default()in the test fixture). Verified withcargo treethat resolver 3 keeps it out of the normal build: a non-test build resolvesqos_corewithvmonly, andmock,vmappears exclusively in test builds. Upstream labels that feature "never use in production", so this was worth checking rather than assuming.DO NOT MERGE until the NSM reachability probe passes
This implements option A: the pivot calls
/dev/nsmitself. Whether a pivot process can reach that device under TVC, and whether concurrent use alongside qos_core is safe, has not been verified against a real deployment.Nsmdoesnsm_init/nsm_exitper call so it is probably fine, but it needs a real observation.If the probe fails, this approach is replaced by option B: ask Turnkey to expose the attestation doc to the pivot (a unix socket route or a file written post-boot), which is an upstream QOS change and should ride with the QOS bump.
Two acceptance criteria also remain outstanding because they need a live enclave, not a mock:
visualsign-turnkeyclient verifypassing against a real Nitro doc, including "Raw manifest hash matches UserData in attestation". If that hash mismatches, the V1/V2 manifest layout is wrong for this QOS rev.Rollback
Revert the commit, or leave
--boot-proof-sourceat itsstaticdefault: the NSM path is opt-in and unused unless explicitly selected.Linear
PRS-581
Stacked on #450. #337.
🤖 Generated with Claude Code