Skip to content

fix(hbsig): match HyperBEAM httpsig@1.0 verification format#375

Open
droter wants to merge 3 commits intoArweaveOasis:masterfrom
credentum:master
Open

fix(hbsig): match HyperBEAM httpsig@1.0 verification format#375
droter wants to merge 3 commits intoArweaveOasis:masterfrom
credentum:master

Conversation

@droter
Copy link

@droter droter commented Jan 19, 2026

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_verified errors.

Changes

1. HMAC ID computation (id.js)

  • Add @ prefix to derived components (authority, path, etc.) in signature-params line
  • Use "constant:ao" for both keyid and key (matching HyperBEAM's ?HMAC_DEFAULT_KEY)
  • Match HyperBEAM's add_derived_specifiers() behavior in signature base construction

2. RSA signature verification (send.js)

  • Add @ prefix to derived components in the signature-params line (not component lines)
  • Sort params alphabetically to match HyperBEAM's lists:sort()
  • Use standard base64 for keyid (matches Erlang's base64:decode)

3. Commitment format (commit.js)

  • Strip @ prefix from committed field (HyperBEAM adds it back via add_derived_specifiers)
  • 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 (don't lowercase)
  • Match HyperBEAM's ID generation

Test Plan

  • RSA-PSS-SHA512 commitments verify successfully on HyperBEAM
  • HMAC-SHA256 commitments verify successfully on HyperBEAM
  • Process spawn via commit() function succeeds
  • HMAC ID matches HyperBEAM's expected value (xTqCNonVCq6yD5nqfJDG2wgtePInQLK9kx4PdFPlgN0 for test vectors)

HyperBEAM Compatibility

Tested against HyperBEAM production server:

  • RSA-only commitment: ✅ 200 OK
  • Library commit() function: ✅ 200 OK
  • HMAC ID computation: ✅ Matches expected value

🤖 Generated with Claude Code

Claude Agent and others added 3 commits January 19, 2026 07:38
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant