Skip to main content

Cash Account Helper

You can already take payment information like an address and register a cash account at cashaccount.info. I really recommend you do.

This CLI and library will help you prepare cash account registrations that you can broadcast yourself.

Installation

Requires python3 for now.

pip install pycashaccount

Status / ToDo

It is very basic still. Please file an issue if you have additional use cases for it.

  • OP_RETURN output for electron-cash op_return markdown
  • OP_RETURN hex-like output
  • p2sh output
  • support payment codes
  • generate raw hex output that common node CLIs can use
  • support stealth addresses
  • support lookup of cash accounts

Note about Bip47 payment codes

Bip47 payment codes are very interesting. Please read this introduction to them before using pycashaccount to register a payment code. The payment code itself is non-trivial to generate so pycashaccount lets you create registration info from the xpub as well as the payment code itself. Please be very careful with xpubs. Please make absolutely sure you do not export and start copy-pasting an xpriv.

CLI (command line interface) usage after installation

For example, get the information required for a key hash and script hash accounts:

p2pkh="bitcoincash:qrme8l598x49gmjhn92dgwhk5a3znu5wfcf5uf94e9"
p2sh="bitcoincash:pp4d24pemra2k3mths8cjxpuu6yl3a5ctvcp8mdkm9"
paymentcode="PM8TJTLJbPRGxSbc8EJi42Wrr6QbNSaSSVJ5Y3E4pbCYiTHUskHg13935Ubb7q8tx9GVbh2UuRnBc3WSyJHhUrw8KhprKnn9eDznYGieTzFcwQRya4GA"
xpub="xpub6D3t231wUi5v9PEa8mgmyV7Tovg3CzrGEUGNQTfm9cK93je3PgX9udfhzUDx29pkeeHQBPpTSHpAxnDgsf2XRbvLrmbCUQybjtHx8SUb3JB"

cashaccount keyhash     name1 "$p2pkh"
cashaccount scripthash  name2 "$p2sh"           --format=opreturn
cashaccount paymentcode name4 from-xpub "$xpub" --format=electron-markdown
cashaccount paymentcode name3 from-code "$paymentcode"

Generally:

cashaccount payment_type name payment_info [--format]

Get help:

cashaccount --help

cashaccount keyhash --help

CLI usage directly from repository

Same usage as the installed cli, except you can call it from the cli script at the repository root:

./cli --help

Library usage

Look at cashaccount/cli.py for usage.

For example, create a registration from a name and payment information.

from cashaccount import KeyHashInfo, Registration, opreturn

name = 'emergent_reasons'
info = KeyHashInfo('bitcoincash:qrme8l598x49gmjhn92dgwhk5a3znu5wfcf5uf94e9')
registration = Registration(name, info)
print(registration)
print(opreturn(registration))

Contributions

Code contributions are welcome:

  • Fork the repository and submit a pull request from your fork.
  • Install test requirements pip install -r requirements-test.txt
  • Update tests to cover any changes
  • Confirm all tests pass before submitting a Pull Request (e.g. pytest --cov-report term-missing --cov=cashaccount test/)

Support donations are also welcome:

  • 🌵emergent_reasons#100 (bitcoincash:qz3aq0uhltztqyjy2esa0lshadg9pf87yu7yealu3a)
  • ☯Jonathan#100 for donations to the cashaccount project (bitcoincash:qr4aadjrpu73d2wxwkxkcrt6gqxgu6a7usxfm96fst)
  • Electron Cash (bottom of the page) The team added a general OP_RETURN feature where you can use the opreturn formatting.

Metadata

Release files for pycashaccount 0.3.2

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

Source distribution (sdist)

Source distribution for pycashaccount 0.3.2
File Size Uploaded Provenance Actions
pycashaccount-0.3.2.tar.gz 8.2 kB Without provenance Details for pycashaccount-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pycashaccount 0.3.2
File Interpreter ABI Platform Actions
pycashaccount-0.3.2-py3-none-any.whl Python 3 none any Details for pycashaccount-0.3.2-py3-none-any.whl

Total release size: 19.3 kB

Release files / pycashaccount-0.3.2.tar.gz

Download URL pycashaccount-0.3.2.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4efef99806fdba1d1fb743bc98c72ca56f0fd32f5f43a0073c24a1881c3b5232
BLAKE2b-256 checksum
How to use checksums
739ca15b87f8539431f281271b58bdb6776db3ad26eaf999499566861fe2506b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release files / pycashaccount-0.3.2-py3-none-any.whl

Download URL pycashaccount-0.3.2-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87d0484db232850a25b78f047b38452ce075d025f8190b76659784a1ebb7d0c0
BLAKE2b-256 checksum
How to use checksums
31b274ddbd0a9c1b9c0fa4bd0ed913323bdc656ddd707b942b3628b80cebd9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Security for pycashaccount 0.3.2

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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