{"id":13650733,"url":"https://github.com/F483/btctxstore","last_synced_at":"2025-04-22T18:32:27.655Z","repository":{"id":31988683,"uuid":"35559173","full_name":"F483/btctxstore","owner":"F483","description":"I simple library to store/retrieve information in bitcoin transactions using OP_RETURN","archived":false,"fork":false,"pushed_at":"2024-08-02T11:35:34.000Z","size":380,"stargazers_count":10,"open_issues_count":16,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-28T05:38:07.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/F483.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-13T16:04:17.000Z","updated_at":"2024-08-02T11:35:38.000Z","dependencies_parsed_at":"2024-10-28T03:26:31.183Z","dependency_job_id":"c538cefe-7ae0-40ac-8af1-037c2413963f","html_url":"https://github.com/F483/btctxstore","commit_stats":{"total_commits":93,"total_committers":2,"mean_commits":46.5,"dds":"0.010752688172043001","last_synced_commit":"5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F483%2Fbtctxstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F483%2Fbtctxstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F483%2Fbtctxstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F483%2Fbtctxstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/F483","download_url":"https://codeload.github.com/F483/btctxstore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903157,"owners_count":17222495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T02:00:40.251Z","updated_at":"2024-11-10T01:31:05.203Z","avatar_url":"https://github.com/F483.png","language":"Python","funding_links":[],"categories":["Python Libraries","Go Tools","awesome Bitcoin"],"sub_categories":["E-Books"],"readme":"##########\nbtctxstore\n##########\n\n\n|BuildLink|_ |CoverageLink|_ |LicenseLink|_ |IssuesLink|_\n\n\n.. |BuildLink| image:: https://travis-ci.org/Storj/btctxstore.svg\n.. _BuildLink: https://travis-ci.org/Storj/btctxstore\n\n.. |CoverageLink| image:: https://coveralls.io/repos/Storj/btctxstore/badge.svg\n.. _CoverageLink: https://coveralls.io/r/Storj/btctxstore\n\n.. |LicenseLink| image:: https://img.shields.io/badge/license-MIT-blue.svg\n.. _LicenseLink: https://raw.githubusercontent.com/F483/btctxstore/master/LICENSE\n\n.. |IssuesLink| image:: https://img.shields.io/github/issues/F483/btctxstore.svg\n.. _IssuesLink: https://github.com/F483/btctxstore/issues\n\n\nA library to read/write data to bitcoin transactions as nulldata outputs.\n\n\n============\nInstallation\n============\n\nInstall btctxstore lib\n\n::\n\n  pip install btctxstore\n\n\n=========================\nUse fast native functions\n=========================\n\nThere is experimental code that will call into OpenSSL for slow functions.\nTo enable this, set (and export) environment variable PYCOIN_NATIVE=openssl.\n\n::\n\n  $ export PYCOIN_NATIVE=openssl\n\n\n================================\nstoring data in nulldata outputs\n================================\n\nStore data in blockchain in new transaction with nulldata output.\n\n.. code:: python\n\n  # from examples/store_nulldata.py\n  import binascii\n  from btctxstore import BtcTxStore\n\n  # Wallet used to pay for fee. Please do not spend the testnet coins is\n  # this wallet or the example will fail due to lack of funds.\n  wifs = [\"cUZfG8KJ3BrXneg2LjUX4VoMg76Fcgx6QDiAZj2oGbuw6da8Lzv1\"]\n\n  # use testnet and dont post tx to blockchain for example\n  api = BtcTxStore(testnet=True, dryrun=True)\n\n  # store data in blockchain as nulldata output (max 40bytes)\n  data = binascii.hexlify(b\"github.com/F483/btctxstore\")\n  txid = api.store_nulldata(data, wifs)\n  print(txid)\n\n\n=====================================\nretrieving data from nulldata outputs\n=====================================\n\nRetrieve transaction from blockchain and read data stored as nulldata output.\n\n.. code:: python\n\n  # from examples/retrieve_nulldata.py\n  from btctxstore import BtcTxStore\n\n  api = BtcTxStore(testnet=True, dryrun=True)  # use testing setup for example\n  txid = \"987451c344c504d07c1fa12cfbf84b5346535da5154006f6dc8399a8fae127eb\"\n  hexnulldata = api.retrieve_nulldata(txid)\n  print(hexnulldata)\n\n\n======================================\nsign/verify data (bitcoind compatible)\n======================================\n\n.. code:: python\n\n  # from examples/signverify.py\n  import binascii\n  from btctxstore import BtcTxStore\n\n  api = BtcTxStore(testnet=True, dryrun=True)  # use testing setup for example\n  wif = api.create_key()  # create new private key\n  address = api.get_address(wif)  # get private key address\n  data = binascii.hexlify(b\"messagetext\")  # hexlify messagetext\n\n  # sign data with private key\n  signature = api.sign_data(wif, data)\n  print(\"signature:\", signature)\n\n  # verify signature (no public or private key needed)\n  isvalid = api.verify_signature(address, signature, data)\n  print(\"valid signature\" if isvalid else \"invalid signature\")\n\n\n===========\nSplit utxos\n===========\n\nSplit utxos of wallet unitil limit or max_outputs reached.\n\n.. code:: python\n\n  # from examples/split_utxos.py\n  from btctxstore import BtcTxStore\n\n  # Please do not spend the testnet coins is this wallet\n  # or the example will fail due to lack of funds.\n  wif = \"cUZfG8KJ3BrXneg2LjUX4VoMg76Fcgx6QDiAZj2oGbuw6da8Lzv1\"\n\n  # use testnet and dont post tx to blockchain for example\n  api = BtcTxStore(testnet=True, dryrun=True)\n\n  limit = 10000000  # 0.1BTC\n  txids = api.split_utxos(wif, limit)\n  print(txids)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FF483%2Fbtctxstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FF483%2Fbtctxstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FF483%2Fbtctxstore/lists"}