{"id":20987416,"url":"https://github.com/stacks-archive/keylib-py","last_synced_at":"2025-05-14T17:33:55.615Z","repository":{"id":57415698,"uuid":"53879897","full_name":"stacks-network/keylib-py","owner":"stacks-network","description":"Library for elliptic curve (ECDSA) private keys, public keys, and bitcoin addresses.","archived":false,"fork":false,"pushed_at":"2023-09-10T14:44:38.000Z","size":24,"stargazers_count":13,"open_issues_count":2,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-14T00:51:06.512Z","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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-14T18:11:44.000Z","updated_at":"2024-06-03T20:49:09.000Z","dependencies_parsed_at":"2024-06-21T13:53:50.611Z","dependency_job_id":null,"html_url":"https://github.com/stacks-network/keylib-py","commit_stats":null,"previous_names":["blockstack/keylib-py"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fkeylib-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fkeylib-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fkeylib-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacks-network%2Fkeylib-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacks-network","download_url":"https://codeload.github.com/stacks-network/keylib-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225303944,"owners_count":17453037,"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:53.472Z","updated_at":"2025-05-14T17:33:50.296Z","avatar_url":"https://github.com/stacks-network.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keylib\n\n[![CircleCI](https://img.shields.io/circleci/project/blockstack/keylib-py/master.svg)](https://circleci.com/gh/blockstack/keylib-py/tree/master)\n[![PyPI](https://img.shields.io/pypi/v/keylib.svg)](https://pypi.python.org/pypi/keylib/)\n[![PyPI](https://img.shields.io/pypi/l/keylib.svg)](https://github.com/namesystem/keylib/blob/master/LICENSE)\n[![Slack](http://slack.blockstack.org/badge.svg)](http://slack.blockstack.org/)\n\n## Installation\n\n```bash\n$ pip install keylib\n```\n\n## Usage\n\n### Private Keys\n\n```python\n\u003e\u003e\u003e from keylib import ECPrivateKey\n```\n\n#### New Private Keys\n\n```python\n\u003e\u003e\u003e private_key = ECPrivateKey()\n\u003e\u003e\u003e private_key.to_hex()\n'c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a01'\n\u003e\u003e\u003e private_key.to_wif()\n'L3p8oAcQTtuokSCRHQ7i4MhjWc9zornvpJLfmg62sYpLRJF9woSu'\n```\n\n#### Imported Private Keys\n\n```python\n\u003e\u003e\u003e imported_private_key = ECPrivateKey(private_key.to_hex())\n\u003e\u003e\u003e print private_key.to_wif() == imported_private_key.to_wif()\nTrue\n```\n\n### Public Keys\n\n```python\n\u003e\u003e\u003e from keylib import ECPublicKey\n```\n\n#### Public Keys from Private Keys\n\n```python\n\u003e\u003e\u003e public_key = private_key.public_key()\n\u003e\u003e\u003e public_key.to_hex()\n'03019979ec442e61ace8d47c6a344d791cee12d4e7bbde05fa91a62c0cda51c834'\n```\n\n#### Imported Public Keys\n\n```python\n\u003e\u003e\u003e imported_public_key = ECPublicKey(public_key.to_hex())\n\u003e\u003e\u003e print public_key.to_hex() == imported_public_key.to_hex()\nTrue\n```\n\n### Addresses\n\n```python\n\u003e\u003e\u003e from keylib import public_key_to_address\n```\n\n#### Addresses from Public Key Objects\n\n```python\n\u003e\u003e\u003e public_key.address()\n'12WDrxysCBDtVxaP1n4HHj8BLqqqfaqANd'\n```\n\n#### RIPEMD160 Hashes from Public Key Objects\n\n```python\n\u003e\u003e\u003e public_key.hash160()\n'107eecc5868111ba06e6bd9309b2db90c555cb6e'\n```\n\n#### Addresses from Hex Public Keys\n\n```python\n\u003e\u003e\u003e public_key_to_address(\"030589ee559348bd6a7325994f9c8eff12bd5d73cc683142bd0dd1a17abc99b0dc\")\n'1KbUJ4x8epz6QqxkmZbTc4f79JbWWz6g37'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacks-archive%2Fkeylib-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacks-archive%2Fkeylib-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacks-archive%2Fkeylib-py/lists"}