Skip to content

About

Python interface to implementations of Longfellow zero-knowledge proofs over ISO 18013-5 mdoc credentials

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

pylongfellow

pylongfellow provides a Python interface to implementations of Longfellow zero-knowledge proofs over ISO 18013-5 mdoc credentials.

Two backends are supported:

The package is experimental and unstable.

CI Docs PyPI Python License

Installation

pip install pylongfellow

Wheels containing both backends are published for CPython 3.11–3.14 on Linux x86_64 (manylinux and musllinux). On any other platform pip falls back to the source distribution, which builds both backends locally — see the development page.

Usage

import cbor2

from pylongfellow import Pylongfellow, mdoc
from pylongfellow.backends.google_cpp import generate_circuit

longfellow = Pylongfellow(backend="google-cpp")

circuit = generate_circuit(7, 1)  # or Path(...).read_bytes()
longfellow.load_circuit(circuit, 7, 1)

claims = [mdoc.RequestedAttribute("org.iso.18013.5.1", "age_over_18", cbor2.dumps(True))]
issuer_public_key = mdoc.PublicKey(x, y)

proof = longfellow.prove(credential, issuer_public_key, transcript, claims, now)
longfellow.verify(issuer_public_key, transcript, claims, now, proof, doctype)  # raises on failure

Examples are in examples/.

Documentation

https://pylongfellow.readthedocs.io/en/stable/. The API reference is generated from the docstrings and carries the exact types of every function.

Upstream

Both backends are vendored as git submodules and built from source into each wheel:

The pins do not float: upstream ABIs and circuits can change between releases. A nightly canary runs the test suite against both upstream HEADs.

Development

git submodule update --init --recursive
uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run mypy

Build prerequisites and single-backend builds are on the development page.

Status

You should not rely on this code.

  • Wheels cover CPython 3.11–3.14 on Linux x86_64 only; other platforms build from source.
  • The API changes between minor versions.

License

pylongfellow is licensed Apache-2.0.

The vendored backends are licensed as follows:

  • google/longfellow-zk — Apache-2.0
  • abetterinternet/zk-cred-longfellow — MPL-2.0

pylongfellow is not affiliated with Google, ISRG, or the European Commission.

About

Python interface to implementations of Longfellow zero-knowledge proofs over ISO 18013-5 mdoc credentials

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages