A command-line interface for interacting with the Zaphenath smart contract — a protocol for secure, time-locked data access based on user inactivity.
- Rust
- An Ethereum-compatible RPC endpoint (e.g., Anvil, Infura)
- A deployed Zaphenath contract (or use
--mockmode for local testing)
git clone https://github.com/Astervia/zaphenath-cli-client.git
cd zaphenath-cli-client
cargo build --releasecargo install --path .Once installed, you can invoke the CLI via:
zaph --helpZaphenath is a Solidity-based smart contract system for securely storing and revealing sensitive data (like wills, contingency plans, or secrets) after a period of user inactivity.
The core logic is based on:
- Encrypted data keys linked to an owner
- Timeouts that define when custodians may access data
- Pings to prove liveness and keep data private
- Role-based access control for delegated custody
zaph <COMMAND> [OPTIONS]| Command | Description |
|---|---|
config |
Manage local configuration and key metadata |
contract |
Interact directly with the smart contract |
daemon |
Run a background service to auto-ping keys |
zaph config initThis creates a local config file (e.g., ~/.config/zaphenath/config.json) used for storing key metadata.
zaph contract create-key \
--key-id my-will \
--data deadbeefcafebabe \
--timeout 604800 \
--contract-address 0xYourZaphenathAddress \
--private-key-path ./my-key.hex \
--rpc-url http://localhost:8545 \
--yes--datais a hex-encoded string (your encrypted payload)--timeoutis in seconds (e.g. 7 days = 604800)
zaph contract ping-key --key-id my-will --yeszaph contract read-key --key-id my-will --decodeUse --decode to attempt UTF-8 decoding of the hex data.
zaph contract set-custodian \
--key-id my-will \
--user-address 0xFriend \
--role Reader \
--can-ping trueThe daemon can automatically ping all keys in your config on a schedule:
zaph daemon run --interval 60zaph daemon run --interval 60 --detachedzaph daemon stopzaph daemon logsThe config file stores keys you've created or imported. Each entry contains:
{
"key_id": "my-will",
"owner": "0xYourAddress",
"contract_address": "0x...",
"private_key_path": "./my-key.hex",
"network": "anvil",
"rpc_url": "http://localhost:8545",
"timeout": 604800,
"custodians": [],
"last_ping_timestamp": 1721019123
}You can override the config path with:
zaph --config /path/to/custom_config.json ...Use --mock to skip actual blockchain interaction and simulate behavior:
zaph contract create-key --mock ...
zaph daemon run --mock ....
├── src
│ ├── main.rs # CLI entrypoint
│ ├── cmd/ # CLI command implementations
│ ├── contract/ # Ethereum interaction logic
│ ├── config.rs # Config loading/saving
│ └── ...
├── abi/Zaphenath.json # ABI definition
├── tests/ # Integration tests
├── Makefile # Dev/test helpers
└── Cargo.toml
- Always use a private key stored securely (consider using encrypted keystores)
- Back up your config files and encrypted data
- Test in mock mode or on a testnet before using mainnet