Skip to main content

Python client for SVS: Solana Verification System.

Project description

svs-solana

Python client for SVS: Solana Verification System.

Use this package when a Python trading bot, automation script, or agent runtime needs to submit signed SVS actions without reimplementing HMAC headers, timestamp freshness, request nonces, or production-proof polling.

This is the thin Python adoption layer. It mirrors the public @svsprotocol/solana client surface where Python bots need it first:

  • HMAC signed request headers compatible with the SVS bot API.
  • Signed action submission with automatic replay-protection nonce.
  • Signed bot self-test.
  • Credential-readiness read.
  • Action production-proof status, proof fetch, and polling.
  • Verified-agent profile and registry verification for protocols and auditors.

The private dashboard, release tooling, deployment evidence, registry authority, wallets, keys, and local operator files are intentionally not part of this package.

Install

For local development from this repo:

python3 -m pip install -e ./packages/svs-python

When published:

python3 -m pip install svs-solana

Environment

export SVS_SERVER_URL="http://127.0.0.1:4173"
export SVS_BOT_ID="devnet-memo-bot"
export SVS_BOT_API_KEY="svs_..."
export SVS_BOT_REQUEST_SIGNING_SECRET="..."

Submit a Signed Action

import os
from svs_solana import SolanaVerificationClient

svs = SolanaVerificationClient(
    base_url=os.environ["SVS_SERVER_URL"],
    api_key=os.environ["SVS_BOT_API_KEY"],
    request_signing_secret=os.environ["SVS_BOT_REQUEST_SIGNING_SECRET"],
)

readiness = svs.check_bot_readiness(bot_id=os.environ["SVS_BOT_ID"])
if not readiness["ok"]:
    raise RuntimeError(readiness["nextAction"]["message"])

result = svs.submit_action({
    "intent": {
        "botId": os.environ["SVS_BOT_ID"],
        "type": "memo",
        "memo": "verified from Python"
    },
    "policyId": "memo-human-approval"
})

record_id = result["queue"]["record"]["id"]
proof = svs.wait_for_action_production_proof(
    record_id,
    attempts=12,
    interval_seconds=5,
    fetch_proof=True,
)

Verify Request Signing Locally

from svs_solana import create_signed_bot_request

signed = create_signed_bot_request(
    {"intent": {"botId": "bot"}},
    request_signing_secret="secret",
    timestamp="2026-06-02T21:45:00.000Z",
)

print(signed["headers"]["svs-request-signature"])

Verify a Profile or Registry

import json
from svs_solana import (
    verify_verified_agent_profile,
    verify_verified_agent_registry,
)

profile = json.load(open("./data/security/verified-agent-profile.json"))
profile_result = verify_verified_agent_profile(
    profile,
    expected_bot_id="devnet-memo-bot",
    stale_after_ms=24 * 60 * 60 * 1000,
)

registry_result = verify_verified_agent_registry(
    registry_path="./data/verified-agent-registry/registry.json",
    stale_after_ms=24 * 60 * 60 * 1000,
)

if not profile_result["ok"] or not registry_result["ok"]:
    raise RuntimeError("SVS verified-agent trust check failed.")

External Bot Example

cp examples/external-bots/python-signed-memo-bot.env.example \
  examples/external-bots/python-signed-memo-bot.local.env

PYTHONPATH=./packages/svs-python \
  python3 ./examples/external-bots/python-signed-memo-bot.py \
  --env ./examples/external-bots/python-signed-memo-bot.local.env

The example submits a signed memo action with SolanaVerificationClient, API-key authentication, HMAC request signing, automatic nonce replay protection, and the same dashboard human-review handoff used by the JavaScript examples. If SVS_SERIALIZED_TRANSACTION_BASE64 is present, the queued action can also carry a prebuilt memo transaction for wallet approval and broadcast.

Run the package tests:

npm run sdk:python:check

Persist adoption evidence after a live dashboard run:

npm run sdk:python:adoption-evidence -- --require-production-proof true

That writes data/security/python-sdk-adoption-evidence.json, proving package hygiene, Python tests, signed request intake, transaction-backed human review, approval, broadcast, custom registry registration, and independent production-proof verification without exposing API keys or signing secrets.

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

svs_solana-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

svs_solana-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svs_solana-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for svs_solana-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb72ee085bb03194b8e90f9f975150985e832e0674f018c65e2c747dc78d1bdb
MD5 102b41e67d3d2bb0e04865db40ad84ce
BLAKE2b-256 95a60fc25efae6d8effa27430b415371dcd6008112b919f3219194caf34fd080

See more details on using hashes here.

File details

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

File metadata

  • Download URL: svs_solana-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for svs_solana-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9010608f2957e0940313bfd2bf11d823271cc2d03686dee1b6551e64980aa215
MD5 f5f1df25429e711020436e0a9b41da70
BLAKE2b-256 9bacf16c7f61e382c4c3c1d8e979967292b92b184641529b52d6167243060050

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