Skip to content

Implement Core BitCred Protocol Features for Decentralized Academic Credentials #1

Open
peace-source wants to merge 9 commits intomainfrom
feature/bitcoin-proof-anchoring
Open

Implement Core BitCred Protocol Features for Decentralized Academic Credentials #1
peace-source wants to merge 9 commits intomainfrom
feature/bitcoin-proof-anchoring

Conversation

@peace-source
Copy link
Owner

Summary

This PR introduces the foundational components of BitCred, a Bitcoin-anchored protocol for secure academic credential management on Stacks. Key features include institution registration with STX staking, credential issuance/endorsement systems, delegation workflows, and GDPR-compliant transfer mechanisms.


New Features & Technical Highlights

1. Institution Management

  • STX-Collateralized Registration
    • Institutions stake MINIMUM_STAKE (1M microSTX) to register
    • Tracked via institutions map with reputation scores and activity status
    • Anti-spam mechanism via ERR-INSUFFICIENT-STAKE and ERR-ALREADY-REGISTERED

2. Credential Lifecycle

  • Tamper-Proof Issuance
    • Single (issue-credential) and batch (batch-issue-credentials) modes
    • Bitcoin block height-based expiration (expiry-date)
    • Revocation tracking via revoked flag
  • Reputation-Weighted Endorsements
    • Multi-factor endorsements with weight and endorser-type metadata
    • Dynamic institution reputation updates

3. Delegation Framework

  • Granular permission system with:
    • Time-bound delegate access (expiry)
    • 10 customizable permissions via permissions list
    • Automatic suspension on institutional revocation

4. Transfer System

  • Stateful transfer requests with:
    • pending/expired status tracking
    • Transfer type classification (transfer-type)
    • Bitcoin block-anchored expiry (expiry-time)

Reviewer Action Items

  1. Verify STX transfer logic in register-institution
  2. Validate batch operation rollback semantics
  3. Confirm GDPR compliance strategy for metadata

- Introduced `transfer-counter` and `total-institutions` data variables to track contract activity.
- Defined `institutions` map to store institution details, including stake amount, reputation score, and registration status.
- Defined `credentials` map to manage academic credentials with fields for verification, endorsements, metadata, and expiration.
- Ensured compatibility with STX staking and reputation-based endorsement systems.
- Added `endorsements` map to track credential endorsements with timestamp, weight, and comments.
- Introduced `institution-delegates` map to manage delegate permissions and activity for institutions.
- Implemented `transfer-requests` map to handle credential ownership transfer requests with status and expiry details.
- Enhanced support for decentralized credential management and delegation workflows.
…tions

- Added `register-institution` function to allow institutions to register by staking the minimum required STX tokens.
- Ensured institutions are uniquely registered and tracked with relevant metadata such as reputation score and registration date.
- Introduced `add-delegate` function to enable institutions to assign delegates with specific permissions and expiry dates.
- Enhanced contract functionality to support decentralized institution and delegation workflows.
- Implemented `issue-credential` function to allow institutions to issue verified academic credentials.
- Ensured credentials are linked to the issuing institution and include metadata such as degree, year, and expiry date.
- Updated institution data to track the number of credentials issued and the last update timestamp.
- Added validation to ensure only active and non-suspended institutions can issue credentials.
- Enhanced support for decentralized and tamper-proof credential management.
…ality

- Implemented `batch-issue-credentials` function to allow institutions to issue multiple credentials in a single transaction.
- Validated batch size against the maximum allowed and ensured only authorized institutions can perform batch operations.
- Added `endorse-credential-extended` function to enable endorsements with additional metadata such as weight, comment, and endorser type.
- Updated credential and institution data to reflect endorsement activity, including reputation score adjustments and timestamps.
- Enhanced scalability and flexibility for credential issuance and endorsement workflows.
- Implemented `request-credential-transfer` function to allow credential owners to initiate transfer requests.
- Validated that the credential is not revoked before creating a transfer request.
- Stored transfer request details, including old owner, new owner, status, request time, expiry time, and transfer type.
- Incremented the `transfer-counter` variable to track unique transfer request IDs.
- Added helper function `is-institution` to verify if an address belongs to a registered institution.
- Implemented `process-credential-issuance` private function to streamline the creation of credentials with metadata such as degree, year, and expiry date.
- Added `get-institution-info` read-only function to retrieve details of a registered institution.
- Added `get-credential-info` read-only function to fetch information about a specific credential by ID and student.
- Enhanced modularity and accessibility for credential management and data retrieval.
…tial validation

- Implemented `get-endorsement-info` to retrieve endorsement details for a specific credential and endorser.
- Added `get-delegate-info` to fetch information about a delegate assigned to an institution.
- Introduced `is-credential-valid` to check if a credential is valid by verifying its revocation status, expiry date, and verification status.
- Enhanced data accessibility and validation capabilities for endorsements, delegation, and credential management.
- Detailed overview of BitCred's purpose and key features, including Bitcoin-anchored credential management and institutional staking.
- Explained technical architecture with core data structures, system constants, and smart contract functions.
- Provided usage examples for institution registration, credential issuance, and endorsement.
- Highlighted security model, compliance features, and error codes for better understanding.
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.

1 participant

Comments