A decentralized peer-to-peer mesh network implementation with cryptographic identities and human-readable handles.
BeeNet is a P2P mesh network that uses Ed25519/X25519 cryptographic identities with a unique "honeytag" system for human-readable identifiers. Each node has a handle in the format <nickname>~<honeytag> where the honeytag is derived from the node's cryptographic identity.
Phase 1 - Minimal Agent Kernel ✅ COMPLETE
- ✅ Daemon lifecycle management with start/stop/retry supervisors
- ✅ CLI with
start,create,status,keygen,handlesubcommands - ✅ Local control API (JSON over TCP)
- ✅ Persistent keystore with secure file permissions
- ✅ Nickname normalization and validation per specification
- ✅ Identity generation and handle computation
- ✅ Comprehensive test coverage
Phase 2 - Transport Layer + Application-Layer Session Security ✅ COMPLETE
- ✅ QUIC transport with TLS 1.3 and ALPN negotiation
- ✅ TCP transport with TLS 1.3 fallback support
- ✅ Noise IK protocol with X25519, ChaCha20-Poly1305, BLAKE3
- ✅ Ed25519 identity binding and signature verification
- ✅ Pre-Shared Key (PSK) authentication (optional)
- ✅ Token-based admission control with Ed25519 signatures
- ✅ Replay protection with sliding window mechanism
- ✅ Double encryption: TLS + Noise IK session security
- ✅ Comprehensive unit and integration testing
- ✅ Production-ready error handling and validation
- Go 1.21 or later
- Git
git clone https://github.com/WebFirstLanguage/beenet.git
cd beenet
make buildThis creates the bee binary in the build/ directory.
./build/bee keygenThis creates a new cryptographic identity and saves it to ~/.bee/identity.json with secure permissions.
./build/bee startThe agent will:
- Load your identity
- Print your BID (Bee ID) and handle
- Start the control API on
127.0.0.1:27777 - Run until interrupted (Ctrl+C)
In another terminal:
./build/bee status./build/bee handlebee keygen- Generate a new cryptographic identitybee start- Start the bee agent daemonbee status- Check if agent is running and show statusbee handle- Display current BID and handlebee create- Create new swarm (not yet implemented)bee version- Show version informationbee help- Show usage information
bee:key:z6Mk<base58-encoded-public-key>
<nickname>~<honeytag>
- Nickname: 3-32 characters,
[a-z0-9-]only, NFKC normalized - Honeytag: 11-character BeeQuint-32 token derived from BID (e.g.,
fopeh-dojof)
BID: bee:key:z6Mkec81c76396c109018ebf134404502ca7
Handle: alice~kapiz-ronit
The agent exposes a local control API on 127.0.0.1:27777 using JSON over TCP.
Returns current agent information:
{
"method": "GetInfo",
"id": "request-id"
}Response:
{
"id": "request-id",
"result": {
"bid": "bee:key:z6Mk...",
"nickname": "alice",
"handle": "alice~kapiz-ronit",
"state": "running"
}
}Sets the agent's nickname:
{
"method": "SetNickname",
"id": "request-id",
"params": {
"nickname": "alice"
}
}Response:
{
"id": "request-id",
"result": {
"nickname": "alice",
"handle": "alice~kapiz-ronit"
}
}# Run all tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Run specific package tests
go test -v ./pkg/identity
go test -v ./pkg/agent
go test -v ./pkg/control
# Run transport and security tests
go test -v ./pkg/transport/...
go test -v ./pkg/security/...
# Run integration tests
go test -v ./pkg/integrationbeenet/
├── cmd/bee/ # CLI application
├── pkg/
│ ├── agent/ # Agent lifecycle and state management
│ ├── control/ # Control API server
│ ├── identity/ # Identity generation and management
│ ├── transport/ # Transport layer (QUIC/TCP with TLS)
│ ├── security/ # Security layer (Noise IK protocol)
│ ├── codec/ # CBOR encoding utilities
│ ├── constants/ # Protocol constants
│ └── wire/ # Wire protocol definitions
├── pkg/integration/ # Integration tests
├── docs/ # Documentation and specifications
├── build/ # Build outputs
└── Makefile # Build automation
- Agent: Manages daemon lifecycle with supervisor pattern
- Identity: Ed25519 key generation, BID computation, honeytag derivation
- Transport: QUIC/TCP transports with TLS 1.3 and ALPN negotiation
- Security: Noise IK protocol with PSK and token-based admission control
- Control API: Local JSON-based API for agent interaction
- CLI: User-facing command-line interface
- Identity Protection: Keys stored in
~/.bee/identity.jsonwith0600permissions - Directory Security: Identity directory created with
0700permissions - Local API Only: Control API is localhost-only by default
- Cryptographic Primitives: Ed25519 signatures, X25519 key exchange
- Transport Security: TLS 1.3 with perfect forward secrecy
- Session Security: Noise IK protocol with ChaCha20-Poly1305 encryption
- Authentication: Optional PSK and Ed25519 token-based admission control
- Replay Protection: Sliding window mechanism with sequence tracking
- Double Encryption: TLS transport + Noise application layer security
- Daemon lifecycle management
- CLI with core subcommands
- Local control API
- Persistent keystore
- Identity and handle generation
- QUIC transport with TLS 1.3 and ALPN negotiation
- TCP transport with TLS 1.3 fallback support
- Noise IK protocol implementation
- Ed25519 identity binding and verification
- Pre-Shared Key (PSK) authentication
- Token-based admission control
- Replay protection and sequence tracking
- Comprehensive testing and documentation
- Distributed Hash Table implementation
- Peer discovery and presence
- Network topology management
- Basic mesh connectivity
- Direct peer messaging
- Message routing
- Delivery guarantees
- Message persistence
- Swarm creation and management
- Group messaging
- Swarm discovery
- Access control
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow TDD practices - write tests first
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Test-Driven Development: All new features must have tests
- Go Standards: Follow standard Go conventions and formatting
- Documentation: Update documentation for user-facing changes
- Commit Messages: Use clear, descriptive commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Protocol Specification: BeeNet Specification
- Phase 2 Implementation: Transport & Security Guide
- API Reference: API Documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/ directory
BeeNet - Building the decentralized future, one bee at a time. 🐝