fix(hbsig): match HyperBEAM httpsig@1.0 verification format#375
Open
droter wants to merge 3 commits intoArweaveOasis:masterfrom
Open
fix(hbsig): match HyperBEAM httpsig@1.0 verification format#375droter wants to merge 3 commits intoArweaveOasis:masterfrom
droter wants to merge 3 commits intoArweaveOasis:masterfrom
Conversation
This commit fixes several issues with HTTP message signature verification when communicating with HyperBEAM: 1. HMAC ID computation (id.js): - Add @ prefix to derived components in signature-params line - Use "constant:ao" for both keyid and key - Match HyperBEAM's add_derived_specifiers() behavior 2. RSA signature verification (send.js): - Add @ prefix to derived components (authority, path, etc.) in params line - Sort params alphabetically to match HyperBEAM's lists:sort() - Use standard base64 for keyid (matches base64:decode) 3. Commitment format (commit.js): - Strip @ prefix from committed field (HyperBEAM adds it back) - Fix path option passing (default to path: false) - Convert signature to base64url for b64fast:decode compatibility 4. Commitment ID computation (httpsig.js, structured.js): - Preserve original key casing for commitment IDs - Match HyperBEAM's ID generation Tested against production HyperBEAM server. Both RSA-PSS-SHA512 and HMAC-SHA256 commitments now verify successfully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fix(hbsig): match HyperBEAM httpsig@1.0 verification format
Contains issue and PR content for contributing the hbsig fixes back to the upstream repository. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
This PR fixes HTTP message signature verification to match HyperBEAM's httpsig@1.0 commitment device format. Previously, commitments created by hbsig failed verification on HyperBEAM with
process_not_verifiederrors.Changes
1. HMAC ID computation (
id.js)@prefix to derived components (authority, path, etc.) in signature-params line"constant:ao"for both keyid and key (matching HyperBEAM's?HMAC_DEFAULT_KEY)add_derived_specifiers()behavior in signature base construction2. RSA signature verification (
send.js)@prefix to derived components in the signature-params line (not component lines)lists:sort()base64:decode)3. Commitment format (
commit.js)@prefix from committed field (HyperBEAM adds it back viaadd_derived_specifiers)path: false)b64fast:decodecompatibility4. Commitment ID computation (
httpsig.js,structured.js)Test Plan
commit()function succeedsxTqCNonVCq6yD5nqfJDG2wgtePInQLK9kx4PdFPlgN0for test vectors)HyperBEAM Compatibility
Tested against HyperBEAM production server:
commit()function: ✅ 200 OK🤖 Generated with Claude Code