Skip to main content

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

Metadata

Release files for bsv-compat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bsv-compat 0.1.0
File Size Uploaded Provenance
bsv_compat-0.1.0.tar.gz 8.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bsv-compat 0.1.0
File Interpreter ABI Platform
bsv_compat-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / bsv_compat-0.1.0.tar.gz

Download URL bsv_compat-0.1.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c27115da8f16d6aacdc5ca82bca1824726257f0f59c12759a9d29f5d7b80cf25
BLAKE2b-256 checksum
How to use checksums
cba92426c0e0b2ab92e9dae3ca90100c4d6922501e2c65c36d1ea293c4c781f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / bsv_compat-0.1.0-py3-none-any.whl

Download URL bsv_compat-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
880288825eb24e9bd996c2fba9526faa111f60ecf955711fc32d9501dcf7a386
BLAKE2b-256 checksum
How to use checksums
63cccc890aee5d4cd97e8e259e183e993615a6a3348e627f337948f446e98ba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for bsv-compat 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page