A Holiday themed example of using the Tari Hidden Address Protocol.
Compiled into the app is a list of 24 encrypted Tari Addresses, along with their view keys. Each day I'll be posting a riddle (or password if I'm lazy) on my twitter/x. Use this password to
decrypt the address for the day using tari-advent open. This will do two things:
- Expose the address to send a message as proof that you opened it.
- Note: Please don't send more than 0.000001 XTM. I'm not trying to collect any funds here.
- Create a view-only wallet for the day that scans and lists messages from other users that have opened it.
The first message for each day will be a badly autogenerated cheesy haiku.
Note this repo implements the Tari Hidden Address Protocol, so please take some time to read how it works.
- 24 daily encrypted wallet view keys(one for each day of advent)
- Password-protected encryption using XChaCha20Poly1305
- Automatic readonly wallet import and blockchain scanning
- QR code generation for easy wallet sharing
- Progress tracking of unlocked days
- Visual calendar interface
- Minotari executable (wallet client)
- Windows, macOS, or Linux
Download the latest release for your platform from the Releases page:
- Windows:
tari-advent-windows-x86_64.zip - Linux (glibc):
tari-advent-linux-x86_64.tar.gz - Linux (musl):
tari-advent-linux-x86_64-musl.tar.gz - macOS (Intel):
tari-advent-macos-x86_64.tar.gz - macOS (Apple Silicon):
tari-advent-macos-aarch64.tar.gz
Extract the archive and run the executable.
Requirements:
- Rust 2024 edition or later
- Clone the repository:
git clone <repository-url>
cd tari-advent- Set the SQLX offline mode environment variable:
# PowerShell (Windows)
$env:SQLX_OFFLINE="true"
# Bash (Linux/macOS)
export SQLX_OFFLINE="true"- Build the project:
cargo build --releaseThe compiled binary will be available at target/release/tari-advent (or tari-advent.exe on Windows).
View all 24 days and their unlock status in a grid format:
tari-advent listFor detailed view with encrypted data:
tari-advent list --longUnlock a specific day with a password:
tari-advent open <day> <password>Interactive mode (prompts for day and password):
tari-advent openWith custom minotari executable path:
tari-advent open --executable /path/to/minotariSkip blockchain scanning (faster, but won't retrieve new messages):
tari-advent open <day> <password> --no-scanDisplay wallet details and messages for an already-unlocked day:
tari-advent show <day>Interactive mode:
tari-advent showSkip blockchain scanning (faster, but won't retrieve new messages):
tari-advent show <day> --no-scanScan all unlocked doors and display their messages in one command:
tari-advent scan-all-openThis command will:
- Find all previously unlocked days
- Scan the blockchain for each wallet
- Display the wallet address and all messages for each day
With custom minotari executable path:
tari-advent scan-all-open --executable /path/to/minotariGenerate 24 encrypted wallet addresses from a CSV of passwords:
tari-advent generate passwords.csv output/ --executable /path/to/minotariOptions:
--column <N>: Specify which CSV column contains passwords (default: 0)
This command will:
- Generate 24 wallet addresses using the minotari executable
- Encrypt each with its corresponding password
- Output individual JSON files for each day
- Create
all.csvwith plaintext keys (for backup) - Create
encrypted_days.csv(embedded in the application)
-
Encryption: Each day's wallet keys (view key and spend key) are encrypted using XChaCha20Poly1305 with a password-derived key (SHA-256).
-
Unlocking: When you provide the correct password, the application:
- Decrypts the wallet keys
- Imports the keys into a local SQLite wallet database
- Scans the Tari blockchain for transactions
- Displays the wallet address as a QR code
- Shows any messages sent to that wallet
-
Data Storage:
- Unlocked days and passwords are saved to
%APPDATA%/tari-advent/unlocked.json(Windows) or~/.local/share/tari-advent/unlocked.json(Linux/macOS) - Wallet databases are stored in
%APPDATA%/tari-advent/wallets/(Windows) or~/.local/share/tari-advent/wallets/(Linux/macOS)
- Unlocked days and passwords are saved to
tari-advent/
├── src/
│ ├── main.rs # Main CLI logic and commands
│ ├── wallet_client.rs # Wallet client interface
│ └── encrypted_days.csv # Encrypted wallet data
├── Cargo.toml # Project dependencies
└── README.md # This file
Key dependencies include:
clap- Command-line argument parsingchacha20poly1305- Encryptiontari_common_types- Tari address typesrusqlite- Wallet database accessqrcode- QR code generationtokio- Async runtime
- Passwords are used to derive encryption keys via SHA-256
- Encrypted data uses XChaCha20Poly1305 authenticated encryption
- Wallet databases are created with the password "password1" (hardcoded for simplicity)
- The
all.csvfile generated during address creation contains plaintext keys and should be stored securely
You must set SQLX_OFFLINE="true" when compiling:
# PowerShell
$env:SQLX_OFFLINE="true"
cargo build --release
# Bash
export SQLX_OFFLINE="true"
cargo build --releaseSee repository for license information.
Contributions are welcome! Please open an issue or pull request.
To create a new release:
- Update the version in Cargo.toml
- Commit the changes
- Create and push a tag:
git tag v0.1.0 git push origin v0.1.0
- GitHub Actions will automatically:
- Build binaries for Windows, Linux (glibc and musl), and macOS (Intel and Apple Silicon)
- Create a GitHub release
- Upload all binaries to the release