contacts

Manage PSK (pre-shared key) contacts for encrypted messaging.

can contacts <SUBCOMMAND>

Subcommands

list

List all contacts.

can contacts list

add

Add a new contact.

can contacts add --name <NAME> --address <ALGO_ADDRESS> --psk <KEY> [--force]
FlagDescription
--nameContact name (used for addressing in send and inbox)
--addressContact's Algorand address (58 chars)
--pskPre-shared key: 64-char hex or 44-char base64
--forceOverwrite if contact already exists

remove

Remove a contact by name.

can contacts remove <NAME>

export

Export all contacts to JSON.

can contacts export [--output <FILE>]

Without --output, prints to stdout.

import

Import contacts from a JSON file.

can contacts import <FILE>

PSK Format

Pre-shared keys can be provided as:

  • Hex: 64 characters (32 bytes encoded as hex)
  • Base64: 44 characters (32 bytes encoded as base64)

Examples

# Add a contact with hex PSK
can contacts add --name alice --address ALICE... --psk aabbccdd...

# Add with base64 PSK
can contacts add --name bob --address BOB... --psk dGhpcyBpcyBhIHRlc3Qga2V5...

# List all contacts
can contacts list

# Backup and restore
can contacts export --output backup.json
can contacts import backup.json