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.4.tar.gz (29.5 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.4-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: safedeal-0.1.4.tar.gz
  • Upload date:
  • Size: 29.5 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.4.tar.gz
Algorithm Hash digest
SHA256 9f31a6ade9f11be3b86b2a454209592975d25cbfea754849f8f1df97aa9df900
MD5 312e2b6977aae79910c009806a66bbe5
BLAKE2b-256 b6a3184b2f2f3ff77d93dd1a25ddcdeca3772b32aa113d8d579802507a71f7a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safedeal-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 30.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 05d7e8dbf4b0690927e9f987a9cffd057d012079d19aadcf3d68abc4f99647f8
MD5 9a4c0c9c01368168f3347ec179f43303
BLAKE2b-256 0fc483febea193862a3834d3d4a23d92f4900e2c287244d8f57fed97f2eb2399

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