{"action":"created","issue":{"url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/issues/1773","repository_url":"https://api.github.com/repos/HelloZeroNet/ZeroNet","labels_url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/issues/1773/labels{/name}","comments_url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/issues/1773/comments","events_url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/issues/1773/events","html_url":"https://github.com/HelloZeroNet/ZeroNet/issues/1773","id":379250603,"node_id":"MDU6SXNzdWUzNzkyNTA2MDM=","number":1773,"title":"Necessary code changes to support Python3","user":{"login":"HelloZeroNet","id":10350359,"node_id":"MDQ6VXNlcjEwMzUwMzU5","avatar_url":"https://avatars0.githubusercontent.com/u/10350359?v=4","gravatar_id":"","url":"https://api.github.com/users/HelloZeroNet","html_url":"https://github.com/HelloZeroNet","followers_url":"https://api.github.com/users/HelloZeroNet/followers","following_url":"https://api.github.com/users/HelloZeroNet/following{/other_user}","gists_url":"https://api.github.com/users/HelloZeroNet/gists{/gist_id}","starred_url":"https://api.github.com/users/HelloZeroNet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HelloZeroNet/subscriptions","organizations_url":"https://api.github.com/users/HelloZeroNet/orgs","repos_url":"https://api.github.com/users/HelloZeroNet/repos","events_url":"https://api.github.com/users/HelloZeroNet/events{/privacy}","received_events_url":"https://api.github.com/users/HelloZeroNet/received_events","type":"User","site_admin":false},"labels":[{"id":165233199,"node_id":"MDU6TGFiZWwxNjUyMzMxOTk=","url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"shortcutme","id":1019235,"node_id":"MDQ6VXNlcjEwMTkyMzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1019235?v=4","gravatar_id":"","url":"https://api.github.com/users/shortcutme","html_url":"https://github.com/shortcutme","followers_url":"https://api.github.com/users/shortcutme/followers","following_url":"https://api.github.com/users/shortcutme/following{/other_user}","gists_url":"https://api.github.com/users/shortcutme/gists{/gist_id}","starred_url":"https://api.github.com/users/shortcutme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shortcutme/subscriptions","organizations_url":"https://api.github.com/users/shortcutme/orgs","repos_url":"https://api.github.com/users/shortcutme/repos","events_url":"https://api.github.com/users/shortcutme/events{/privacy}","received_events_url":"https://api.github.com/users/shortcutme/received_events","type":"User","site_admin":false},"assignees":[{"login":"shortcutme","id":1019235,"node_id":"MDQ6VXNlcjEwMTkyMzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1019235?v=4","gravatar_id":"","url":"https://api.github.com/users/shortcutme","html_url":"https://github.com/shortcutme","followers_url":"https://api.github.com/users/shortcutme/followers","following_url":"https://api.github.com/users/shortcutme/following{/other_user}","gists_url":"https://api.github.com/users/shortcutme/gists{/gist_id}","starred_url":"https://api.github.com/users/shortcutme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shortcutme/subscriptions","organizations_url":"https://api.github.com/users/shortcutme/orgs","repos_url":"https://api.github.com/users/shortcutme/repos","events_url":"https://api.github.com/users/shortcutme/events{/privacy}","received_events_url":"https://api.github.com/users/shortcutme/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/milestones/2","html_url":"https://github.com/HelloZeroNet/ZeroNet/milestone/2","labels_url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/milestones/2/labels","id":3648430,"node_id":"MDk6TWlsZXN0b25lMzY0ODQzMA==","number":2,"title":"Moving to Python 3.x","description":null,"creator":{"login":"HelloZeroNet","id":10350359,"node_id":"MDQ6VXNlcjEwMzUwMzU5","avatar_url":"https://avatars0.githubusercontent.com/u/10350359?v=4","gravatar_id":"","url":"https://api.github.com/users/HelloZeroNet","html_url":"https://github.com/HelloZeroNet","followers_url":"https://api.github.com/users/HelloZeroNet/followers","following_url":"https://api.github.com/users/HelloZeroNet/following{/other_user}","gists_url":"https://api.github.com/users/HelloZeroNet/gists{/gist_id}","starred_url":"https://api.github.com/users/HelloZeroNet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HelloZeroNet/subscriptions","organizations_url":"https://api.github.com/users/HelloZeroNet/orgs","repos_url":"https://api.github.com/users/HelloZeroNet/repos","events_url":"https://api.github.com/users/HelloZeroNet/events{/privacy}","received_events_url":"https://api.github.com/users/HelloZeroNet/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2018-09-12T12:40:44Z","updated_at":"2018-11-09T17:21:23Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2018-11-09T17:20:40Z","updated_at":"2018-12-09T19:30:31Z","closed_at":null,"author_association":"OWNER","body":"### General\r\n- [ ] Run [2to3](https://docs.python.org/2/library/2to3.html) on every file to automatically apply language changes\r\n- [ ] Add GPL compatible headers (?) to every source code\r\n- [ ] Change % style variable formatting to .format and `_(\"...\")` style (to also get automatic escaping)\r\n\r\n### Source code changes\r\n\r\n#### main.py:\r\n  - [ ] Review ssl/old gevent patches\r\n  - [ ] Move configuration dependent actions (stack size/socket patching) to separate function in Config.py\r\n\r\n\r\n#### Content/ContentManager.py:\r\n  - [ ] Too heavy: Move verification code to separate ContentVerify.py\r\n\r\n\r\n#### Crypt/CryptBitcoin.py:\r\n  - [ ] Remove old style bitcoin signature code (BitcoinECC lib)\r\n\r\n\r\n#### Crypt/CryptConnection.py:\r\n  - [ ] Remove dead ECC code\r\n\r\n\r\n#### File/*\r\n  - [ ] Move to Peer directory as PeerServer and PeerRequest to make it more concrete\r\n\r\n\r\n#### Peer/PeerServer.py\r\n  - [ ] Move port checking code to separate PeerPortcheck.py\r\n\r\n\r\n#### Ui/UiRequest.py\r\n  - [ ] Requires major rebase, remove outdated /media handling\r\n\r\n\r\n#### Ui/UiWebsocket.py\r\n  - [ ] Move actions to UiWebsocketAction.py\r\n\r\n\r\n### Dependencies\r\n- [ ] bencode\r\n  - The current library is not available on PIP, possible top3 replacements: bencode, bencode-python3, python-bencode\r\n  - After running some test:\r\n    - The current lib is 2x faster on encode, but 2x slower on decode\r\n    - Py3 is 2x faster on encode and 4x faster on decode using the bencode pip lib\r\n- [ ] BitcoinECC\r\n  - We can remove this, as it's only used for the old (invalid) site addresses.\r\n- [ ] cssvendor\r\n  - Not a third party lib, created to transform special css tags to vendor specific ones.\r\n  - Should be compatible with python3\r\n- [ ] geventwebsocket\r\n  - Python3 compatible according to docs\r\n- [ ] merkletools\r\n  - Python3 compatible according to docs\r\n- [ ] opensslVerify\r\n  - Not a third party lib, used to interact with openssl so/dll using ctypes.\r\n  - Probably it's not Python3 compatible as it is.\r\n  - [x] Need check how hard to translate it to python3, Result: I was able to port it to Python3\r\n  - [ ] It could use some refactoring: The code is found at pastebin and the quality is not the best.\r\n  - [ ] Openssl 1.1 compatibility?\r\n  - Possible replacements:\r\n    - https://pyopenssl.org/\r\n      - Pros: Openssl 1.1 compatibility, Robust API\r\n      - Cons: Has not pure-python dependencies (https://cryptography.io/), could be problematic compiling on different platforms\r\n    - https://www.pycryptodome.org/\r\n      - Pros: Does not depends on openssl\r\n      - Cons: Self implementation of crypto\r\n    - https://github.com/cossacklabs/themis\r\n      - Pros: Modern, multi-platform crypto lib, supports Open/Boring/Libre SSL\r\n      - Cons: Needs to compile, Not widely used\r\n    - Last year ZeroMux sent me a coincurve/libsecp256k1 based library:\r\n      - Pros: Does not depends on openssl, According to the first benchmarks it's 2x-10x faster than openssl\r\n      - Cons: It's harder and longer to compile for different platforms, No support for message encryption (required for ZeroMail)\r\n    - https://github.com/petertodd/python-bitcoinlib\r\n      - Pros: Using ctypes, no other binary dependency, relatively lightweight\r\n      - Cons: No openssl 1.1 compatibility, According to github issue it may go unmaintained in the future\r\n    - https://github.com/Simplexum/python-bitcointx (current winner)\r\n      - Pros: For of python-bitcoinlib, libsecp256k1 support for signing (according to my benchmarks it's ~70% faster than openssl on win64)\r\n      - Cons: Less popular\r\n    - PyCrypto: Looks dead\r\n    - PyElliptic: Looks dead\r\n    - TODO: Needs benchmarking of current ctypes vs PyOpenSSL vs Cryptodome vs Themis\r\n- [ ] pyasn1\r\n  - Python3 compatible according to docs\r\n- [ ] pybitcointools\r\n  - Combatible with Python3, but no longer maintained. The latest version avaliable under name of bitcoin in pip\r\n  - Possible replacements:\r\n    - https://github.com/richardkiss/pycoin\r\n      - Pro: Pure python\r\n      - Cons: More robust, than pybitcointools (97 vs 12 files)\r\n- [ ] pyelliptic\r\n  - No longer maintained, but compatible with Python3\r\n  - Possible replacements: see opensslVerify\r\n- [ ] PySocks\r\n  - Not actively maintained, but compatible with Python3\r\n  - [ ] Earlier had problems with the latest versions used with Tor, has to check it again\r\n- [ ] rsa\r\n  - Python3 compatible according to docs\r\n- [ ] subtl\r\n  - Not avaliable on pip\r\n  - Probably not compatible with Python3\r\n  - Have not found simple, lightweight replacement, but it's pretty simple, probably adding the function to ZeroNet client itself should not be hard\r\n- [ ] websocket\r\n  - Python3 compatible according to docs\r\n  - Named websocket-client in pip\r\n\r\n### Binary dependencies\r\n\r\n- [ ] msgpack-python\r\n  - Python3 compatible according to docs\r\n- [ ] gevent\r\n  - Python3 compatible according to docs\r\n\r\n\r\n### Dev dependencies\r\n\r\n- [ ] pyfilesystem (renamed to fs)\r\n  - Python3 compatible according to docs\r\n- [ ] werkzeug (debugger)\r\n  - Python3 compatible according to docs\r\n\r\n### Deployment\r\n - [ ] Remove third party libs from src/libs\r\n - [ ] Update requirements.txt\r\n - [ ] Updater script for third party libs\r\n - [ ] Windows binary release\r\n - [ ] Linux binary release\r\n - [ ] macOS binary release\r\n - [ ] Update install instructions in documents\r\n\r\n### Crypto benchmarks\r\n\r\nPlatform: Win10, Python 3.7.1 64bit\r\n\r\nSigning x1000:\r\n - bitcointx + OpenSSL 1.0.2p compiled by indyproject: 3.22s\r\n - bitcointx + secp256k1 from coincurve pip (600k): 3.27s\r\n - bitcointx + secp256k1 extracted from secp256k1_vc120 nupkg (86k): 3.4s\r\n - cryptocurve: 0.081s\r\n \r\nVerification x1000:\r\n - bitcointx + OpenSSL 1.0.2p compiled by indyproject: 1.01s\r\n - cryptocurve: 0.141s\r\n"},"comment":{"url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/issues/comments/445564402","html_url":"https://github.com/HelloZeroNet/ZeroNet/issues/1773#issuecomment-445564402","issue_url":"https://api.github.com/repos/HelloZeroNet/ZeroNet/issues/1773","id":445564402,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTU2NDQwMg==","user":{"login":"HelloZeroNet","id":10350359,"node_id":"MDQ6VXNlcjEwMzUwMzU5","avatar_url":"https://avatars0.githubusercontent.com/u/10350359?v=4","gravatar_id":"","url":"https://api.github.com/users/HelloZeroNet","html_url":"https://github.com/HelloZeroNet","followers_url":"https://api.github.com/users/HelloZeroNet/followers","following_url":"https://api.github.com/users/HelloZeroNet/following{/other_user}","gists_url":"https://api.github.com/users/HelloZeroNet/gists{/gist_id}","starred_url":"https://api.github.com/users/HelloZeroNet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HelloZeroNet/subscriptions","organizations_url":"https://api.github.com/users/HelloZeroNet/orgs","repos_url":"https://api.github.com/users/HelloZeroNet/repos","events_url":"https://api.github.com/users/HelloZeroNet/events{/privacy}","received_events_url":"https://api.github.com/users/HelloZeroNet/received_events","type":"User","site_admin":false},"created_at":"2018-12-09T19:30:31Z","updated_at":"2018-12-09T19:30:31Z","author_association":"OWNER","body":"@ofek Sure, this is the code what we going to use: https://gist.github.com/HelloZeroNet/c82198335b430b51d86f9d6484fd91c2\r\n\r\nI got it from a ZeroNet user (@MuxZeroNet) a few months ago. Please let me know if you have suggestions. (We only going to use it for verification as the signing is pretty rare operation)"}}
{"actor":{"display_login":"HelloZeroNet"}}