{ "info": { "author": "eric sun", "author_email": "ericsgy@163.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Programming Language :: Python :: 3" ], "description": "# asimov-lib\n\nThis Python3 library provides an easy interface to the bitcoin data\nstructures. This is based on https://github.com/Simplexum/python-bitcointx,\nbut is focused only on fixing bugs and adjusting for asimov blockchain.\n\n## Requirements\n\n- [libsecp256k1](https://github.com/bitcoin-core/secp256k1)\n- [openssl](https://github.com/openssl/openssl) (optional, for historical signatures verification)\n\nThe RPC interface, `bitcointx.rpc`, is designed to work with Bitcoin Core v0.16.0.\nOlder versions may work but there do exist some incompatibilities.\n\n\n## Structure\n\nEverything consensus critical is found in the modules under bitcointx.core. This\nrule is followed pretty strictly, for instance chain parameters are split into\nconsensus critical and non-consensus-critical.\n\n bitcointx.core - Basic core definitions, datastructures, and\n (context-independent) validation\n bitcointx.core.key - ECC pubkeys\n bitcointx.core.script - Scripts and opcodes\n bitcointx.core.scripteval - Script evaluation/verification\n bitcointx.core.serialize - Serialization\n\nNote that this code may not be fully consensus-compatible with current\nbitcoin core codebase. Corner cases that is not relevant to creating valid bitcoin\ntransactions is unlikely to be considered. See also note on VerifyScript usage below.\n\nNon-consensus critical modules include the following:\n\n bitcointx - Chain selection\n bitcointx.base58 - Base58 encoding\n bitcointx.rpc - Bitcoin Core RPC interface support\n bitcointx.wallet - Wallet-related code, currently Bitcoin address and\n private key support\n\nEffort has been made to follow the Satoshi source relatively closely, for\ninstance Python code and classes that duplicate the functionality of\ncorresponding Satoshi C++ code uses the same naming conventions: CTransaction,\nCPubKey, nValue etc. Otherwise Python naming conventions are followed.\n\n## Mutable vs. Immutable objects\n\nLike the Bitcoin Core codebase CTransaction is immutable and\nCMutableTransaction is mutable; unlike the Bitcoin Core codebase this\ndistinction also applies to COutPoint, CTxIn, CTxOut.\n\n\n## Endianness Gotchas\n\nRather confusingly Bitcoin Core shows transaction and block hashes as\nlittle-endian hex rather than the big-endian the rest of the world uses for\nSHA256. python-bitcointx provides the convenience functions x() and lx() in\nbitcointx.core to convert from big-endian and little-endian hex to raw bytes to\naccomodate this. In addition see b2x() and b2lx() for conversion from bytes to\nbig/little-endian hex.\n\n## Note on VerifyScript() usage\n\nIt is good to use VerifyScript to pre-screen the transaction inputs that\nyou create, before passing the transaction to bitcoind, or for debugging purposes.\n\nBut! Bitcoin Core should _always_ remain the authoritative source on bitcoin\ntransaction inputs validity.\n\nScript evaluation code of VerifyScript() is NOT in sync with Bitcoin Core code,\nand lacks some features. While some effort was made to make it behave closer\nto the code in Bitcoin Core, full compatibility is far away, and most likely\nwill not be ever achieved.\n\n**WARNING**: DO NOT rely on VerifyScript() in deciding if certain signed\ntransaction input is valid. In some corner cases (non-standard signature encoding,\nunhandled script evaluation flags, etc) it may deem something invalid that bitcoind\nwould accept as valid. More importanty, it could accept something as valid\nthat bitcoind would deem invalid.\n\n## Module import style\n\nWhile not always good style, it's often convenient for quick scripts if\n`import *` can be used. To support that all the modules have `__all__` defined\nappropriately.\n\n\n# Example Code\n\nSee `examples/` directory. For instance this example creates a transaction\nspending a pay-to-script-hash transaction output:\n\n $ PYTHONPATH=. examples/spend-pay-to-script-hash-txout.py\n \n\n\n## Selecting the chain to use\n\nDo the following:\n\n import bitcointx\n bitcointx.SelectParams(NAME)\n\nWhere NAME is one of 'testnet', 'mainnet', or 'regtest'. The chain currently\nselected is a global variable that changes behavior everywhere, just like in\nthe Satoshi codebase.\n\nTo use alternative chain parameters:\n\n import bitcointx\n bitcointx.SelectAlternativeParams(AltCoreParams, AltParams)`\n\nSee `examples/litecoin-alt-p2sh-prefix.py` for an example usage.\n\n## Unit tests\n\nUnder bitcointx/tests using test data from Bitcoin Core. To run them:\n\n python -m unittest discover && python3 -m unittest discover\n\nAlternately, if Tox (see https://tox.readthedocs.org/) is available on your\nsystem, you can run unit tests for multiple Python versions:\n\n ./runtests.sh\n\nCurrently, the following implementations are tried (any not installed are\nskipped):\n\n * CPython 3.4\n * CPython 3.5\n * PyPy\n * PyPy3\n\nHTML coverage reports can then be found in the htmlcov/ subdirectory.\n\n## Documentation\n\nSphinx documentation is in the \"doc\" subdirectory. Run \"make help\" from there\nto see how to build. You will need the Python \"sphinx\" package installed.\n\nCurrently this is just API documentation generated from the code and\ndocstrings. Higher level written docs would be useful, perhaps starting with\nmuch of this README. Pages are written in reStructuredText and linked from\nindex.rst.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/BlockGeeks0x01/asimov-lib", "keywords": "bitcoin", "license": "", "maintainer": "", "maintainer_email": "", "name": "asimov-lib", "package_url": "https://pypi.org/project/asimov-lib/", "platform": "", "project_url": "https://pypi.org/project/asimov-lib/", "project_urls": { "Homepage": "https://github.com/BlockGeeks0x01/asimov-lib" }, "release_url": "https://pypi.org/project/asimov-lib/0.10.4.dev0/", "requires_dist": null, "requires_python": ">=3.4", "summary": "The Swiss Army Knife of the Bitcoin protocol.", "version": "0.10.4.dev0" }, "last_serial": 5730678, "releases": { "0.10.4.dev0": [ { "comment_text": "", "digests": { "md5": "6400e027c5c634213a7231f4c2d6bac5", "sha256": "42c0ce848d18328f613738d589c2faac9d4aacc44bc1d7b71c80ca2b11dab785" }, "downloads": -1, "filename": "asimov_lib-0.10.4.dev0-py3-none-any.whl", "has_sig": false, "md5_digest": "6400e027c5c634213a7231f4c2d6bac5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 95794, "upload_time": "2019-08-26T12:54:52", "url": "https://files.pythonhosted.org/packages/40/fd/a84aace8d42f05c57bb37242c556ee6de4a61ead742adececa2cfe1b6334/asimov_lib-0.10.4.dev0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03df41fd0e59b59f0258c71609b095b9", "sha256": "c37e0d3b1397f7d9ff9fe52ed56ad70c099867df9f6474cef7396bed3734368d" }, "downloads": -1, "filename": "asimov-lib-0.10.4.dev0.tar.gz", "has_sig": false, "md5_digest": "03df41fd0e59b59f0258c71609b095b9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 151711, "upload_time": "2019-08-26T12:54:54", "url": "https://files.pythonhosted.org/packages/39/4a/ca011d9f47f0ccfcc0f081c60bae73ac46dd0920a44fd70e78d06cacc970/asimov-lib-0.10.4.dev0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6400e027c5c634213a7231f4c2d6bac5", "sha256": "42c0ce848d18328f613738d589c2faac9d4aacc44bc1d7b71c80ca2b11dab785" }, "downloads": -1, "filename": "asimov_lib-0.10.4.dev0-py3-none-any.whl", "has_sig": false, "md5_digest": "6400e027c5c634213a7231f4c2d6bac5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 95794, "upload_time": "2019-08-26T12:54:52", "url": "https://files.pythonhosted.org/packages/40/fd/a84aace8d42f05c57bb37242c556ee6de4a61ead742adececa2cfe1b6334/asimov_lib-0.10.4.dev0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03df41fd0e59b59f0258c71609b095b9", "sha256": "c37e0d3b1397f7d9ff9fe52ed56ad70c099867df9f6474cef7396bed3734368d" }, "downloads": -1, "filename": "asimov-lib-0.10.4.dev0.tar.gz", "has_sig": false, "md5_digest": "03df41fd0e59b59f0258c71609b095b9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 151711, "upload_time": "2019-08-26T12:54:54", "url": "https://files.pythonhosted.org/packages/39/4a/ca011d9f47f0ccfcc0f081c60bae73ac46dd0920a44fd70e78d06cacc970/asimov-lib-0.10.4.dev0.tar.gz" } ] }