Refactor Soroban Contracts to Remove Off-chain Data#238
Merged
Jeffrey0522 merged 1 commit intoSkillCert:mainfrom Mar 3, 2026
Merged
Refactor Soroban Contracts to Remove Off-chain Data#238Jeffrey0522 merged 1 commit intoSkillCert:mainfrom
Jeffrey0522 merged 1 commit intoSkillCert:mainfrom
Conversation
Contributor
Author
Jeffrey0522
approved these changes
Mar 3, 2026
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.
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, anduser_profileSoroban 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
Coursetitle,description,thumbnail_urloff_chain_ref_id,content_hashCourseModuletitlecontent_hashCourseGoalcontentcontent_hashUserProfilename,email,country,profession,goalsoff_chain_ref_id,did_hashChanges
Production Contracts
course_registry: All course, module, and goal creation/editing functions now accept and storeoff_chain_ref_idandcontent_hashinstead 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: Mocksave_user_profiledependency updated to match the newuser_profilecontract interface.user_profile: Profile creation and retrieval simplified to store onlyoff_chain_ref_idanddid_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.