• Finalizes a KiltAttestationProofV1 after anchoring the prelimiary proof's root hash on the KILT blockchain.

    Parameters

    • credential: UnissuedCredential

      The KiltCredentialV1 for which the proof was initialized.

    • proof: KiltAttestationProofV1

      The partial proof object created via initializeProof.

    • includedAt: {
          blockHash: Uint8Array;
          genesisHash?: Uint8Array;
          timestamp: Date;
      }

      Information on the addition of the attestation record anchoring the proof on the KILT blockchain.

      • blockHash: Uint8Array

        The hash of the block in which the attestation record was added to the KILT blockchain.

      • Optional genesisHash?: Uint8Array

        The genesis hash of the blockchain network. Default to the KILT mainnet (spiritnet).

      • timestamp: Date

        The timestamp of that block.

    Returns KiltCredentialV1

    The credential where id, credentialStatus, and issuanceDate have been updated based on the on-chain attestation record, containing a finalized proof.

    Example

    // start with initializing proof
    const [proof, args] = initializeProof(credential)
    const tx = api.tx.attestation.add(...args)
    // after DID-authorizing and submitting transaction (taking note of the block hash and timestamp where the transaction was included)
    const verifiableCredential = finalizeProof(credential, proof, {blockHash, timestamp})