Skip to main content

Standalone Know-Your-Agent verifier. Reads on-chain EAS attestations + verifies EIP-712 signatures with zero Oris API dependency.

Project description

oris-kya-verify

Standalone Know-Your-Agent verifier. Reads on-chain EAS attestations and verifies EIP-712 signatures with zero Oris API dependency. Drop into any payment gateway, wallet provider, or compliance pipeline to verify the agent on the other side of a transaction.

The package implements the public KYABundle schema published at docs.useoris.xyz/spec/kya-bundle-v1.json. Any KYA attestation issued by Oris on Base, Ethereum, Arbitrum, or Optimism mainnet can be verified by this library without ever hitting an Oris service.

Why this exists

Oris issues two parallel attestations for every Know-Your-Agent state transition (promote, demote, suspend):

  1. An off-chain EIP-712 signed message recoverable to the Oris MPC key.
  2. An on-chain EAS attestation on Base + Ethereum (with optional replication to Arbitrum / Optimism).

A third party can verify either independently. This library wraps both checks behind a single KYAVerifier.verify() call.

Install

pip install oris-kya-verify

Dependencies: httpx, coincurve, eth-abi. No web3.py, no Postgres, no Oris SDK.

Usage

import asyncio
from oris_kya import KYAVerifier

async def main():
    verifier = KYAVerifier(chain="base")
    bundle = await verifier.verify("did:ethr:8453:0x7f3a9c2d1b4e5f6a7b8c9d0e1f2a3b4c5d6e7c2d")

    print(f"KYA level: {bundle.kya_level}")
    print(f"Risk score: {bundle.risk_score}/100")
    print(f"Status: {bundle.kya_status}")
    print(f"Attestation UID: {bundle.attestation_uid}")
    print(f"Signed by: {bundle.signer_address}")  # Should match the Oris MPC key
    print(f"Issued at: {bundle.issued_at}")
    print(f"Expires at: {bundle.expires_at}")
    print(f"Expired? {bundle.is_expired}")

    if bundle.kya_level >= 3 and not bundle.is_expired:
        # Authorize the payment.
        pass

asyncio.run(main())

Supported chains

Chain EAS contract Default RPC
base 0x4200000000000000000000000000000000000021 https://mainnet.base.org
ethereum 0xA1207F3BBa224E2c9c3c6D5aF63D0eb1582Ce587 https://eth.llamarpc.com
arbitrum 0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458 https://arb1.arbitrum.io/rpc
optimism 0x4200000000000000000000000000000000000021 https://mainnet.optimism.io

Override rpc_url in the KYAVerifier constructor to point at your own RPC (recommended for production: Alchemy, Infura, Helius, etc.).

Error handling

The library raises typed exceptions you can catch by category:

  • KYANotAttestedError — no on-chain attestation exists for this agent.
  • KYAExpiredError — the latest attestation has passed its expires_at.
  • KYAInvalidSignatureError — the EIP-712 signature does not recover to the expected Oris MPC signer.
  • KYAVerificationError — base class for any of the above.

Network failures bubble up as httpx.HTTPError. The library never silently fails: every "yes" answer is cryptographically grounded.

Schema

The KYABundle returned by verify() is a frozen dataclass that mirrors the public JSON schema at docs.useoris.xyz/spec/kya-bundle-v1.json. Use the schema directly if you are implementing your own verifier in a different language.

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oris_kya_verify-0.2.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oris_kya_verify-0.2.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file oris_kya_verify-0.2.0.tar.gz.

File metadata

  • Download URL: oris_kya_verify-0.2.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for oris_kya_verify-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9b5127fde22d65da8bef82d1c370a83991fb14acb1040a22ca28a4493f1dc0b0
MD5 27a622733e2d9d90e7d929a23638ab0a
BLAKE2b-256 fd3c85ed5aa63c281ca06da35edc963e43ae8b5afcd60f73f033c6cc2043cd53

See more details on using hashes here.

File details

Details for the file oris_kya_verify-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for oris_kya_verify-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c16902483103182fd50df6c81952fc6fd2f53e987c725c09ca130ee7b5d89c87
MD5 f8679359e58c0ee8b7bc6afff7974b9e
BLAKE2b-256 caf38d10f40c3009f7810ea104cfef52fba1603564477a7b5b64145b1807a784

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page