Skip to main content

Established (non-BRC) open BSV protocols for Python — Bitcom (B/MAP/AIP), BSM, paymail

Project description

bsv-compat

Established (non-BRC) open BSV protocols for Python.

The companion to bsv-brc: bsv-brc implements the forward-looking, ratified BRC standards (BRC-22/24/ 52/94/104/105/87 plus the overlay model); bsv-compat holds the established, widely-deployed BSV application protocols that are not BRC standards — and that the ecosystem is gradually moving away from. Keeping them in one place means they can evolve, and eventually be deprecated, without touching the canonical BRC library.

Both compose the official py-sdk (bsv-sdk on PyPI) — they don't reimplement keys/transactions/SPV.

Module Protocol What
bsv_compat.bitcom B / MAP / AIP / BSM Bitcoin-Schema OP_RETURN builder + parser + authorship

Status note. These protocols are "compat" for a reason: paymail is being de-emphasised by the BSV Association, and the Bitcom/Bitcoin-Schema data model is expected to give way to the overlay / BRC-100 approach over time. Use them for interop with the existing ecosystem; reach for bsv-brc for the path forward.

Install

pip install bsv-compat

Example — build and parse a Bitcoin-Schema OP_RETURN

from bsv_compat import bitcom

# Build OP_FALSE OP_RETURN with B (data) + MAP (attributes). The "|" section
# separator is emitted as the correct 1-byte pushdata (0x01 0x7c) — a raw 0x7c
# is OP_SWAP and silently breaks every parser that splits on "|".
script = bitcom.op_return(
    bitcom.b_section("hello world", media_type="text/plain"),
    bitcom.map_set({"app": "peck.to", "type": "post"}),
)

parsed = bitcom.parse_script(script)
parsed.map.app          # "peck.to"
parsed.map.fields       # {"app": "peck.to", "type": "post"}

# AIP authorship (the wallet usually signs; verify on read):
ok = bitcom.aip_verify(signed_data, address, signature)

Roadmap

  • Bitcom: B / MAP / AIP build + parse; BSM sign/verify/recover
  • paymail (bsvalias discovery, p2p payment destination, PKI) — the next large hand-rolled surface to consolidate

Development

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -v

License

Open BSV License

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

bsv_compat-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

bsv_compat-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bsv_compat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c27115da8f16d6aacdc5ca82bca1824726257f0f59c12759a9d29f5d7b80cf25
MD5 f9d8251a2973a2bc2c03e74037ca6763
BLAKE2b-256 cba92426c0e0b2ab92e9dae3ca90100c4d6922501e2c65c36d1ea293c4c781f3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bsv_compat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 880288825eb24e9bd996c2fba9526faa111f60ecf955711fc32d9501dcf7a386
MD5 444353da4dfc275d1125829348bcbc69
BLAKE2b-256 63cccc890aee5d4cd97e8e259e183e993615a6a3348e627f337948f446e98ba4

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