335 336 337 338 features - #390
Merged
fejilaup-cloud merged 3 commits intoApr 26, 2026
Merged
Conversation
- Add commitment_strength field to IpRecord (0-100 scale) - Implement calculate_commitment_strength() function - Implement get_ip_strength() to retrieve strength score - Calculate strength based on secret length and PoW difficulty
- pow_difficulty parameter already in commit_ip function - require_pow() validates commitment hash meets difficulty - Difficulty measured in leading zero bits - Tests verify PoW validation with various difficulties
|
@Dev-Vik-Tor 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.
IP Registry Enhancement: Strength Scoring, Categorization, PoW, and Delegation
Overview
This PR implements four interconnected features for the IP Registry contract, enhancing security, organization, and operational flexibility for IP commitment management on Stellar Soroban.
Changes Implemented
Issue #335: IP Commitment Strength Scoring
commitment_strength: u8field toIpRecord(0-100 scale)calculate_commitment_strength(secret_length, pow_difficulty) -> u8functionmin(100, (secret_length * 2) + (pow_difficulty * 3))get_ip_strength(env, ip_id) -> u8to retrieve strength scoreIssue #336: IP Compartmentalization by Category
category: Bytesfield toIpRecordfor organizing IPs by typeCategoryIps(Bytes)storage key for efficient category-based indexinglist_ip_by_category(env, category) -> Vec<u64>for filtering IPsupdate_ip_category(env, ip_id, new_category)(owner-only)Issue #337: IP Commitment Proof of Work Requirement
pow_difficulty: u32parameter integrated intocommit_ip()functionrequire_pow(env, commitment_hash, difficulty) -> boolvalidationIssue #338: IP Commitment Delegation
IpDelegates(Address)storage key to track delegates per ownerdelegate_commitment_authority(env, owner, delegate_address)(owner-only)revoke_delegation(env, owner, delegate_address)(owner-only)is_delegate(env, owner, delegate_address) -> boolfor verificationcommit_ip_delegated(env, owner, commitment_hash, pow_difficulty) -> u64Data Structure Updates
IpRecord Enhancement
rust
,pub struct IpRecord {
pub ip_id: u64,
pub owner: Address,
pub commitment_hash: BytesN<32>,
pub timestamp: u64,
pub revoked: bool,
pub expiry_timestamp: u64,
pub metadata: Bytes,
pub priority: u8, // NEW: 0-10 priority scale
pub category: Bytes, // NEW: category for organization
pub commitment_strength: u8, // NEW: 0-100 strength score
pub co_owners: Vec
}
Storage Keys
CategoryIps(Bytes)- Maps category to Vec of IP IDsIpDelegates(Address)- Maps owner to Vec of delegatesSuggestedPrice(u64)- Stores suggested price for IPTesting
Benefits
Closes