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

Uploaded Python 3

File details

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

File metadata

  • Download URL: avp_wallet_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for avp_wallet_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f0cb7d7eb1601e85fe9d626aa70cac8d46e3f01e652716ed3b5c5ef999c5b6a4
MD5 a2f2f8e234661243d946c04d2b0ca1d6
BLAKE2b-256 041d7026fd6108bb71c8f485bed001b24c2edab27f97a24f1de7a411adc9ab33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: avp_wallet_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for avp_wallet_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef84c18d9f37128dbadf1b6a09e01dd49397c253f4cae35994d560f255350b99
MD5 52d0c8f30f110b9b85e0089549b20d87
BLAKE2b-256 b712ee3d35b3d1b6ab2fd836e8ef65a726433994b8a0221a982d54c6d227b813

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