Back to Course

Session 4.5 - Identity & Policies

Implement identity management and policies

Module 4 45 minutes

Learning Objectives

  • Understand blockchain identity management systems
  • Implement access control policies and permissions
  • Explore self-sovereign identity concepts
  • Design role-based access control for blockchain networks
  • Analyze privacy-preserving identity solutions

Blockchain Identity Fundamentals

Identity in Blockchain Context

Blockchain identity systems manage digital identities, authentication, and authorization in decentralized networks.

Authentication

Verify identity using cryptographic proofs

Authorization

Control access to resources and operations

Attribution

Link actions to specific identities

Digital Identity Models

Identity Architecture Types

Different blockchain networks implement various identity models based on their requirements.

Model Description Examples Use Cases
Pseudonymous Address-based identities without real-world links Bitcoin, Ethereum Public cryptocurrencies
Permissioned Known identities with certificates Hyperledger Fabric Enterprise networks
Self-Sovereign User-controlled identity without intermediaries Sovrin, uPort Digital identity platforms
Federated Identity providers manage user identities OAuth, SAML integration Enterprise SSO

Self-Sovereign Identity (SSI)

User-Controlled Identity

SSI gives individuals control over their digital identities without relying on centralized authorities.

SSI Principles
  • Self-Ownership: Users own their identity
  • Control: Users control identity disclosure
  • Access: Users have access to their data
  • Transparency: Clear identity processes
  • Persistence: Long-lived identities
  • Portability: Cross-platform identity
  • Interoperability: Standard protocols
  • Consent: User consent for data use
  • Minimization: Minimal data disclosure
  • Protection: Privacy and security
SSI Components
  • DIDs: Decentralized Identifiers
  • DID Documents: Identity metadata
  • Verifiable Credentials: Cryptographic proofs
  • Digital Wallets: Credential storage
  • Issuers: Credential providers
  • Verifiers: Credential validators
  • Holders: Identity owners
  • Registries: DID resolution

Access Control Policies

Policy-Based Access Control

Blockchain networks implement various access control mechanisms to manage permissions and resources.

Role-Based Access Control (RBAC)
  • Roles: Admin, User, Auditor
  • Permissions: Read, Write, Execute
  • Assignment: Users assigned to roles
  • Hierarchy: Role inheritance
Attribute-Based Access Control (ABAC)
  • Attributes: User, resource, environment
  • Policies: Complex rule evaluation
  • Dynamic: Context-aware decisions
  • Granular: Fine-grained control

Implementation Examples

Smart Contract Access Control
Solidity RBAC Example
contract AccessControl {
    mapping(bytes32 => mapping(address => bool)) roles;
    
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN");
    bytes32 public constant USER_ROLE = keccak256("USER");
    
    modifier onlyRole(bytes32 role) {
        require(hasRole(role, msg.sender), "Access denied");
        _;
    }
    
    function grantRole(bytes32 role, address account) 
        external onlyRole(ADMIN_ROLE) {
        roles[role][account] = true;
    }
    
    function hasRole(bytes32 role, address account) 
        public view returns (bool) {
        return roles[role][account];
    }
}
Fabric MSP Configuration
Organizations:
  - &Org1
    Name: Org1MSP
    ID: Org1MSP
    MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
    Policies:
      Readers:
        Type: Signature
        Rule: "OR('Org1MSP.member')"
      Writers:
        Type: Signature
        Rule: "OR('Org1MSP.member')"
      Admins:
        Type: Signature
        Rule: "OR('Org1MSP.admin')"

Privacy-Preserving Identity

Zero-Knowledge Identity Proofs

Advanced cryptographic techniques enable identity verification without revealing sensitive information.

Anonymous Credentials
  • Prove attributes without identity
  • Unlinkable presentations
  • Selective disclosure
  • Privacy preservation
Zero-Knowledge Proofs
  • Prove knowledge without revealing
  • Age verification without birthdate
  • Income proof without amount
  • Membership without identity
Ring Signatures
  • Group member authentication
  • Signer anonymity
  • Unforgeable signatures
  • Privacy in voting

Enterprise Identity Solutions

Hyperledger Fabric MSP
  • Membership Service Provider: Identity management
  • X.509 Certificates: Standard PKI
  • Organizational Units: Role hierarchy
  • Certificate Authorities: Trust anchors
  • Policy Definitions: Access rules
Enterprise Integration
  • Active Directory: User directory integration
  • LDAP: Lightweight directory protocol
  • SAML: Security assertion markup
  • OAuth 2.0: Authorization framework
  • OpenID Connect: Identity layer
