https://github.com/energychain/tydids-core
A JavaScript library that empowers user defined Self-Sovereign Identity & Consent Management.
https://github.com/energychain/tydids-core
did eid ethersjs identity-management javascript javascript-framework nodejs ssi
Last synced: 3 months ago
JSON representation
A JavaScript library that empowers user defined Self-Sovereign Identity & Consent Management.
- Host: GitHub
- URL: https://github.com/energychain/tydids-core
- Owner: energychain
- License: apache-2.0
- Created: 2024-07-29T09:08:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T05:23:53.000Z (almost 2 years ago)
- Last Synced: 2026-01-15T07:40:36.637Z (5 months ago)
- Topics: did, eid, ethersjs, identity-management, javascript, javascript-framework, nodejs, ssi
- Language: JavaScript
- Homepage: https://corrently.io/books/tydids
- Size: 1.41 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.DataIdentity.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# DataIdentity Class
The `DataIdentity` class is a JavaScript implementation that provides a mechanism for creating, managing, and verifying digital identities on a blockchain. It leverages a secure element to generate cryptographic keys and sign data, ensuring the authenticity and integrity of the created identity.
## Key Features
- **Identity Generation**: Creates a new, random identity with a corresponding private key on a secure element.
- **Payload Signing**: Signs arbitrary payloads with the private key associated with the identity.
- **Identity Publication**: Publishes the identity on a blockchain using a smart contract.
- **Identity Verification**: Verifies the publication status of an identity.
- **Identity Revocation**: Revokes a previously published identity via a smart contract.
- **Identity Disclosure**: Reveals the identity, private key, signature, and payload.
## Use Cases
- **Self-Sovereign Identity (SSI)**: The class can be used to create and manage decentralized identities that are independent of central authorities.
- **Authentication**: The identity can serve as the foundation for an authentication system, for example, to access resources or services.
- **Data Integrity**: The signature of the payload can be used to ensure the integrity of data.
- **Non-repudiation**: The published identity can serve as proof of the creation of a specific data signature.
## Methods
- `constructor(payload)`: Initializes a new instance of the `DataIdentity` class with the given payload.
- `#initSecureElement()`: Initializes the secure element and generates a new identity with a corresponding private key.
- `async consensus()`: Signs the payload with the private key associated with the identity.
- `async publish()`: Publishes the identity on a blockchain using a smart contract.
- `async isPublishedAt()`: Checks if the identity is published on the blockchain.
- `async revoke()`: Revokes a previously published identity via a smart contract.
- `async isRevokedAt()`: Checks if the identity is revoked on the blockchain.
- `async reveal()`: Returns the SSI and flushes the secure element.
## Dependencies
- [ethers.js](https://docs.ethers.io/v5/): A complete Ethereum wallet implementation and utilities in JavaScript.
- `./Env.js`: A module that provides environment variables such as the RPC URL and smart contract addresses and ABIs.