LongfellowBackend

An IsoMdocZkBackend implementation backed by the Longfellow-ZK zero-knowledge system (via the Multipaz library).

This class handles proof generation and verification for ISO/IEC 18013-5 mdoc credentials using Longfellow-ZK circuits. It bridges internal domain models (ZkSystemSpec, ZkDocument, SessionTranscript) to and from Multipaz-native data structures.

Lifecycle: Before invoking operations that rely on backend capabilities (e.g., supports, generate, load), the backend MUST be initialized by calling initialize.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val paramSerializers: Map<String, KSerializer<*>>

Maps parameter key names to their expected kotlinx KSerializer instances for serializing and deserializing zero-knowledge system specifications.

Link copied to clipboard
open override val system: String

The identifier string of the underlying zero-knowledge engine (e.g., "longfellow-libzk-v1").

Link copied to clipboard
open override val zkSystemSpecs: List<ZkSystemSpec>

The list of zero-knowledge system specifications available in this backend.

Functions

Link copied to clipboard
open suspend override fun generate(request: PresentationRequestParameters, credential: SubjectCredentialStore.StoreEntry.Iso, requestedClaims: Collection<NormalizedJsonPath>, requestedZkSystemSpecs: List<ZkSystemSpec>, keyMaterial: KeyMaterial): KmmResult<IsoMdocZkProof>

Generates a zero-knowledge proof for a given credential and requested claim paths.

Link copied to clipboard
open suspend override fun initialize(): KmmResult<Unit>

Initializes the Longfellow-ZK backend engine safely across coroutines. Loads default circuits into memory. If already initialized, this operation is a no-op.

Link copied to clipboard
open override fun load(zkDocument: ZkDocument, sessionTranscript: SessionTranscript, zkSystemSpec: ZkSystemSpec): KmmResult<IsoMdocZkProof>

Constructs an IsoMdocZkProof handle from an existing ZkDocument for verification.

Link copied to clipboard
open override fun supports(candidate: ZkSystemSpec): Boolean

Determines whether the given candidate specification is supported by this backend.