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-0.1.2.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

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

safedeal-0.1.2-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file safedeal-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for safedeal-0.1.2.tar.gz
Algorithm Hash digest
SHA256 757da838d633481df6c67b73fd245282da3048ec07321af327caf00135c4a1fa
MD5 de748a82b2dc2cebe8eb106ecd81fb79
BLAKE2b-256 da1209329403bc176683ec0a2b2af590975375c9abe3d3d8acb91609394c40c6

See more details on using hashes here.

File details

Details for the file safedeal-0.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for safedeal-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 809e8b802083e611bb592d6fd3b8af09c8a0f231933d14b27f365416f4123b0a
MD5 6cb4e8f9da53eb6ad30ef95f30ad92bc
BLAKE2b-256 8ee4607d63202fc0f1d63c9155fcef63ff86f6c2e22c34f64f1af9ed693b250c

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