Skip to content

fix(ip_registry): implement proper commitment scheme with blinding fa… - #100

Merged
fejilaup-cloud merged 2 commits into
AtomicIP:mainfrom
Fidelis900:fix/pedersen-commitment-blinding-factor
Mar 26, 2026
Merged

fix(ip_registry): implement proper commitment scheme with blinding fa…#100
fejilaup-cloud merged 2 commits into
AtomicIP:mainfrom
Fidelis900:fix/pedersen-commitment-blinding-factor

Conversation

@Fidelis900

Copy link
Copy Markdown
Contributor

Title: fix(ip_registry): implement proper commitment scheme with blinding factor

Body:

Problem

verify_commitment was comparing record.commitment_hash == secret directly. This means the "commitment hash" stored on-
chain was just the raw secret — anyone reading the ledger could see it. There was no blinding factor, so the scheme
provided zero privacy.

Changes

  • verify_commitment now accepts (ip_id, secret, blinding_factor) and recomputes sha256(secret || blinding_factor) on-
    chain, comparing the result to the stored commitment hash
  • commit_ip is unchanged — callers are expected to compute sha256(secret || blinding_factor) off-chain and submit only
    the hash, so neither the secret nor the blinding factor ever appears on-chain
  • Added commitment_verifies_with_correct_secret_and_blinding test covering the happy path and wrong-blinding-factor
    rejection

Security Impact

This is a critical fix. Without it, the core privacy guarantee of the registry — that IP content is hidden until the
owner chooses to reveal it — did not hold.

Migration

Any existing caller of verify_commitment(ip_id, secret) must update to
verify_commitment(ip_id, secret, blinding_factor). Previously committed records used the raw secret as the hash, so
those commitments cannot be verified with the new scheme and would need to be re-committed.
closes #14

…ctor

The previous verify_commitment compared the stored hash directly to the
secret, meaning the secret was effectively stored in plaintext on-chain.

- verify_commitment now accepts (secret, blinding_factor) and recomputes
  sha256(secret || blinding_factor) on-chain for comparison
- commit_ip still accepts a pre-computed commitment_hash — callers must
  compute sha256(secret || blinding_factor) off-chain before submitting,
  so neither the secret nor the blinding factor ever touches the chain
- Add commitment_verifies_with_correct_secret_and_blinding test covering
  both the happy path and wrong-blinding-factor rejection
@drips-wave

drips-wave Bot commented Mar 25, 2026

Copy link
Copy Markdown

@Fidelis900 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@fejilaup-cloud
fejilaup-cloud merged commit b97e212 into AtomicIP:main Mar 26, 2026
0 of 4 checks passed
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.

Fix: verify_commitment compares hash directly to secret — not a real commitment scheme

2 participants