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.3.0.tar.gz (25.1 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.3.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oris_kya_verify-0.3.0.tar.gz
  • Upload date:
  • Size: 25.1 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.3.0.tar.gz
Algorithm Hash digest
SHA256 7768aa39fdf8a4c9a4ea572ec3ef2e49406adacabe4e218da0722f6cab81d9c0
MD5 3bfb4b937a835ada887c6174722d4375
BLAKE2b-256 b3c3dc764bbb923b6d3231cb998bc39bd08ee59950adf6f605e00e5bc7790e86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oris_kya_verify-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b896ad05ddcb9303f6bb5cf24edeeb57aa5463a5d2ae1f0b17b84888d530d1c6
MD5 6884c458a179c21bcf710f6da2be43b8
BLAKE2b-256 1db15b6629752306880b693231fd55c668d3025af168bfce85431295f97cb7e9

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