mintid-agent
The MintID agent client for Python: the agent runtime's side of an agent credential. An agent credential proves that a person, verified at an issuer, delegated this agent to pay this kind of counterparty within stated bounds, and nothing about who that person is. The client obtains the credential from an agent offer, keeps its witnesses current, answers a seller's identity requirement inside an x402 payment flow, and refuses, before anything is sent or paid, whatever the delegation does not cover.
It carries no cryptography of its own: proofs come from the MintID holder
library (mintid-proof-core), signatures from a signer you inject.
Where it fits
MintID is an open-source identity protocol that lets a software agent prove that an accountable, identity-verified person stands behind it, within a scope that person fixed, without revealing who that person is. Accepted issuers verify people and issue the credentials; the chain publishes their status roots, their bonds and the registries; each verifier decides on its own service. MintID itself issues nothing, certifies nothing and verifies nobody.
The agent client runs in your own infrastructure, and its keys never leave it: the credential's private bytes go only to the credential store you inject (encryption at rest is yours), and the request-signing key stays behind the signer you inject. The operator who mints the agent, not the agent, decides the delegation.
Install
pip install mintid-agent # Python 3.12 or later
pip install "mintid-agent[ed25519]" # with the software Ed25519 signer
It depends on mintid-proof-core, which compiles the Rust proof core in;
where no wheel matches your platform, pip builds it from source with a Rust
toolchain. Version 0.10.0 (with mintid-proof-core 0.9.0 or later 0.9),
published from the main repository, https://gitlab.com/mintid/mintid
(sdk/python/mintid-agent).
New in 0.10.0 (breaking). Requires mintid-proof-core 0.9.0: every presentation the agent makes is presentation format version 4, the one encoding a verifier accepts, and verifiers of the earlier format refuse it. Update the agent together with the verifiers it presents to. A presentation lives 30 seconds (PRESENTATION_LIFETIME_SECONDS), the constant of format version 4 that every holder and verifier shares.
Also new in 0.10.0. The session binding of bIP-0002 §5 (verifier contract 1.9.0): a challenge issued to this client's Web Bot Auth key is answered, and its X-MINTID-SESSION-KEY-SALT goes back with the presentation; a challenge issued to another key, or bound while the client has no signer, or without its salt, is refused with ChallengeError challenge_key_mismatch, and one carrying a binding reference the client does not know with challenge_binding_unknown, before the holder proves anything and before anything is paid. An unbound challenge is answered as before.
Also new in 0.10.0 (breaking). The payment binding of bIP-0006: the client fixes the payment before it asks for a challenge, checks the challenge's payment entry, amount and unit against its credential before the holder proves anything (challenge_payment_mismatch, challenge_payment_unrequested), resends the same payload on a retry and speaks x402 version 2. The payer callback now takes (payment_required, accepted, payment_id). The production profile of the network registry it carries no longer lists network_page or p2p.
Also new in 0.10.0 (a behaviour change). The status witness comes from the issuer's public status log, with no request that names the credential, and the client keeps it current in the background while the runtime is up: start it with agent.start_sync() (or call agent.tick() from your runtime's timer). pay, present and relay_disclosure fetch nothing before presenting, and every agent fetches at the same instants (below), so the timing of the agent's requests tells the issuer nothing about when it presents; after status_root_stale the pay loop presents once more at the end of the next fetch band, fetching nothing because of the refusal. A runtime that cannot keep a background task sets freshness="before_presenting". status_reader= is the proven read of the issuer's status and ring (verifier-core's ChainClient); self_revoke runs the same sync with a proven read first. A credential the log lists raises CredentialListed and the client stops presenting. refresh() is one sync step (sync()).
Also new in 0.10.0 (a behaviour change). The schedule is set by the issuer's heartbeat, the same for every agent: with status_reader=, each root's publication is fetched by its epoch eight seconds after the root is due plus a delay of up to five seconds drawn afresh (draw= injects the source), the root's due time taken from the newest root of the client's proven read; without it, on the heartbeat's grid in Unix time. The proven read happens on one root in four, the same roots for every agent. The records of the verifiers the client answers and the admission key set are read right after it, never when a challenge is answered: name your vendors' verifiers with named_verifiers=; a challenge from another verifier reads its record at once (first_contact="read", the default) or is refused challenge_key_unavailable until the next scheduled read (first_contact="defer"). agent.watch_self_revocation_on_schedule(chain_id) runs the non-removal watch's rounds right after the scheduled proven reads.
Also new in 0.10.0 (a behaviour change). The kill switch's receipt is pending / folded only when the chain's record of the agent's code carries the agent's own ciphertext; unconfirmed when the read carries none, mismatch when it carries another (the code is recorded, this credential is not revoked by that record). A relay's nullifier_recorded is never the agent's success. On submitted check again, or send it again through another relay (the message is idempotent). On unconfirmed read again from a node whose record of the code carries its ciphertext, or ask the issuer to revoke the credential on request; on mismatch sending it again is refused while that record is kept, so ask the issuer to revoke the credential on request. After the issuer acknowledges, agent.watch_self_revocation(chain_id) runs one round of the watch: listed when the issuer's log lists the credential, evidence when it is still a member at a later root (the evidence file is submitted through the relay), waiting, fault_open or closed. The custody record keeps what rebuilds the ciphertext until the watch closes; the client persists it after every round.
New in 0.9.0. The agent mint speaks OpenID for Verifiable Credential Issuance 1.0, the Final text: the token step keeps only the bearer, and the credential step (complete_issuance, complete_renewal, issue_from_offer) fetches a fresh c_nonce from the issuer's nonce endpoint just before its blind request, sends proofs without format and reads the credential from credentials. The split mint's MintMaterial is version 2, without a nonce; a version-1 material is still read (its nonce checked and dropped) and completed the same way, so move the runtimes that complete before the sides that mint. An issuer whose metadata names no nonce endpoint predates the Final text: HolderError (step metadata); the nonce endpoint must be on the issuer's origin like the other endpoints (IssuerOriginMismatch, check nonce_endpoint). After invalid_nonce the material is still good: complete again. Requires mintid-proof-core 0.8.0.
New in 0.8.0. The agent mint goes only to the principal's own issuer: the offer's issuer, the issuer metadata's token and credential endpoints, every mint challenge, the material's scope endpoint and the credential answer's witness and scope endpoints must name the origin the principal's credential was issued at (a renewal, the agent's own issuer), and the pins you give (expected_issuer_origin, expected_issuer_id); otherwise IssuerOriginMismatch, naming the check, before the principal's holder answers and before anything reaches the origin at fault (below). A party that relays an agent offer from its own origin can no longer obtain the mint presentation or the bearer. Additive for an honest issuer; requires mintid-proof-core 0.7.0, whose holder refuses a foreign mint challenge on its own too.
New in 0.7.0 (breaking). Agent presentations carry a dispute ciphertext: an encryption of the agent's credential reference under a key held jointly by its issuer and the MintID Foundation, which opens only for a dispute claim recorded on chain, so that due process can reach an agent that does not cooperate. The client presents it automatically: the issuer's dispute key document arrives with every witness refresh, and the chain view of the Foundation's admission keys comes from the key source that reads your chain (verifiers) or from AgentClient(admission_keys={"chain_id": ..., "admission_keys": [...]}). Requires mintid-proof-core 0.6.0; verifiers must run the matching release (agent presentations are wire version 3).
New in 0.6.1. No change of its own: it requires mintid-proof-core
0.5.5 or later, the holder library with the prover's privacy fix for the
range predicates. Every agent runtime must update.
New in 0.6. A refusal that carries the relying party's onboarding route
(bIP-0002 §3.10) comes back from pay as a RefusedWithOnboarding instead
of raising — for a terminal identity rejection and for a policy the
credential cannot satisfy (nothing presented, nothing paid); a malformed
object is ignored and the refusal raises as before. Where no vendor sends
the route, nothing changes. The network registry's production profile
gains network_page and p2p.
New in 0.5. The split mint, for a principal's holder and an agent
runtime in different places: mint_token runs the token step beside the
principal and returns a MintMaterial that carries nothing of the
principal; AgentClient.complete_issuance (and complete_renewal)
completes it in the runtime. AgentClient.can_satisfy says whether the
credential can satisfy a claim policy, with nothing requested or sent. The
requester side of the agent-to-agent handshake ships here as
mintid_agent.handshake. Additive: issue_from_offer and renew behave
as before.
New in 0.4. Network profiles: MINTID_NETWORK=testnet (or
network="testnet") gives the kill switch the relay and the node of the
public testnet from the network registry mintid-proof-core carries;
AgentClient.endpoint(role) names any of its endpoints. MINTID_RELAY_URL,
MINTID_CHAIN_RPC and MINTID_TESTNET_* win when set; an unknown profile
fails naming the valid ones. Additive: without a profile nothing changes.
New in 0.3. Agent profile v2 offers (mintid_agent_v2, MINT-479): the
client redeems them, the principal proves the issuer's age threshold when
the mint challenge asks one, and self-revocation reads the issuer's
agent_v2 anchoring. Additive: agent v1 offers are unchanged.
Upgrading from 0.1. Two behaviour changes. The holder checks every
challenge's signature before it presents: give AgentClient a source of
verifiers' request keys, verifiers= (ProvenVerifierKeys over a proven
chain read, or StaticVerifierKeys of records you pinned); without one, or
for an unsigned or wrongly signed challenge, present raises
ChallengeRefused and nothing is sent or paid. And refresh().usable is
true only once a finalised root anchors every scope value of the delegation
(agent.scope_anchored), so a new agent no longer presents into
scope_axis_unprovable: poll refresh() until usable, as below.
Example
import time
from mintid_agent import AgentClient
from proof_core.holder import urllib_transport
# offer: the agent offer the operator made; principal: the principal's
# identity credential (a proof_core.holder.Holder); store: your CredentialStore.
# verifiers: where the holder reads verifiers' request keys (ProvenVerifierKeys
# over a proven chain read, or StaticVerifierKeys of records you pinned).
# issuer_origin / issuer_id: the issuer you expect, from your own configuration
# (never from the offer).
agent = AgentClient.issue_from_offer(
offer, principal, transport=urllib_transport(), store=store, verifiers=verifiers,
expected_issuer_origin=issuer_origin, expected_issuer_id=issuer_id,
)
while not agent.refresh().usable: # the status witness, then the scope log;
time.sleep(5) # usable once a root anchors the delegation
envelope = agent.present(challenge) # checks the verifier's signature (ChallengeRefused), then
# proves or refuses, naming what the delegation cannot satisfy
result = agent.pay(url, payer=payer) # one paid request; your payer builds the payment header:
# payer(payment_required, accepted, payment_id); on x402 v2
# it runs once, before the challenge, and the presentation is
# bound to that payment (bIP-0006)
When the principal's holder is not where the agent runs, split the mint:
mint_token(offer, principal, transport=...) beside the principal returns a
short-lived, single-use MintMaterial that carries nothing of the principal,
and AgentClient.complete_issuance(material, ...) in the agent's runtime
completes it, so the agent's custody is born there.
The mint goes only to the principal's own issuer: the offer, the issuer's
metadata endpoints and every mint challenge must name the origin the
principal's credential was issued at, and the pins when you give them
(expected_issuer_origin, expected_issuer_id); otherwise
IssuerOriginMismatch, before the principal's holder answers and before
anything is sent to the origin at fault. A party that relays the offer from
its own origin gets neither the mint presentation nor the bearer.
agent.can_satisfy(claim_policy) says whether a policy is within the
credential before any challenge, naming the output keys it cannot prove,
with nothing sent. mintid_agent.handshake answers the provisional
agent-to-agent handshake (A2A, MCP) without the verifier package.
The same client renews the credential from a renewal offer and holds the agent's kill switch: holder self-revocation, submitted through a privacy relay and confirmed against the chain.
Where to test
On the public testnet and its KYC sandbox, and only there: check the status line of its page first. Nothing minted on it carries weight. The single-node production chain is not for third parties and is never a place to test.
Links
- Documentation: https://gitlab.com/mintid/mintid/-/blob/main/docs/sdk/15-agent-clients.md
- Source: https://gitlab.com/mintid/mintid (
sdk/python/mintid-agent), where issues and merge requests go; read-only mirror: https://gitlab.com/mintid/sdk-python - Public testnet: https://gitlab.com/mintid/mintid/-/blob/main/docs/sdk/17-sandbox-and-testnet.md
- Security: report a vulnerability privately to security@mintid.net, never in a public issue; policy: https://gitlab.com/mintid/mintid/-/blob/main/SECURITY.md
- Website: https://mintid.net
Licence
Apache License 2.0 (LICENSE, NOTICE). Author: Marc Molas.
This repository
This is a read-only mirror of sdk/python/mintid-agent of the MintID source tree,
https://gitlab.com/mintid/mintid, and is published from it: each publication replaces its
content, and nothing is merged here. Issues and merge requests go to the main
project, https://gitlab.com/mintid/mintid/-/issues; a vulnerability goes privately to the
address in its SECURITY.md, never to a public issue. Licence: Apache License
2.0 (LICENSE and NOTICE); contributions follow the main project's
CONTRIBUTING.md.
Package: mintid-agent (Python >= 3.12). It depends on mintid-proof-core,
the Python bindings of the Rust proof core and holder library, whose source is
identity-proof-core/python of the main repository. To work here against the
proof core of the same revision, build it from a clone of the main repository
(pip install ./identity-proof-core/python, with a Rust toolchain), then
install this package (pip install -e ".[ed25519]").
Metadata
Release files for mintid-agent 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mintid_agent-0.10.0.tar.gz | 110.5 kB | Without provenance | Details for mintid_agent-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mintid_agent-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for mintid_agent-0.10.0-py3-none-any.whl |
Total release size: 191.5 kB
Release files / mintid_agent-0.10.0.tar.gz
| Download URL | mintid_agent-0.10.0.tar.gz |
|---|---|
| Size | 110.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb4f33701ded4daefed4abfbf121b8fd3dd7ceaf03cce7a3d89dc71509f92fd0
|
|
BLAKE2b-256 checksum How to use checksums |
6fe4c90e3ccb815c3f1fa1c35cbe9f319542fd292ff7eb858f6dd25eee412397
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / mintid_agent-0.10.0-py3-none-any.whl
| Download URL | mintid_agent-0.10.0-py3-none-any.whl |
|---|---|
| Size | 81.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
209d8b2f3dd2b910a7db8425afa244f60326290c4c1708ad48f7f4ba57563a3f
|
|
BLAKE2b-256 checksum How to use checksums |
8dc945fc0b57a95125abaa59cef7c4a800aa097f5f1e4d394d802506cf2a9b68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for mintid-agent 0.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.