Skip to main content

Python client for the AVP Agent Verification Protocol — multi-chain wallet trust scoring

Project description

avp-sdk

Python client for the AVP Agent Verification Protocol — multi-chain wallet trust scoring with Sybil resistance and ZK nullifiers.

Install

pip install avp-sdk

Zero dependencies. Pure Python stdlib.

Quick Start

from avp_sdk import AVPClient

client = AVPClient("https://avp-protocol.onrender.com")

# Step 1 — get a challenge message to sign
challenge = client.challenge("0xYourWallet", "ethereum")
print(challenge.message)  # sign this with your wallet

# Step 2 — submit the signature
result = client.verify(challenge, signature="0x...")
print(result.trust_score)   # 75
print(result.trust_tier)    # "verified"
print(result.permissions)   # ["read", "write", "governance_vote"]
print(result.jwt_token)     # "eyJ..."

# Step 3 — validate a token later
info = client.validate(result.jwt_token)
print(info.valid)           # True
print(info.wallet_address)  # "0xYourWallet"

Development Mode

Use TEST_ prefixed signatures to test without a real wallet:

result = client.quick_verify("0xTestWallet", "ethereum", "TEST_my_signature")
print(result.trust_tier)  # "basic"

Supported Chains

Chain Value
Ethereum ethereum
Polygon polygon
BSC bsc
Solana solana

Trust Tiers

Tier Score Key Permissions
SOVEREIGN 80–100 governance_vote, admin_actions
VERIFIED 60–79 write, transfer_standard
BASIC 40–59 read, transfer_limited
UNTRUSTED 0–39 read only

Boost Trust Score

result = client.verify(
    challenge,
    signature="0x...",
    operator_id="my-operator",         # +15–25 points if operator has stake
    device_fingerprint="browser-hash", # +10 points
)

Error Handling

from avp_sdk import (
    AVPClient,
    AVPAuthError,
    AVPChallengeError,
    AVPRateLimitError,
    AVPSybilError,
    AVPTokenError,
    AVPConnectionError,
)

client = AVPClient("https://avp-protocol.onrender.com")

try:
    challenge = client.challenge("0xWallet", "ethereum")
    result = client.verify(challenge, signature="0x...")
except AVPAuthError:
    print("Signature verification failed")
except AVPChallengeError:
    print("Challenge expired or already used")
except AVPRateLimitError as e:
    print(f"Rate limited — retry in {e.retry_after}s")
except AVPSybilError:
    print("Wallet flagged as Sybil risk")
except AVPConnectionError:
    print("Could not reach AVP server")

Operators

Operators stake ETH-equivalent value to boost trust scores for their users.

# Register an operator
op = client.register_operator("my-operator", stake_amount=1.0)
print(op.is_active)      # True
print(op.trust_multiplier)  # 1.0

# Use operator in verification
result = client.verify(challenge, signature="0x...", operator_id="my-operator")
# Trust score gets +15 bonus from operator stake

Configuration

client = AVPClient(
    base_url="https://your-avp-instance.com",
    timeout=30,   # request timeout in seconds
    retries=3,    # retries on network errors
)

Run Tests

pip install pytest
pytest tests/ -v

Tests run against the live Render API. Requires internet connection.

Links

License

MIT — Oyewole Emmanuel Abiodun

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

avp_wallet_sdk-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

avp_wallet_sdk-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: avp_wallet_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for avp_wallet_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a8d5191e5fb505ff99a2508706ab1ed6192be1d771facb62905353f71a71828a
MD5 9ceb51c946cfe55b4e43bc68276bb044
BLAKE2b-256 597bd9c8ca7ae00f9e0cc5765bb332040c59a6378fe39ed32cf8e7d089e35442

See more details on using hashes here.

Provenance

The following attestation bundles were made for avp_wallet_sdk-0.1.0.tar.gz:

Publisher: publish.yml on ABICITYE/avp-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: avp_wallet_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for avp_wallet_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e14ee1e610a2f9c01f15018e4e462a86c89d47a9251fc86b53936853007a344
MD5 134d42749ff434d68447c395fe4fdf04
BLAKE2b-256 52d8fc5b3c612ef83b231c2a7622142b9b4c0f1505854892943eee4acd8c1087

See more details on using hashes here.

Provenance

The following attestation bundles were made for avp_wallet_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ABICITYE/avp-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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