ucan-wg / ucan-community-web

UCAN community site
https://ucan.xyz/
Apache License 2.0
38 stars 11 forks source link

Add proof explorer #7

Closed bgins closed 2 years ago

bgins commented 2 years ago

The current version of the app has a Show Next Proof button that loads the proof UCAN into the Encoded section for inspection.

show-next

With the newest version of the UCAN spec, the prf field is an array of proofs. Each of those proofs can have their own proofs, which taken together can form a proof tree.

We should update the show proof functionality to a proof tree explorer where users can inspect any node in the proof tree.

Requirements

Rough plan

Show a UCAN and its proofs as boxes in a row beneath the Encoded and Decoded sections. Each box can be selected to load its corresponding UCAN into the validator.

Show a tooltip when hovering over a box with valid/invalid, issuer, audience, and maybe known capabilities. The tooltip should quickly give the user information they want about a proof while inspecting a UCAN.

When a proof is selected, the boxes are replaced with a box for the proof and its proofs. We can use breadcrumbs to indicate the chain of UCANs and the depth in the tree. A user could for example click on a breadcrumb to return to the original UCAN when they are three proofs deep.

We could also add some visual indicators to the boxes to indicate invalid UCANs. For example, the box for a UCAN that cannot be decoded might be faded out. An invalid UCAN that can be decoded might have an X across the box.