A production-ready NIP-05 registry service for Nostr with persistent storage, REST API, admin dashboard, and domain verification.
- NIP-05 Compliant - Serves
.well-known/nostr.jsonper the NIP-05 specification - REST API - Full CRUD operations for NIP-05 records and domains
- Admin Dashboard - Web-based management UI with Thymeleaf + HTMX + Tailwind CSS
- Domain Verification - DNS TXT and well-known file verification methods
- External Verification - Verify external NIP-05 identifiers with caching
- nsecbunker-java Integration - Spring Boot starter for embedding
- Production Ready - PostgreSQL support, Docker deployment, security
- Clone the repository:
git clone https://github.com/tcheeric/bottin.git
cd bottin- Create environment file:
cat > .env << EOF
BOTTIN_DATABASE_PASSWORD=your-secure-password
BOTTIN_ADMIN_PASSWORD=your-admin-password
EOF- Start the services:
docker-compose up -d- Access the services:
- Admin Dashboard: http://localhost:8080/admin
- API Docs: http://localhost:8080/swagger-ui.html (if enabled)
- Well-Known: http://localhost:8080/.well-known/nostr.json
-
Prerequisites:
- Java 21
- Maven 3.8+
-
Run with H2 database:
mvn spring-boot:run -pl bottin-web- Access H2 Console at http://localhost:8080/h2-console
The REST API provides:
- NIP-05 Resolution: Public
/.well-known/nostr.jsonendpoint - Records Management: CRUD operations for NIP-05 identities
- Domain Management: Register and verify domains
- External Verification: Verify third-party NIP-05 identifiers
See the REST API Reference for complete endpoint documentation.
| Variable | Default | Description |
|---|---|---|
BOTTIN_PORT |
8080 | Server port |
BOTTIN_DATABASE_URL |
H2 memory | JDBC URL |
BOTTIN_DATABASE_USER |
bottin | Database username |
BOTTIN_DATABASE_PASSWORD |
- | Database password |
BOTTIN_ADMIN_USER |
admin | Admin username |
BOTTIN_ADMIN_PASSWORD |
- | Admin password |
BOTTIN_DEFAULT_DOMAIN |
- | Default domain for records |
BOTTIN_API_DOCS_ENABLED |
false | Enable API docs in production |
bottin:
enabled: true
admin:
enabled: true
verification:
dns-timeout-seconds: 5
http-timeout-seconds: 10
cache:
ttl-minutes: 5
max-size: 1000
ratelimit:
requests-per-minute: 30- Register domain via API or admin dashboard
- Add TXT record to
_bottin-verification.yourdomain.com:bottin-verification=<your-verification-token> - Trigger verification check (DNS propagation may take up to 24 hours)
- Register domain via API or admin dashboard
- Create file at
https://yourdomain.com/.well-known/bottin-verification.txt - Add the exact verification token as file contents
- Trigger verification check
Add the Spring Boot starter to your project:
<dependency>
<groupId>xyz.tcheeric</groupId>
<artifactId>bottin-spring-boot-starter</artifactId>
<version>0.1.0</version>
</dependency>This automatically provides:
Nip05Managerimplementation (database-backed)AccountManagerimplementation- All bottin services and endpoints
Example usage:
@Service
@RequiredArgsConstructor
public class UserService {
private final Nip05Manager nip05Manager;
public void createUser(String username, String domain) {
nip05Manager.setupNip05(username, domain)
.thenAccept(record ->
log.info("Created NIP-05: {}", record.getNip05()));
}
}bottin/
├── bottin-core/ # Domain models, interfaces, exceptions
├── bottin-persistence/ # JPA entities, repositories
├── bottin-service/ # Business logic
├── bottin-web/ # REST controllers, well-known endpoint
├── bottin-admin-ui/ # Admin dashboard (Thymeleaf)
├── bottin-verification/ # Domain & external NIP-05 verification
├── bottin-spring-boot-starter/ # Auto-configuration for embedding
└── bottin-tests/ # Integration and E2E tests
├── bottin-it/ # Integration tests
└── bottin-e2e/ # End-to-end tests with Testcontainers
# Compile
mvn compile
# Run unit tests
mvn test
# Run all tests and build
mvn verify
# Package
mvn packageE2E and integration tests are skipped by default and require explicit activation:
# Run E2E tests (requires Docker for Testcontainers)
mvn -Pe2e -DskipE2ETests=false -pl bottin-tests/bottin-e2e test
# Run integration tests
mvn -Pit -pl bottin-tests/bottin-it testBuild Docker images using Jib:
# Build to local Docker daemon
mvn jib:dockerBuild -pl bottin-web,bottin-admin-ui
# Deploy to Maven repo and push Docker images to registry
mvn deploy
# Push to registry without deploying Maven artifacts
mvn jib:build -pl bottin-web,bottin-admin-uiImages are published to docker.398ja.xyz:
docker.398ja.xyz/bottin-web:0.1.0/latestdocker.398ja.xyz/bottin-admin-ui:0.1.0/latest
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Run tests:
mvn verify - Submit a pull request
- nsecbunker-java - Key management
- nostr-java - Nostr protocol library