Add an external-signer path for third-party blocks (HSM/TPM/Secure Enclave support) - #338
Open
echo-ilabs wants to merge 1 commit into
Open
Conversation
create_block requires the raw PrivateKey, which rules out keys held in HSMs, TPMs and secure enclaves: they will sign bytes for you, but never release the key. Split the operation in two: prepare_block returns the exact bytes to sign, and with_external_signature assembles the block from a signature produced wherever the key lives, verifying it up front so mistakes fail at assembly rather than at token deserialization. create_block is now built on top of the split path, so the two stay equivalent by construction.
echo-ilabs
force-pushed
the
feat/external-signer-third-party-blocks
branch
from
July 21, 2026 16:22
81a20c4 to
b47b01d
Compare
Contributor
|
Hi, this is one of the goals of #334 which should be merged soon. Can you have a look at it and check if that matches your use-case? |
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.
Closes #339.
create_blocktakes the signer's raw&PrivateKey, which rules out keys held in HSMs, TPMs and secure enclaves: they will sign bytes for you, but never release the key. This splits the operation in two, additively:prepare_blockdoes everythingcreate_blockdid up to the signature and exposes the exact bytes to sign.with_external_signatureassembles the block, verifying the signature against the supplied public key up front -- so a wrong key or a corrupted signature fails right there instead of later, as an opaque deserialization error on the recipient's side.create_blockis now built on top of the split path, so the two stay equivalent by construction.No wire-format or verification changes. Tests cover external-signing round trips for Ed25519 and P-256 (the algorithm hardware modules typically hold, verified by full re-deserialization), byte-for-byte equivalence of the two paths for deterministic Ed25519, and tamper/wrong-key rejection at assembly.