# zkac-node CLI Install the `zkac` wheel from the repo root first (`maturin develop` or `pip install .`), then: ```bash pip install -e ./cli zkac-node --help ``` ## Quick start ```bash # 1. Create identities (one directory per user under ~/.zkac//) zkac-node user create alice zkac-node user create bob # Bob shares his issuance public key with Alice out-of-band: # zkac-node user show bob → copy issuance pk # 2. Alice runs a server; pin its public key for clients zkac-node serve alice --port 9800 & zkac-node server pin alice localhost:9800 --key zkac-node server pin bob localhost:9800 --key # 3. Alice creates a registry and grants Bob a role (needs Bob's issuance pk hex) zkac-node registry create alice localhost:9800 --roles analyst,operator zkac-node grant alice --server localhost:9800 \ --registry --role analyst --to $BOB_PK_HEX # (prints pool_index for Bob’s collect) # 4. Two-server XOR PIR needs a second replica with the same server_key + grants pool. # Example: rsync ~/.zkac/alice/server/ to a temp dir after the grant, then: # zkac-node serve alice --port 9801 --data-dir /tmp/zkac-replica & # zkac-node server pin bob localhost:9801 --key # 5. Bob lists local creds; optional pending scan (O(n) PIR queries per server) zkac-node credentials list bob zkac-node credentials list bob --server localhost:9800 --pir-peer localhost:9801 # 6. Bob collects (primary host in spec, second replica as --pir-peer) zkac-node collect bob localhost:9800::analyst \ --pir-peer localhost:9801 --pool-index # 7. Bob authenticates zkac-node auth bob --registry --role analyst --server localhost:9800 ``` ## Commands | Command | Description | |---------|-------------| | `user create ` | Generate issuance keypair under `~/.zkac//` | | `user list` | List all local user ids | | `user show ` | Show issuance pk + owned registries + credentials | | `serve [--data-dir D]` | Run server; default data dir is `~/.zkac//server/` | | `server pin --key ` | Pin server public key for that user | | `registry create --roles …` | Create registry on server | | `registry update --registry R --add-roles …` | Add roles | | `registry get --registry R` | Fetch registry state | | `registry list ` | List registries this user owns locally | | `grant --server S --registry R --role X --to ` | Admin grant (encrypted to recipient pk) | | `credentials list [--server S …] [--pir-peer P]` | Local credentials; pending grants only with `--pir-peer` (PIR scan) | | `collect --pir-peer P --pool-index N` | Fetch one grant via two-server XOR PIR | | `auth --registry R --role X [--server S]` | Authenticated session | ## Protocol & threat model See [docs/SECURITY.md](../docs/SECURITY.md) in the repo root. ## Storage layout Per user `~/.zkac//`: ``` identity.json issuance keypair admin/.json BBS+ admin material for owned registries credentials/_.json received credentials servers/.json pinned server public keys server/ (only if you run `serve `) server_key.json, registries/, mailbox/grants_pool.json ```