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-wallet-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.2.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.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: avp_wallet_sdk-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 1e4f5c4452e16ecbd7af9cd633c705c8497786a3cc99bf9f190d3a5902818f8c
MD5 59372f6355ce1d215722434c6170abab
BLAKE2b-256 f0434cf52d6ed73a18e5e99132db0f362a6217e7dc2b00ae1ca27ce23c2d1533

See more details on using hashes here.

Provenance

The following attestation bundles were made for avp_wallet_sdk-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: avp_wallet_sdk-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebe62242c46e058a75127d0ed8dd474f63330a70f75c9f9a1c36b9fb2e3833e8
MD5 69fab55f247516040a27c4cb47f7c896
BLAKE2b-256 b091a54675b3c9f5c956434df917bc442efcddd5b0d9ac4d09efa0d9ddc1bbb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for avp_wallet_sdk-0.2.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