fix(ip_registry): implement proper commitment scheme with blinding fa… - #100
Merged
fejilaup-cloud merged 2 commits intoMar 26, 2026
Merged
Conversation
…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
|
@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! 🚀 |
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.
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
chain, comparing the result to the stored commitment hash
the hash, so neither the secret nor the blinding factor ever appears on-chain
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