LearnCard Documentation
GithubStatusSupportLaunch App
  • 🚀Introduction
    • What is LearnCard?
    • Use Cases & Possibilities
    • Ecosystem Architecture
  • ⚡Quick Start
    • Setup & Prerequisites
    • Your First Integration
  • 📚Tutorials
    • Create a Credential
    • Create a Boost
    • Create a ConsentFlow
    • Create a Connected Website
    • Send xAPI Statements
    • Listen to Webhooks
  • ✅How-To Guides
    • Verify My Issuer
    • Connect Systems
      • Connect a Website
      • Connect a Game
    • Implement Flows
      • Claim Data after Guardian Consent
      • Connect via CHAPI
        • ⭐CHAPI Wallet Setup Guide
        • ↔️Translating to CHAPI documentation
        • 🖥️Demo Application
        • 🔰Using LearnCard to Interact with a CHAPI Wallet
        • 📝Cheat Sheets
          • Issuers
          • Wallets
    • Deploy Infrastructure
      • Remote Key Management
      • Generate API Tokens
      • Signing Authority
      • Connect to Independent Network
      • Build a Plugin
  • 🛠️SDKs & API Reference
    • LearnCard Wallet SDK
      • Authentication
      • Usage Examples
      • SDK Reference
      • Plugin API Reference
      • Integration Strategies
      • Deployment
      • Troubleshooting
      • Changelog
    • LearnCloud Network API
      • Authentication
      • Usage Examples
      • Architecture
      • Notifications & Webhooks
      • Profiles
      • Profile Managers
      • Credentials
      • Boosts
      • Presentations
      • Storage
      • Contracts
      • DID Metadata
      • Claim Hooks
      • Auth Grants
      • Utilities
      • Models
      • OpenAPI
    • LearnCloud Storage API
      • Authentication
      • Usage Examples
      • Architecture
      • Storage
      • Index
      • User
      • Custom Storage
      • Utilities
      • Models
      • xAPI Reference
    • Plugins
      • Crypto
      • DIDKit
      • DID Key
      • Dynamic Loader
      • VC
        • Expiration Sub-Plugin
      • VC-Templates
      • VC-API
      • Ceramic
      • IDX
      • VPQR
      • Ethereum
      • CHAPI
      • LearnCard Network
      • LearnCloud
      • LearnCard
      • Simple Signing
      • Claimable Boosts
    • LearnCard CLI
  • 🧠Core Concepts
    • Identities & Keys
      • Decentralized Identifiers (DIDs)
      • Seed Phrases
      • Network Profiles
      • Signing Authorities
      • Trust Registries
    • Credentials & Data
      • Verifiable Credentials (VCs)
      • Credential Lifecycle
      • Schemas, Types, & Categories
      • Building Verifiable Credentials
      • Boost Credentials
      • Getting Started with Boosts
      • Credential URIs
      • xAPI Data
      • General Best Practices & Troubleshooting
    • Consent & Permissions
      • ConsentFlow Overview
      • Consent Contracts
      • User Consent & Terms
      • Consent Transactions
      • Auto-Boosts
      • Writing Consented Data
      • Accessing Consented Data
      • GameFlow Overview
    • Network & Interactions
      • Network Vision & Principles
      • Key Network Procedures
      • Core Interaction Workflows
    • Architecture & Principles
      • Control Planes
      • Plugin System
      • Auth Grants and API Tokens
  • 🔗Development
    • Contributing
Powered by GitBook
On this page
  • Contract Structure
  • Creating a Contract
  • Managing Contracts

Was this helpful?

  1. Core Concepts
  2. Consent & Permissions

Consent Contracts

PreviousConsentFlow OverviewNextUser Consent & Terms

Last updated 10 days ago

Was this helpful?

Learn about Consent Contracts: the formal agreements created by organizations that define precisely what data can be shared or what actions can be performed. Explore their structure, common fields, and how they are managed throughout their lifecycle.

Contract Structure

Contracts define what data a profile can read from or write to another profile. They have a structured format with read and write permissions.

A minimal contract example:

{
  read: {
    personal: { name: { required: false } },
    credentials: {
      categories: {},
    },
  },
  write: {
    personal: {},
    credentials: {
      categories: {},
    },
  }
}

Contracts can also include:

  • Name - A human-readable name for the contract

  • Description - Explains the purpose of the contract

  • Reason for Accessing - Why the contract owner needs this data

  • Needs Guardian Consent - Flag for contracts involving minors

  • Redirect URL - Where to direct users after consent

  • Front Door Boost URI - A credential to display

  • Image - Visual representation of the contract

  • Auto-Boosts - Credentials to auto-issue upon consent

Creating a Contract

Contracts are created using the createConsentFlowContract endpoint, which is implemented as a profile route requiring authentication with the contracts:write scope.

When creating a contract with auto-boosts, each boost must specify:

  • A boost URI pointing to an existing boost credential

  • A signing authority configuration (endpoint and name)

The contract creator must have permission to issue the boosts specified in auto-boosts.

Managing Contracts

Contracts can be:

  • Retrieved using getConsentFlowContract (single contract) or getConsentFlowContracts (paginated list)

  • Deleted using deleteConsentFlowContract (if you're the owner)

When a contract is deleted, all consented terms for that contract are also removed.

🧠