{ "info": { "author": "Flavien Charlon", "author_email": "flavien@charlon.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Open Assets Reference Implementation\r\n====================================\r\n\r\nThe ``openassets`` Python package is the reference implementation of the colored coins `Open Assets Protocol `_.\r\n\r\nOpen Assets is a protocol for issuing and transferring custom digital tokens in a secure way on the Bitcoin blockchain (or any compatible blockchain).\r\n\r\nRequirements\r\n============\r\n\r\nThe following items are required for using the ``openassets`` package:\r\n\r\n* Python 3.4\r\n* The `python-bitcoinlib `_ package\r\n\r\nInstallation\r\n============\r\n\r\nLinux, OSX\r\n----------\r\n\r\nUsing pip::\r\n\r\n $ pip install openassets\r\n\r\nOr manually from source, assuming all required modules are installed on your system::\r\n\r\n $ python ./setup.py install\r\n\r\nWindows\r\n-------\r\n\r\n1) Make sure you have `Python 3.4 and pip `_ installed\r\n2) Open the command prompt: Start Menu > Accessories > Command Prompt\r\n3) Run the following command::\r\n\r\n pip install openassets\r\n\r\nOverview\r\n========\r\n\r\nThe ``openassets`` package contains two submodules: the ``protocol`` submodule and the ``transactions`` submodule.\r\n\r\n``protocol`` submodule\r\n----------------------\r\n\r\nThe ``protocol`` submodule implements the specification in order to interpret Bitcoin transactions as Open Assets transactions.\r\n\r\nUsage\r\n^^^^^\r\n\r\nThis example requires a Bitcoin Core instance running with RPC enabled and the ``-txindex=1`` parameter::\r\n\r\n import asyncio\r\n import bitcoin.rpc\r\n import openassets.protocol\r\n\r\n @asyncio.coroutine\r\n def main():\r\n bitcoin.SelectParams('testnet')\r\n\r\n # Create a RPC client for Bitcoin Core\r\n rpc_client = bitcoin.rpc.Proxy('http://user:pass@localhost:18332')\r\n # OutputCache implements the interface required for an output cache provider, but does not perform any caching\r\n cache = openassets.protocol.OutputCache()\r\n # The transaction provider is a function returning a transaction given its hash\r\n transaction_provider = asyncio.coroutine(rpc_client.getrawtransaction)\r\n # Instantiate the coloring engine\r\n coloring_engine = openassets.protocol.ColoringEngine(transaction_provider, cache, loop)\r\n\r\n transaction_hash = bitcoin.core.lx('864cbcb4b5e083a98aaeaf94443815025bdfb0d35a6fd00817034018b6752ff5')\r\n output_index = 1\r\n colored_output = yield from coloring_engine.get_output(transaction_hash, output_index)\r\n\r\n print(colored_output)\r\n\r\n loop = asyncio.get_event_loop()\r\n loop.run_until_complete(main())\r\n\r\n``transactions`` submodule\r\n--------------------------\r\n\r\nThe ``transactions`` submodule contains functions that can be used to build unsigned Open Assets transactions for various purposes.\r\n\r\nUsage\r\n^^^^^\r\n\r\nThis example requires a Bitcoin Core instance running with RPC enabled and the ``-txindex=1`` parameter::\r\n\r\n import asyncio\r\n import bitcoin.rpc\r\n import openassets.protocol\r\n import openassets.transactions\r\n\r\n @asyncio.coroutine\r\n def main():\r\n bitcoin.SelectParams('testnet')\r\n\r\n # Create a RPC client for Bitcoin Core\r\n rpc_client = bitcoin.rpc.Proxy('http://user:pass@localhost:18332')\r\n\r\n # Output script corresponding to address myLPe3P8SE2DyqRwABRwqezxdZxhkYxXYu (in testnet)\r\n output_script = bitcoin.core.x('76a914c372d85bc2c54384dbc2cb9ef365eb7f15d4a9b688ac')\r\n\r\n # Initialize the coloring engine\r\n transaction_provider = asyncio.coroutine(rpc_client.getrawtransaction)\r\n engine = openassets.protocol.ColoringEngine(transaction_provider, openassets.protocol.OutputCache(), loop)\r\n\r\n # Obtain the unspent output for the local wallet\r\n unspent_outputs = []\r\n for output in rpc_client.listunspent():\r\n if output['scriptPubKey'] == output_script:\r\n unspent_outputs.append(openassets.transactions.SpendableOutput(\r\n bitcoin.core.COutPoint(output['outpoint'].hash, output['outpoint'].n),\r\n (yield from engine.get_output(output['outpoint'].hash, output['outpoint'].n))\r\n ))\r\n\r\n # The minimum valid value for an output is set to 600 satoshis\r\n builder = openassets.transactions.TransactionBuilder(600)\r\n\r\n # Create the issuance parameters\r\n issuance_parameters = openassets.transactions.TransferParameters(\r\n unspent_outputs=unspent_outputs, # Unspent outputs the coins are issued from\r\n to_script=output_script, # The issued coins are sent back to the same address\r\n change_script=output_script, # The bitcoin change is sent back to the same address\r\n amount=1500) # Issue 1,500 units of the asset\r\n\r\n # Create the issuance transaction\r\n # The metadata is left empty and the fees are set to 0.0001 BTC\r\n transaction = builder.issue(issuance_parameters, metadata=b'', fees=10000)\r\n\r\n print(transaction)\r\n\r\n loop = asyncio.get_event_loop()\r\n loop.run_until_complete(main())\r\n\r\nLicense\r\n=======\r\n\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2014 Flavien Charlon\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/OpenAssets/openassets", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "openassets", "package_url": "https://pypi.org/project/openassets/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/openassets/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/OpenAssets/openassets" }, "release_url": "https://pypi.org/project/openassets/1.3/", "requires_dist": null, "requires_python": null, "summary": "Reference implementation of the Open Assets Protocol", "version": "1.3" }, "last_serial": 1292154, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "79da989c4dc2d5856ddbbf9b7c4b9797", "sha256": "4b567b29d88aaadb540c1f676a6bea7882d47157b8198e804ee60ff8e042ebd8" }, "downloads": -1, "filename": "openassets-1.0.zip", "has_sig": false, "md5_digest": "79da989c4dc2d5856ddbbf9b7c4b9797", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13793, "upload_time": "2014-10-18T09:30:05", "url": "https://files.pythonhosted.org/packages/28/98/995001ce6d8b065f377d2317bc1f3fa5e3f49965d03abbf4220cf4127fba/openassets-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "c6406113df1f66cb5d46c11a6480978a", "sha256": "0f45c13c7fd2f5fc4832c4bf54a0bc8640d5ca2308c8f8a47323d268b6beb593" }, "downloads": -1, "filename": "openassets-1.1.zip", "has_sig": false, "md5_digest": "c6406113df1f66cb5d46c11a6480978a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14234, "upload_time": "2014-10-24T13:57:47", "url": "https://files.pythonhosted.org/packages/e1/92/f77f8a1ba1932cea82cf929e6985587c7f2172d56b5932dfe0873b511431/openassets-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "b049f25ee0df6ceb4a92c153440d18cf", "sha256": "d58f5baf8589723bb94f0e2736a6a91b4b54b27ac1c583ccc97acc8368398956" }, "downloads": -1, "filename": "openassets-1.2.zip", "has_sig": false, "md5_digest": "b049f25ee0df6ceb4a92c153440d18cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14357, "upload_time": "2014-10-26T00:40:46", "url": "https://files.pythonhosted.org/packages/57/9e/291b3f519cff1a78d29948653afd336d5e8bba30a996264c3b5c3b8221dd/openassets-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "25a8d570b2b0c3dd8e28b947a3efcacc", "sha256": "d06ba02ec96303dc8ec50ad9b38911e3fbfc9b3df07fddd3e00206acdb7e8ac0" }, "downloads": -1, "filename": "openassets-1.3.zip", "has_sig": false, "md5_digest": "25a8d570b2b0c3dd8e28b947a3efcacc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14322, "upload_time": "2014-11-02T23:08:07", "url": "https://files.pythonhosted.org/packages/ae/dc/40a2e976c5d3bb74cc4476842d037b7599ded297807294dc67aac59916b3/openassets-1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "25a8d570b2b0c3dd8e28b947a3efcacc", "sha256": "d06ba02ec96303dc8ec50ad9b38911e3fbfc9b3df07fddd3e00206acdb7e8ac0" }, "downloads": -1, "filename": "openassets-1.3.zip", "has_sig": false, "md5_digest": "25a8d570b2b0c3dd8e28b947a3efcacc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14322, "upload_time": "2014-11-02T23:08:07", "url": "https://files.pythonhosted.org/packages/ae/dc/40a2e976c5d3bb74cc4476842d037b7599ded297807294dc67aac59916b3/openassets-1.3.zip" } ] }