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.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-0.1.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: safedeal-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-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4948868b33a7a4339acc0e17389d79e0f7871a70ac6c614bf092eb12cfe351db
MD5 88b352e5cb813da9a5ffd0d561b61d27
BLAKE2b-256 51225540aa0d6129161b4bac7a806577f65dd7f80f3cf15c0a6cc50f29892c40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safedeal-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-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49af9b4cc28fedeef1cc0173694658e50137113ef2a0f7f942611d66bd9dabb6
MD5 5132eb0107215829a0c18455c309d168
BLAKE2b-256 64fb77bdf30492e32fe1ff99a475ae3f0e703e29919dde72d6e47eda0c7dd68e

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