This gist reproduces a bug in KERI/KLI: when inspecting delegate kevers, the delegate witness incorrectly reports the delegator as "Not Anchored" even though the delegator and delegate both show "Anchored" for the same identifier, with the same witness count, receipts, and threshold.
The script sets up a delegator and a delegate, each with a witness, then runs kli kevers from three places:
- Delegator — delegated identifier shows ✔ Anchored
- Delegate — delegated identifier shows ✔ Anchored
- Delegate witness — delegated identifier shows ✘ Not Anchored (incorrect)
So the delegate witness has the same receipt/threshold data but reports "Not Anchored" instead of "Anchored".
--------------------------------
Delegate kevers from delegator, note showing 'Anchored'
--------------------------------
Identifier: EDkvcqndMxTC8-70_m6G4U1KmsTdeQ4vh4qddK-MCef5
Seq No: 0
Delegated Identifier
Delegator: EAhA4AGEJuZu3bQaKL07PfI_Shy9VOa-JM8mfo0qH3Hx ✔ Anchored
Witnesses:
Count: 1
Receipts: 1
Threshold: 1
Public Keys:
1. DJuDd2GgFwtPGiMCQ9aCaEbNEkxxauCoOB0hfOtnQusR
--------------------------------
Delegate kevers from delegate, note showing 'Anchored'
--------------------------------
Identifier: EDkvcqndMxTC8-70_m6G4U1KmsTdeQ4vh4qddK-MCef5
Seq No: 0
Delegated Identifier
Delegator: EAhA4AGEJuZu3bQaKL07PfI_Shy9VOa-JM8mfo0qH3Hx ✔ Anchored
Witnesses:
Count: 1
Receipts: 1
Threshold: 1
Public Keys:
1. DJuDd2GgFwtPGiMCQ9aCaEbNEkxxauCoOB0hfOtnQusR
--------------------------------
Delegate kevers from delegate witness, note showing 'Not anchored'
--------------------------------
Identifier: EDkvcqndMxTC8-70_m6G4U1KmsTdeQ4vh4qddK-MCef5
Seq No: 0
Delegated Identifier
Delegator: EAhA4AGEJuZu3bQaKL07PfI_Shy9VOa-JM8mfo0qH3Hx ✘ Not Anchored
Witnesses:
Count: 1
Receipts: 1
Threshold: 1
Public Keys:
1. DJuDd2GgFwtPGiMCQ9aCaEbNEkxxauCoOB0hfOtnQusR
- Bash
- Python 3 (for
kli; the script can install dependencies fromrequirements.txtif missing) - curl (used to wait for witnesses to be ready)
HTTPS:
git clone https://gist.github.com/c03db9084631695fe8ab522c25a2d431.git delegation-problem
cd delegation-problemSSH:
git clone git@gist.github.com:c03db9084631695fe8ab522c25a2d431.git delegation-problem
cd delegation-problemchmod +x delegation-problem.sh
./delegation-problem.shIf kli is not installed, the script will create a Python virtualenv (.venv) and install dependencies from requirements.txt. On subsequent runs you can activate the venv first to reuse it:
source .venv/bin/activate
./delegation-problem.shTo run against a local keripy checkout (e.g. to test fixes), create a venv and install keri in editable mode, then run the script with that env active:
python3 -m venv .venv
source .venv/bin/activate
pip install -e ../keripy
./delegation-problem.shUse the path where you have cloned keripy (e.g. ../keripy, ~/code/keripy, or an absolute path). The script will see kli on your PATH and skip installing from requirements.txt.
- The script starts local witness servers and cleans them up on exit (including via
Ctrl+C). - It uses random suffixes for delegator/delegate names to avoid clashes between runs.
- At the end it runs
kli keversfrom the delegator, delegate, and delegate witness; compare the "Delegated Identifier" line to see Anchored vs Not Anchored.