Skip to content

Refactor Soroban Contracts to Remove Off-chain Data#238

Merged
Jeffrey0522 merged 1 commit intoSkillCert:mainfrom
Bosun-Josh121:refactor/remove-off-chain-data
Mar 3, 2026
Merged

Refactor Soroban Contracts to Remove Off-chain Data#238
Jeffrey0522 merged 1 commit intoSkillCert:mainfrom
Bosun-Josh121:refactor/remove-off-chain-data

Conversation

@Bosun-Josh121
Copy link
Contributor

Refactor: Migrate PII and content to off-chain storage

Closes #236

Summary

All personally identifiable information (PII) and mutable content have been removed from on-chain storage across the course_registry, course_access, and user_profile Soroban smart contracts. These fields are replaced with off-chain reference IDs and content hashes, reducing on-chain state size and improving user privacy.

Schema Changes

Course

  • Removed: title, description, thumbnail_url
  • Added: off_chain_ref_id, content_hash

CourseModule

  • Removed: title
  • Added: content_hash

CourseGoal

  • Removed: content
  • Added: content_hash

UserProfile

  • Removed: name, email, country, profession, goals
  • Added: off_chain_ref_id, did_hash

Changes

Production Contracts

  • course_registry: All course, module, and goal creation/editing functions now accept and store off_chain_ref_id and content_hash instead of raw text fields. On-chain text search filtering removed since there is no longer on-chain text to search. Events updated to emit content hashes.
  • course_access: Mock save_user_profile dependency updated to match the new user_profile contract interface.
  • user_profile: Profile creation and retrieval simplified to store only off_chain_ref_id and did_hash. Privacy logic simplified with removal of field-level visibility controls for deleted fields.

Tests

All test suites across all three contracts updated to match the new function signatures, schema fields, and assertions. Tests referencing removed fields (title, description, name, email, etc.) were rewritten or removed accordingly.

Motivation

Storing PII and mutable content on-chain is a privacy risk, increases transaction costs, and bloats ledger state. This refactor moves all human-readable content off-chain while preserving integrity verification through content hashes. The on-chain contracts now serve purely as a coordination and verification layer.

@Bosun-Josh121
Copy link
Contributor Author

@Jeffrey0522

@Jeffrey0522 Jeffrey0522 merged commit 92801c4 into SkillCert:main Mar 3, 2026
1 check 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.

Refactor Soroban Contracts to Remove Off-chain Data

2 participants