This is a private repository. Access is strictly limited to authorized individuals who have been explicitly granted permission by the project maintainers.
The Has-Needs Protocol is a proprietary system for managing and coordinating resources through a decentralized network. This project includes a 3D globe interface for visualizing and interacting with resource data.
- Status: Private and invite-only
- Contributions: Currently closed to external contributions
- Issues: Limited to invited participants for discussion
- Code Review: Conducted internally by the core team
For authorized contributors, see GETTING_STARTED.md for development setup instructions.
Please report any security issues to security@has-needs.org. Do not create public issues for security vulnerabilities.
import { HasNeedsNode } from 'has-needs-protocol';
// Create and start a node
const node = new HasNeedsNode({
port: 3000,
meshPort: 4001
});
await node.initialize();
await node.start();
// Create a Need
const need = await node.protocol.createNeed(
'community-center',
'Emergency blankets',
{
urgency: 'high',
location: { lat: 37.7749, lng: -122.4194 },
expires: Date.now() + 24 * 60 * 60 * 1000
}
);
// Create a Has (offering)
const has = await node.protocol.createHas(
'relief-org',
'Thermal blankets',
{
availability: 'available',
quantity: 100
}
);
// Listen for matches
node.protocol.on('match:found', ({ need, has }) => {
console.log('Match found!', { need: need.object, has: has.object });
});- Protocol Layer: Triplet data model, validation, consensus
- Network Layer: Jitterbug topology, mesh routing, peer discovery
- Overlays Layer: Knowledge sharing, access control, sovereignty
- Identity Layer: Cryptographic keys, sovereign identity management
Every interaction is captured as a triplet with three core relations:
has: Entity possesses/controls and offers somethingneeds: Entity expresses a requirement/requestcommitted: Mutual entry into a contract/agreement
// Example triplet
{
id: "triplet_12345",
entity: "alice@community.org",
relation: "needs",
object: "emergency shelter",
context: {
location: { lat: 37.7749, lng: -122.4194 },
urgency: "high",
expires: 1640995200000
},
creator: "node_alice_1",
timestamp: 1640908800000,
validated: true
}This project is proprietary and confidential. All rights reserved. See LICENSE for more information.
// Create triplets
await protocol.createNeed(entity, resource, context)
await protocol.createHas(entity, resource, context)
await protocol.createCommitted(needTriplet, hasTriplet, agreement)
// Query system
const needs = protocol.getAllNeeds()
const has = protocol.getAllHas()
const triplets = protocol.queryTriplets(filter)
// Get information
const info = await protocol.getProtocolInfo()// Messaging
await network.broadcast(topic, data)
await network.sendToPeer(peerId, topic, data)
// Network state
const info = await network.getNetworkInfo()
const peers = network.getPeersInfo()// Create overlays
const overlay = await overlays.createOverlay(type, data, options)
// Query overlays
const results = await overlays.queryOverlays(criteria)
// Share knowledge
await overlays.shareOverlay(overlayId, entities, permissions)# Install dependencies
npm install
# Start development network (3 nodes)
npm run dev
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint code
npm run lint
# Format code
npm run formatsrc/
βββ protocol/ # Core protocol implementation
β βββ triplets/ # Triplet data structures
β βββ validation/ # Validation engine
β βββ consensus/ # Consensus mechanisms
βββ network/ # Mesh networking layer
β βββ topology/ # Jitterbug topology
β βββ routing/ # Mesh routing
βββ overlays/ # Knowledge overlays
βββ identity/ # Identity management
βββ utils/ # Shared utilities
tests/ # Test suite
examples/ # Usage examples
scripts/ # Development scripts
docs/ # Documentation
# Basic protocol usage
node examples/basic-usage.js
# Development network (3 nodes)
node scripts/dev.js
# Emergency response scenario
node examples/emergency-response.js// Disaster coordination
const need = await protocol.createNeed(
'evacuation-center',
'Medical supplies',
{
urgency: 'critical',
location: { lat: 34.0522, lng: -118.2437 },
requiredBy: Date.now() + 2 * 60 * 60 * 1000 // 2 hours
}
);// Resource sharing
const has = await protocol.createHas(
'community-workshop',
'Power tools',
{
availability: 'available',
conditions: {
returnBy: 'end-of-day',
skillLevel: 'basic-training-required'
}
}
);// Share expertise
const knowledgeOverlay = await overlays.createOverlay(
'knowledge',
{
expertise: 'permaculture-design',
content: 'Water harvesting techniques for arid climates',
validatedBy: 'indigenous-council'
},
{
accessLevel: 'community',
shareableWith: ['water-management-groups']
}
);- Zero-Knowledge Proofs: Validate without revealing private data
- Cryptographic Signatures: All triplets are cryptographically signed
- Granular Access Control: Fine-grained permissions for knowledge sharing
- Sovereign Data: No central authority can access private information
- Ephemeral Validation: Context-bound verification without persistent scoring
- Scalability: Handles thousands of nodes with jitterbug topology
- Latency: Sub-second triplet validation and matching
- Resilience: Self-healing network adapts to 50%+ node failures
- Efficiency: Minimal resource usage with purpose-built architecture
For access requests or questions, please contact: contact@has-needs.org
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- Submit a pull request
- ES modules (import/export)
- Modern JavaScript (ES2022+)
- Functional programming patterns
- Comprehensive error handling
- Extensive logging and debugging
This project is private and confidential. See PRIVACY.md for more information about access controls and data handling.