A blockchain-based data integrity and timestamping system built on Bitcoin SV. Truth Machine provides immutable proof of data existence and integrity by recording cryptographic hashes on the blockchain.
- Secure File Storage: Upload files with blockchain-backed integrity verification
- Timestamping: Immutable proof of data existence at a specific time
- Integrity Verification: Download files with cryptographic proof of integrity
- BEEF Integration: Background Evaluation Extended Format for complete transaction verification
- Treasury Management: Built-in token system for managing transaction fees
- QR Code Support: Easy funding through QR code scanning
- Modern Web Interface: User-friendly React-based frontend
- Modern React application with TypeScript
- Real-time treasury balance monitoring
- Intuitive file upload/download interface
- QR code generation for funding
- RESTful API endpoints for file operations
- BEEF transaction format support
- Blockchain integration via WhatsOnChain
- MongoDB for file and transaction storage
Prerequisites are the latest versions of docker compose and node.js - start.sh script assumes a macOS / unix starting point.
Clone the repository, and run the quickstart script:
git clone https://github.com/bitcoin-sv/truth-machine.git
cd truth-machine
sh quickstart.sh
This will navigate to front and back installing deps and creating local keys, adding them to the .env and your docker-compose.yml before launching it.
One thing which you may want to manually update is a reverse proxy to send your API at port 3030 the ARC callbacks. For this we recommend running ngrok locally and updating the DOMAIN env variable in the docker-compose.yml to the URL that will generate.
Run
ngrok http 3030
Then copy paste the public domain that attaches to into the .env or docker-compose.yml - whichever you're running.
Stop the services with [ Ctrl ] + [ C ] or
docker compose down
Whenever you want to restart the services without destroying your env post setup, just run this instead:
docker compose up
- Start the backend:
cd back
npm run dev
- Start the frontend:
cd front
npm run dev
- Build and start the backend:
cd back
npm run build
npm run start
- Build and serve the frontend:
cd front
npm run build
npm run preview
Build the images locally:
docker compose build
Run the containers:
docker compose up
- Access the Treasury section to view current balance
- Scan the QR code to fund the treasury with BSV
- Create write tokens for file uploads (1 token per upload)
- Navigate to the Upload section
- Select a file to upload
- System will:
- Calculate file hash
- Create blockchain transaction
- Store file securely
- Return transaction ID and proof
- Navigate to the Download section
- Enter the file hash or transaction ID
- Receive:
- Original file
- Timestamp proof
- Integrity verification
- BEEF transaction data
POST /api/upload
- Upload and timestamp fileGET /api/download/:hash
- Download file with proofsGET /api/verify/:hash
- Verify file integrity
GET /api/checkTreasury
- Get treasury statusPOST /api/fund/:tokens
- Create write tokens
- BEEF Format: Complete transaction verification
- SPV Proofs: Simplified Payment Verification
- Hash Verification: SHA-256 file integrity checking
- Immutable Timestamping: Blockchain-backed time proofs
- Node.js 18+
- MongoDB 4.4+
- BSV wallet for testing
# Run backend tests
cd back
npm test
# Run frontend tests
cd front
npm test
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- GitHub Issues: Create an issue
- Documentation: Wiki
- Bitcoin SV community
- WhatsOnChain API
- BEEF specification contributors