{"id":20987411,"url":"https://github.com/stacks-network/pybitcoin","last_synced_at":"2025-03-22T19:07:00.889Z","repository":{"id":12691815,"uuid":"15364116","full_name":"stacks-network/pybitcoin","owner":"stacks-network","description":"A Bitcoin python library for private + public keys, addresses, transactions, \u0026 RPC","archived":false,"fork":false,"pushed_at":"2023-09-09T13:58:49.000Z","size":1629,"stargazers_count":277,"open_issues_count":34,"forks_count":116,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-03-22T13:47:39.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/stacks-network.png","metadata":{"files":{"readme":"README.md","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-21T19:10:25.000Z","updated_at":"2025-03-13T19:16:40.000Z","dependencies_parsed_at":"2024-06-19T00:23:49.587Z","dependency_job_id":"9a181881-77e9-43e0-83af-b0be023262ec","html_url":"https://github.com/stacks-network/pybitcoin","commit_stats":null,"previous_names":["blockstack/pybitcoin","onenameio/coinkit","halfmoonlabs/coins"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fpybitcoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fpybitcoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fpybitcoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fpybitcoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacks-network","download_url":"https://codeload.github.com/stacks-network/pybitcoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966453,"owners_count":20539794,"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-11-19T06:16:52.662Z","updated_at":"2025-03-22T19:07:00.863Z","avatar_url":"https://github.com/stacks-network.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pybitcoin\n=====\n\n## This code is deprecated and should not be used\n\nPython library with tools for Bitcoin and other cryptocurrencies.\n\n## Usage\n\n### Private Keys\n\n```python\n\u003e\u003e\u003e from pybitcoin import BitcoinPrivateKey\n\u003e\u003e\u003e private_key = BitcoinPrivateKey()\n\u003e\u003e\u003e private_key.to_hex()\n'91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d'\n\u003e\u003e\u003e private_key.to_wif()\n'5JvBUBPzU42Y7BHD7thTnySXQXMk8XEJGGQGcyBw7CCkw8RAH7m'\n\u003e\u003e\u003e private_key_2 = BitcoinPrivateKey('91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d')\n\u003e\u003e\u003e print private_key.to_wif() == private_key_2.to_wif()\nTrue\n```\n\n### Public Keys\n\n```python\n\u003e\u003e\u003e public_key = private_key.public_key()\n\u003e\u003e\u003e public_key.to_hex()\n'042c6b7e6da7633c8f226891cc7fa8e5ec84f8eacc792a46786efc869a408d29539a5e6f8de3f71c0014e8ea71691c7b41f45c083a074fef7ab5c321753ba2b3fe'\n\u003e\u003e\u003e public_key_2 = BitcoinPublicKey(public_key.to_hex())\n\u003e\u003e\u003e print public_key.to_hex() == public_key_2.to_hex()\nTrue\n```\n\n### Addresses\n\n```python\n\u003e\u003e\u003e public_key.address()\n'13mtgVARiB1HiRyCHnKTi6rEwyje5TYKBW'\n\u003e\u003e\u003e public_key.hash160()\n'1e6db1e09b5e307847e5734864a79ea0113d0083'\n```\n\n### Brainwallet-based Private Keys\n\n```python\n\u003e\u003e\u003e private_key = BitcoinPrivateKey.from_passphrase()\n\u003e\u003e\u003e private_key.passphrase()\n'shepherd mais pack rate enamel horace diva filesize maximum really roar mall'\n\u003e\u003e\u003e private_key.to_hex()\n'91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d'\n\u003e\u003e\u003e priv2 = BitcoinPrivateKey.from_passphrase(priv2.passphrase())\n\u003e\u003e\u003e print private_key.to_hex() == priv2.to_hex()\nTrue\n```\n\n### Sending Transactions to Addresses\n\n```python\n\u003e\u003e\u003e from pybitcoin import BlockcypherClient\n\u003e\u003e\u003e recipient_address = '1EEwLZVZMc2EhMf3LXDARbp4mA3qAwhBxu'\n\u003e\u003e\u003e blockchain_client = BlockcypherClient(BLOCKCYPHER_API_KEY)\n\u003e\u003e\u003e send_to_address(recipient_address, 10000, private_key.to_hex(), blockchain_client)\n```\n\n### Sending OP_RETURN Transactions\n\n```python\n\u003e\u003e\u003e from pybitcoin import make_op_return_tx\n\u003e\u003e\u003e data = '00' * 80\n\u003e\u003e\u003e tx = make_op_return_tx(data, private_key.to_hex(), blockchain_client, fee=10000, format='bin')\n\u003e\u003e\u003e broadcast_transaction(tx, blockchain_client)\n{\"success\": True}\n```\n\n### Altcoins\n\n```python\n\u003e\u003e\u003e class NamecoinPrivateKey(BitcoinPrivateKey):\n\u003e\u003e\u003e     _pubkeyhash_version_byte = 52\n\u003e\u003e\u003e namecoin_private_key = NamecoinPrivateKey(private_key.to_hex())\n\u003e\u003e\u003e namecoin_private_key.to_wif()\n'73zteEjenBCK7qVtG2yRPeco2TP5w93qBW5sJkxYoGYvbWwAbXv'\n\u003e\u003e\u003e namecoin_public_key = namecoin_private_key.public_key()\n\u003e\u003e\u003e namecoin_public_key.address()\n'MyMFt8fQdZ6rEyDhZbe2vd19gD8gzagr7Z'\n```\n\n## Supported currencies\n\nLitecoin, Namecoin, Peercoin, Primecoin, Testnet, Worldcoin, Megacoin, Feathercoin, Terracoin, Novacoin, Dogecoin, Anoncoin, Protoshares, Ixcoin, Memorycoin, Infinitecoin, Cryptogenic Bullion, Quarkcoin, Netcoin, Earthcoin, Reddcoin, (insert your favorite cryptocurrency here)\n\n## Developers\n\n**Q:** Can I contribute to pybitcoin?\n\n**A:** Of course! Any and all are encouraged to contribute. Just fork a copy of the repo and get started on something that you think would improve the current offering.\n\n**Q:** What should I work on?\n\n**A:** That's up to you! For a quick project, consider adding support for a new cryptocurrency (should only require two lines of code, not including the unit tests).\n\nMeanwhile, for something a bit more ambitious, check the issues section for outstanding feature requests.\n\n## Notice\n\npybitcoin is still in beta. Developers using pybitcoin are encouraged to inspect the code for themselves and perform their own tests. We are committed to ensuring that this library behaves exactly as it is supposed to under all conditions, and have plans to ramp up our testing efforts going forward.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacks-network%2Fpybitcoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacks-network%2Fpybitcoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacks-network%2Fpybitcoin/lists"}