Hyperledger Fabric - Membership Service Provider (MSP)

Hyperledger Fabric — Membership Service Provider (MSP)

Root Certificate Authority (CA)
Issues root certificates
Defines trust anchors
Intermediate CAs
Delegate certificate issuance
Signed by Root CA
Membership Service Provider (MSP)
Defines trusted CAs
Holds admin & signing certs
Contains revocation lists
Defines policies per org/channel
Clients
Submit transactions
Sign proposals with certs
Peers
Endorse transactions
Commit blocks
Verify client signatures
Orderers
Order transactions
Form blocks
Verify org identities
Channel MSP
Defines which orgs participate

MSP Flow

Certificate Hierarchy: Root CA → Intermediate CAs → MSP (trusted CAs) → defines cert & revocation policies

Identity Management: Identities for Clients, Peers, Orderers → Channel MSP governs which orgs can transact and endorse

Key Functions: The MSP validates certificates, manages organizational membership, enforces access policies, and maintains certificate revocation lists to ensure only authorized participants can interact with the blockchain network.

Hyperledger Fabric MSP Explained

What is MSP?

MSP (Membership Service Provider) is the identity manager of Hyperledger Fabric. It ensures every action on the blockchain (transactions, endorsements, ordering) is tied to a verified, permissioned identity. MSP is the trust root of a Fabric network.

Key Functions of MSP
  • Identity Management: Each participant (client, peer, orderer, admin) must have a digital identity based on X.509 certificates.
  • Authentication: Verifies transaction proposals and endorsements using certificates from trusted CAs.
  • Authorization: Defines roles and policies for clients, peers, orderers, and admins.
  • Trust Anchors: Specifies which root CAs are trusted in the network.
MSP Components
  • Root CAs – The ultimate trust authority
  • Intermediate CAs – Delegate certificate issuance
  • Admin Certificates – Define org administrators
  • Signing Certificates – Used to sign transactions
  • Revocation Lists (CRLs) – Manage revoked identities
MSP Identities & Roles
  • Clients – Submit transactions
  • Peers – Endorse & commit
  • Orderers – Order transactions into blocks
  • Admins – Configure network/channel
Local MSP vs Channel MSP
  • Local MSP: Defined for each node (peer, orderer, client); determines node’s identity.
  • Channel MSP: Defined at channel level; determines which organizations can participate in the channel.
Example Flow with MSP
  1. A client submits a transaction proposal.
  2. The proposal is signed with the client’s certificate.
  3. Endorsing peer verifies the signature using MSP rules (trusted CA + policies).
  4. If valid, peer executes chaincode and endorses the transaction.
  5. All peers validate endorsements using MSP rules before committing.
Why MSP is Important
  • Provides security: Only authorized members can participate.
  • Provides flexibility: Different organizations can define their own MSPs.
  • Provides governance: Policies (e.g., “2 out of 3 orgs must endorse”) are enforced through MSP identity checks.

Identity Challenges

Technical Challenges
  • Key Management: Secure key storage and recovery
  • Scalability: Large-scale identity systems
  • Interoperability: Cross-platform identity
  • Revocation: Certificate and credential revocation
  • Privacy: Balancing transparency and privacy
Regulatory Challenges
  • GDPR Compliance: Right to be forgotten
  • KYC/AML: Know your customer requirements
  • Data Sovereignty: Jurisdictional data laws
  • Legal Recognition: Digital identity validity
  • Liability: Identity provider responsibility

Best Practices

Identity System Design Principles

Successful blockchain identity systems follow established security and privacy principles.

Security Best Practices
  • Multi-Factor Authentication: Multiple verification methods
  • Principle of Least Privilege: Minimal necessary access
  • Regular Audits: Access review and cleanup
  • Secure Key Storage: Hardware security modules
  • Certificate Lifecycle: Proper issuance and revocation
Privacy Best Practices
  • Data Minimization: Collect only necessary data
  • Purpose Limitation: Use data for stated purposes
  • Consent Management: Clear user consent
  • Anonymization: Remove identifying information
  • Selective Disclosure: Share minimal attributes

Summary

Key Takeaways
  • Blockchain identity systems provide authentication, authorization, and attribution
  • Different identity models serve different use cases and requirements
  • Self-sovereign identity gives users control over their digital identities
  • Access control policies manage permissions and resource access
  • Privacy-preserving techniques enable identity verification without disclosure
  • Enterprise integration requires careful consideration of existing systems

What's Next?

Next, we'll explore Transaction Validation Lifecycle in blockchain networks.