The Smash Neighborhood Admin Bot (NAB) is part of the Smash Protocol, a decentralized, secure system designed to give users control over their data, communication, and interactions. NAB helps manage communities, called Smash Neighborhoods, by guiding users, facilitating interactions, and ensuring secure, peer-to-peer connections.
This repository contains a demo implementation of a NAB based on the Smash Node Library.
The Smash Protocol is a decentralized communication system where users:
- Control their own data.
- Communicate privately through end-to-end encryption.
- Use cryptographic identities (DIDs) to maintain privacy and trust.
Neighborhoods are communities where people connect, interact, and build trust without centralized control or interference. Smash ensures that no single authority controls your interactions or data.
-
Decentralized Identity: NAB manages its DID securely using Hardware Security Modules (HSM), ensuring privacy and data protection.
-
Neighborhood Management: NAB handles user onboarding, manages community interactions, and maintains the neighborhood's integrity.
-
Smash/Pass/Block interactions: NAB handles smash/pass action to build the local user graph.
-
Graph Visualization: Optionally, the user network can be visualized as a graph, displaying connections between users in a clear, visual way.
-
Initialization:
- Loads necessary configurations and settings from environment variables.
- Sets up cryptographic components using Hardware Security Modules (HSM) for secure identity management.
-
Identity Management:
- NAB reads and manages its identity through a secure file and keeps cryptographic keys safe using HSM.
-
Network Setup:
- Sets up secure messaging endpoints for peer-to-peer (P2P) communication.
- Prepares the network for users to join and interact within the neighborhood.
-
User Interactions:
- NAB assists users in joining the neighborhood and interacting with others.
- It manages badges, reputation, and helps maintain a healthy community environment.
-
Graph Visualization (optional):
- There’s an option to visualize the user network as a graph, displaying connections between users in a clear, visual way.
To start using the Smash NAB:
- Set up environment variables:
Get examples in the .env.example file.
- `HSM_CONFIG`: Hardware Security Module settings.
- `NAB_ID_FILEPATH`: Path to the file containing NAB’s identity.
- `SME_CONFIG`: Configuration for the messaging engine.
- `NAB_META`: Metadata for the NAB.
-
Install dependencies:
npm install
-
Run the bot:
npm run generate-id npm start
NAB will now manage the example neighborhood and facilitate user interactions!
- TypeScript is used for development.
- ESLint and Prettier ensure clean, readable, and well-formatted code.
- The project uses Devcontainers for a consistent development environment.
Check out the parent project (simple neighborhood) for a complete example of a Neighborhood deployment (using Docker Compose) including this NAB and additional providers (Smash Messaging Endpoint, DNS server, etc).
Browse open issues. or, start contributing today!
We love contributions! If you'd like to improve this project, please:
- Follow coding standards enforced by ESLint and Prettier.
- If you modify the Smash Protocol, ensure your work is open-sourced according to the Smash License.
Read more on contributing to the Smash Protocol here.
- Smash Protocol
- Smash Principles and Values
The project uses Devcontainers for a consistent development environment.
-
Install required libraries:
apt-get update apt-get install -y --no-install-recommends git openssl sqlite3 libp11-kit-dev automake autoconf libtool pkg-config
-
Set up SoftHSMv2 for cryptographic operations:
git clone https://github.com/opendnssec/SoftHSMv2.git /tmp/softhsm2 cd /tmp/softhsm2 sh autogen.sh ./configure --prefix=/usr/local --with-crypto-backend=openssl make sudo make install mkdir -p /usr/local/var/lib/softhsm/tokens/
For more information on cryptographic dependencies, visit:
All contributions to Smash-Simple-Neighborhood are made under our extended AGPL-3.0 License. By contributing, you agree to license your work under these terms.
By using this repository, you agree to the terms of the Smash License.
Any changes or derived projects MUST be open-sourced under a compatible license.