Skip to content

stringhandler/tari-advent2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tari Advent Calendar 2025

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:

  1. Expose the address to send a message as proof that you opened it.
    1. Note: Please don't send more than 0.000001 XTM. I'm not trying to collect any funds here.
  2. 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.

image

Features

  • 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

Installation

Prerequisites

  • Minotari executable (wallet client)
  • Windows, macOS, or Linux

Download Pre-built Binaries

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.

Building from Source

Requirements:

  • Rust 2024 edition or later
  1. Clone the repository:
git clone <repository-url>
cd tari-advent
  1. Set the SQLX offline mode environment variable:
# PowerShell (Windows)
$env:SQLX_OFFLINE="true"

# Bash (Linux/macOS)
export SQLX_OFFLINE="true"
  1. Build the project:
cargo build --release

The compiled binary will be available at target/release/tari-advent (or tari-advent.exe on Windows).

Usage

List All Days

View all 24 days and their unlock status in a grid format:

tari-advent list

For detailed view with encrypted data:

tari-advent list --long

Open a Door

Unlock a specific day with a password:

tari-advent open <day> <password>

Interactive mode (prompts for day and password):

tari-advent open

With custom minotari executable path:

tari-advent open --executable /path/to/minotari

Skip blockchain scanning (faster, but won't retrieve new messages):

tari-advent open <day> <password> --no-scan

Show Wallet Information

Display wallet details and messages for an already-unlocked day:

tari-advent show <day>

Interactive mode:

tari-advent show

Skip blockchain scanning (faster, but won't retrieve new messages):

tari-advent show <day> --no-scan

Scan All Unlocked Doors

Scan all unlocked doors and display their messages in one command:

tari-advent scan-all-open

This 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/minotari

Generate Addresses (Admin)

Generate 24 encrypted wallet addresses from a CSV of passwords:

tari-advent generate passwords.csv output/ --executable /path/to/minotari

Options:

  • --column <N>: Specify which CSV column contains passwords (default: 0)

This command will:

  1. Generate 24 wallet addresses using the minotari executable
  2. Encrypt each with its corresponding password
  3. Output individual JSON files for each day
  4. Create all.csv with plaintext keys (for backup)
  5. Create encrypted_days.csv (embedded in the application)

How It Works

  1. Encryption: Each day's wallet keys (view key and spend key) are encrypted using XChaCha20Poly1305 with a password-derived key (SHA-256).

  2. 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
  3. 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)

Project Structure

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

Dependencies

Key dependencies include:

  • clap - Command-line argument parsing
  • chacha20poly1305 - Encryption
  • tari_common_types - Tari address types
  • rusqlite - Wallet database access
  • qrcode - QR code generation
  • tokio - Async runtime

Security Notes

  • 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.csv file generated during address creation contains plaintext keys and should be stored securely

Compilation Note

You must set SQLX_OFFLINE="true" when compiling:

# PowerShell
$env:SQLX_OFFLINE="true"
cargo build --release

# Bash
export SQLX_OFFLINE="true"
cargo build --release

License

See repository for license information.

Contributing

Contributions are welcome! Please open an issue or pull request.

Creating a Release

To create a new release:

  1. Update the version in Cargo.toml
  2. Commit the changes
  3. Create and push a tag:
    git tag v0.1.0
    git push origin v0.1.0
  4. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages