Extropia is a Rust library that implements the Extropia Network standards, providing a foundation for building Extropia nodes. It focuses on secure authentication and pluggable service architecture, allowing for extensible and modular network functionality.
- Secure Authentication: Built-in cryptographic key management and authentication
- Pluggable Services: Modular architecture for adding new network services
- Code Chain Management: Hierarchical key derivation for services and accounts
- Event System: Observable state changes and operations
The authentication system is built on hierarchical deterministic key derivation, allowing:
- Master key generation and management
- Account key derivation
- Service-specific key derivation
- Secure message signing and verification
Services in Extropia are modular and pluggable, each with:
- Unique chain code for key derivation
- Independent state management
- Custom functionality
- Standardized interface
-
Webcash Service (Chain Code: 1000)
- Digital cash implementation
- Transaction management
-
Bitcoin Service (Chain Code: 2000)
- Bitcoin network integration
- Key management for Bitcoin operations
-
RGB Service (Chain Code: 3000)
- RGB Protocol implementation
- Smart asset management
-
OS4 Service (Chain Code: 4000)
- Operating system integration
- System resource management
To create a new pluggable service:
- Create a new crate in the
services
directory:
mkdir -p services/your-service-name/src
- Define your service's Cargo.toml:
[package]
name = "your-service-name"
version.workspace = true
description = "Your Service Description"
# ... other workspace metadata
[dependencies]
extropia = { path = "../.." }
serde = { version = "1.0", features = ["derive"] }
serde_json.workspace = true
thiserror.workspace = true
- Implement the service (in
src/lib.rs
):
use extropia::service::ServiceCodeChain;
use serde::{Serialize, Deserialize};
pub const YOUR_CHAIN_CODE: u32 = XXXX; // Unique chain code
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct YourService {
name: String,
chain_code: u32,
depth: u32,
}
impl YourService {
pub fn new() -> Self {
Self {
name: "your-service".to_string(),
chain_code: YOUR_CHAIN_CODE,
depth: 0,
}
}
}
impl ServiceCodeChain for YourService {
// Implement required trait methods
}
- Add your service to the workspace in root
Cargo.toml
:
[workspace]
members = [
# ...
"services/your-service-name"
]
- Register your service in the CLI for easy management.
The extroctl
CLI tool provides management capabilities:
# Initialize a new code chain
extroctl init --path ./master.json
# Register services
extroctl service --state ./master.json register-webcash
extroctl service --state ./master.json register-bitcoin
extroctl service --state ./master.json register-rgb
extroctl service --state ./master.json register-os4
# List registered services
extroctl service --state ./master.json list
# Manage accounts
extroctl account --state ./master.json get --index 0
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Licensed under the BSD-3-Clause License. See LICENSE file for details.