Skip to main content

SafeDeal v0.1 protocol SDK with pluggable escrow and arbitration adapters

Project description

safedeal-sdk

SafeDeal is a deterministic escrow protocol + SDK for agent-to-agent deals. It produces a portable deal bundle that any counterparty can verify (Python + TypeScript), and enforces on-chain conservation + protocol-fee invariants on release. Designed for autonomous agents: canonical hashing, replay/expiry guards, pluggable arbitration, and reproducible smoke flows.

SD-5.6 adoption upgrades in this revision

  • One-command reproducible env + smoke test:
    • requirements.txt (pinned runtime deps)
    • scripts/bootstrap_env.sh (venv + install + version print)
    • scripts/run_smoke_test.sh auto-checks deps and bootstraps as needed
  • Mandatory protocol fee on every release:
    • on-chain fee params: protocolFeePpm, protocolFeeMin, protocolFeeSink
    • enforced in both releaseByMutual and releaseByArbitration
    • fee validated deterministically and emitted via ProtocolFeeCharged
  • Signer guardrails hardened:
    • signer API is sign(payload, preview)
    • signer recomputes canonical preview from payload and rejects mismatch
  • Agent EV planning helper:
    • sdk.estimate_total_cost(...) returns protocol fee + worst-case dispute fee + gas estimate

One-command smoke test

./scripts/run_smoke_test.sh local_anvil

Expected output includes:

  • env package versions
  • deployed contract address
  • bind/fund/mutual/arbitrated release tx hashes
  • bundle export path
  • python verify result
  • ts verify result (when Node/npm is available)

Protocol fee defaults

  • protocol_fee_ppm = 1000 (0.10%)
  • protocol_fee_min = 1 (base unit)

These defaults optimize adoption while ensuring non-gameable, volume-based protocol monetization.

SafeDealCapabilities v1 compatibility freeze

SafeDealCapabilities v1 is frozen. No required fields will be added. New features must be optional and backwards compatible.

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

safedeal_sdk-0.1.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

safedeal_sdk-0.1.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file safedeal_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: safedeal_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for safedeal_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a5e3c9f41a991e8c3ca2274af4e0bb7ba2924cc9d2052b37465fe95663d645de
MD5 f001ca95cc94b17c75abb8c7ff4d280a
BLAKE2b-256 587da17510a21676355b73cf69d802f4c486c68d2b42156b02b90ab407b39385

See more details on using hashes here.

File details

Details for the file safedeal_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: safedeal_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for safedeal_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da584eae9824062e13efdba96e928b583c2bced6c96b0ea583d821e63df0f963
MD5 261ba862cefdc9fdc26a4e3d1245f81b
BLAKE2b-256 a1208e4c88bb56d9fc522355c51f8802edb5f7adbf0b22408302a93ad1338914

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