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.1.0.tar.gz (13.4 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.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oris_kya_verify-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 a9cb428cf80ab6a38e7632f078220cf03a7febcaa5ff174de2e34d0022fe10cb
MD5 de05a73aca67bb2801b1c2dca917e2f1
BLAKE2b-256 dfcdb2dd2e5995e19dc3a0c340bfda67d2a02bdcac6bba66366afe6463ab7f86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oris_kya_verify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf89531ae82d7d02f4c41c9b31f00fa709317a070c7603d9c11130afa6063ead
MD5 6d3f759de562b6111cd89550d073004f
BLAKE2b-256 f65509afbc6149cdfec1f5c00c287f11b4a0a032b430f37e8f9f4ab88d1bb699

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