Quickbeam

November 15, 2025 ยท View on GitHub

quickbeam is a command-line interface tool built using Rust and the Fangorn library. It provides utilities for key management, cryptographic signing, and encrypted file handling (encryption and decryption) leveraging the features of the Fangorn framework.


Features

  • Key Management: Generate and inspect SR25519 cryptographic keys stored in a local keystore.
  • Cryptographic Signing: Sign arbitrary data (currently a nonce) using a key from the local keystore.
  • File Encryption (Encrypt): Encrypt a message file under a specified 'intent' (policy) and register it.
  • File Decryption (Decrypt): Request and perform decryption of an encrypted file using a cryptographic 'witness' that satisfies the original intent.

๐Ÿ› ๏ธ Usage

The application is structured around several subcommands. Use --help on the main command or any subcommand for detailed usage information.

Installation

  1. Ensure you have Rust and Cargo installed.
  2. Clone the repository and build the project:
git clone <repository-url>
cd quickbeam
cargo build --release
# The executable will be available at target/release/quickbeam

Key Management Commands

Key Generation

Generates a new SR25519 key and saves it to the specified keystore directory.

quickbeam keygen --keystore-dir /path/to/keystore

Key Inspection

Lists the keys (as SS58 addresses) currently stored in the specified keystore directory.

quickbeam inspect --keystore-dir /path/to/keystore

Signing

Signs a specified 32-bit nonce using the first key found in the keystore.

quickbeam sign --keystore-dir /path/to/keystore --nonce 12345

Encryption and Decryption Commands

These commands interface with both Fangorn and require a running substrate-node (where the iris contract is deployed).

Encrypt

Encrypts a plaintext message under a specific intent/policy.

ArgumentDescription
--message_pathPath to the plaintext file to encrypt.
--filenameThe filename to assign to the intent when registered.
--config_pathPath to the file containing KZG parameters (Fangorn configuration - autogenerated).
--keystore-dirPath to the keystore.
--intentThe condition under which the message is encrypted.
--contract_addrThe address of the iris contract.
quickbeam encrypt \
    --message_path ./my_secret.txt \
    --filename "secret_doc_2025" \
    --config_path ./config.config \
    --keystore-dir /path/to/keystore \
    --intent "Password(strong_password)" \
    --contract_addr 0x...

Decrypt

Requests and performs the decryption of an encrypted file.

ArgumentDescription
--config_pathPath to the directory of the KZG parameters (Fangorn config - autogenerated).
--filenameThe logical filename/identifier of the encrypted document (in iris).
--witnessA plaintext "witness" that satisfies the encryption intent/policy.
--pt_filenameThe name of the file to write the decrypted plaintext to.
--contract_addrThe address of the iris contract.
quickbeam decrypt \
    --config_path ./config.config \
    --filename "secret_doc_2025" \
    --witness "strong_password" \
    --pt_filename ./decrypted_secret.txt \
    --contract_addr 0x...