fromDataItem

Creates a ZkDocument instance from a CBOR DataItem.

This deserializes a CBOR representation back into a ZkDocument object. It expects the DataItem to be a CBOR map with the following required fields:

  • "proof": A CBOR byte string containing the ZK proof

  • "zkDocumentData": A CBOR structure that can be deserialized into ZkDocumentData

Return

A new ZkDocument instance

Parameters

dataItem

The CBOR DataItem to deserialize

Throws

if required fields are missing or have invalid types