ULedgerNET Network Architecture
Overview
ULedgerNET implements a decentralized peer-to-peer network using a modular P2P networking stack. This provides robust peer discovery, secure communication, and efficient message propagation.
Network Stack
Peer Discovery
Distributed Hash Table (DHT)
ULedgerNET uses a Distributed Hash Table for peer discovery:
Discovery Flow
Messaging System
Pub/Sub (Gossip Protocol)
The primary mechanism for broadcasting messages across the network:
Message Propagation
Direct Streams
For point-to-point communication (e.g., data sync, timestamp requests):
Network Message Structure
Message Format
Message Types
| Type | Direction | Purpose |
|---|---|---|
MSG_PUBLISH | Broadcast | General pub/sub messages |
MSG_REQUEST_DATA | Direct | Request specific data |
MSG_RESPOND_DATA | Direct | Response to data request |
MSG_REQUEST_TIMESTAMP | Direct | Get peer's timestamp |
MSG_RESPOND_TIMESTAMP | Direct | Return current timestamp |
MSG_REQUEST_TOPICS | Direct | Exchange topic subscriptions |
MSG_RESPOND_TOPICS | Direct | Return subscribed topics |
Timestamping Protocol
Distributed Timestamp Agreement
ULedgerNET uses peer timestamps to establish transaction ordering:
Time Parameters
| Parameter | Value | Description |
|---|---|---|
| Max Peers | 5 | Maximum peers queried for timestamps |
| Timeout | 10s | Timestamp request timeout |
| Max Median Diff | 5s | Maximum allowed time difference |
Node Synchronization
Reconciliation Process
When a new node joins or recovers from a partition:
Sync Request Types
Peer Management
Peer Store
Peer Lifecycle
Connection Handling
New Connection Flow
Disconnection Handling
Network Security
Transport Security
| Feature | Implementation |
|---|---|
| Encryption | TLS 1.3 / Noise Protocol |
| Authentication | Peer ID derived from public key |
| Identity | Ed25519 network keys |
Protocol Security
| Feature | Implementation |
|---|---|
| Message Signing | All blockchain messages signed |
| Replay Protection | Unique request IDs |
| Spam Prevention | Message validation at protocol layer |
Configuration
P2P Configuration
{
"p2pConfig": {
"port": 4001,
"bootstrapPeers": [
"/ip4/x.x.x.x/tcp/4001/p2p/QmXXX...",
"/dnsaddr/bootstrap.uledger.io/p2p/QmYYY..."
],
"dhtServer": true,
"enableRelay": false
}
}
Configuration Parameters
| Parameter | Description | Default |
|---|---|---|
port | P2P listening port | 4001 |
bootstrapPeers | Initial peers for discovery | [] |
dhtServer | Act as DHT server | true |
enableRelay | Enable relay for NAT traversal | false |
Network Topology
Typical Deployment
Next: Smart Contracts & Tokens