• Create a new dataset with the copy of the original and the proof graph(s) as a separate graph(s) within the dataset (a.k.a. "Embedded Proof" in the DI spec terminology).

    If the anchor is defined, then that will be the subject for quads with the proof property is added (one for each proof graph). In the case of a VC, the ID of the credential itself is naturally the anchor, but there is no such "natural" node for a general RDF dataset.

    If the keyPair argument is an Array, then the proof graphs are considered to define a Proof Chain. Otherwise, (e.g., if it is a Set), it is a Proof Set. Proof chains are somewhat restricted compared to the specification: proof chains and sets are not mixed. In other words, either all proofs are part of a chain or form a chain; the case when a previous proof reference points at a set of proofs is not possible.

    The anchor should exist to create a proper chain per spec, because the spec requires it to sign over the previous proof reference. The chain will be created in the absence of an anchor, but the result will not be conform to the specification (that requires the addition of a proof reference triple).)

    Parameters

    • dataset: DatasetCore<Quad, Quad>
    • keyData: KeyData | Iterable<KeyData>
    • Optional anchor: Quad_Subject

    Returns Promise<rdf.DatasetCore>