Self-Sovereign Identity for the Decentralized Verse.
dverse-identity
is a foundational module within the D-Verse framework, providing robust and secure primitives for managing decentralized identities (DIDs). It empowers users and applications with self-sovereign control over their digital presence, enabling verifiable interactions without reliance on centralized authorities.
- Cryptographic Key Management: Secure generation and handling of Ed25519 key pairs.
- Digital Signing & Verification: Functions for cryptographically signing data and verifying signatures, ensuring data integrity and authenticity.
did:dverse
Method Implementation: Derivation of unique, self-certifyingdid:dverse
identifiers directly from public keys, aligning with W3C DID specifications.- Error Handling: Comprehensive error types for robust application development.
To use dverse-identity
in your Rust project, add it as a dependency in your Cargo.toml
:
[dependencies]
dverse-identity = "0.1.0" # Or specify a git dependency for the latest development version
use dverse_identity::{KeyPair, Did};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// 1. Generate a new KeyPair
let keypair = KeyPair::generate()?;
println!("Generated KeyPair: Public Key: {:?}", keypair.public_key.as_bytes());
// 2. Derive a did:dverse from the Public Key
let did = Did::from_public_key(&keypair.public_key)?;
println!("Derived DID: {}", did.as_str());
// 3. Sign a message
let message = b"Hello, D-Verse! This is my verifiable message.";
let signature = keypair.sign(message)?;
println!("Generated Signature: {:?}", signature);
// 4. Verify the signature using the public key derived from the DID
let recovered_public_key = did.to_public_key()?;
let temp_keypair_for_verification = KeyPair { // Only public key is needed for verification
private_key: dverse_identity::PrivateKey::from_bytes(vec![0; 32]), // Dummy
public_key: recovered_public_key,
};
temp_keypair_for_verification.verify(message, &signature)?;
println!("Signature verified successfully!");
Ok(())
}
To build the dverse-identity
crate, navigate to its root directory and run:
cargo build
Comprehensive unit and integration tests are provided. To run them:
cargo test
We welcome contributions to dverse-identity
! Your involvement helps us build a robust and secure foundation for the D-Verse ecosystem. Please adhere to our Contributor's Guide for general guidelines.
Found a bug or have a feature request? Please open an issue on our GitHub Issues page.
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name
). - Make your changes, ensuring they adhere to our coding style and pass all tests.
- Write clear, concise commit messages.
- Push your branch (
git push origin feature/your-feature-name
). - Open a Pull Request to the
main
branch ofdverse-systems/dverse-identity
.
This project is licensed under the MIT License (or Apache 2.0, TBD). See the LICENSE
file for details.
- GitHub Organization: dverse-systems
- Discord: Join our community