Delegation nodes are used within the KILT protocol to construct the trust hierarchy.

Starting from the root node, entities can delegate the right to issue attestations to Claimers for a certain CTYPE and also delegate the right to attest and to delegate further nodes.

A delegation object is stored on-chain, and can be revoked.

A delegation can and may restrict permissions.

Permissions:

  • Delegate.
  • Attest.

Hierarchy

  • DelegationNode

Implements

Constructors

Properties

account: Did
hierarchyId: string
id: string
parentId?: string
permissions: number[]
revoked: boolean

Accessors

Methods

  • Checks on chain whether an identity with the given DID is delegating to the current node.

    Parameters

    • dids: Did | Did[]

      A DID or an array of DIDs to search for.

    Returns Promise<{
        node: null | DelegationNode;
        steps: number;
    }>

    An object containing a node owned by the identity if it is delegating, plus the number of steps traversed. steps is 0 if the DID is owner of the current node.

  • Generates the delegation hash from the delegations' property values.

    This hash is signed by the delegate and later stored along with the delegation to make sure delegation data (such as permissions) has not been tampered with.

    Returns Uint8Array

    The hash representation of this delegation as a byte array.

  • Fetches all hashes of attestations attested with this delegation node.

    Returns Promise<`0x${string}`[]>

    Promise containing all attestation hashes attested with this node.

  • Reclaims the deposit of a delegation and removes the delegation and all its children.

    This call can only be successfully executed if the submitter of the transaction is the original payer of the delegation deposit.

    Returns Promise<SubmittableExtrinsic>

    A promise containing the unsigned SubmittableExtrinsic (submittable transaction).

  • Revokes the delegation node on chain.

    Parameters

    • did: Did

      The address of the identity used to revoke the delegation.

    Returns Promise<SubmittableExtrinsic>

    Promise containing an unsigned SubmittableExtrinsic.

  • Recursively counts all nodes that descend from the current node (excluding the current node). It is important to first refresh the state of the node from the chain.

    Returns Promise<number>

    Promise resolving to the node count.