ReinProject / python-rein

Client for a decentralized freelancing market
https://reinproject.org
GNU General Public License v3.0
37 stars 21 forks source link

BIP32/39 sign up #80

Closed alexanderdushkin closed 7 years ago

alexanderdushkin commented 7 years ago

This pull request implements BIP32/39 sign up with Rein. Both web-based and CLI signup, as well as account import have been rewritten. Particularly, Rein now signs all enrollment documents automatically.

CAUTION: This update would probably break backwards compatibility with older Rein local databases. As requested by @weex I added the delegate private master key to the identity table in the DB, so the user model has changed. I couldn't test the thing, but it should fail as no dxprv field is present in old databases.

This is solved by deleting your local Rein data with rm -rf ~/.rein and importing your data from backup. The import process has been designed to sign your enrollment document with your mnemonic if you used the new version or your master private key if you used the old version. In the latter case the dxprv field is set to null in the DB. As per issue #76, Rein does not create duplicates when you request microhosting space so you can safely do rein request <server> and then rein sync while preserving your account.

weex commented 7 years ago

This is really cool @adsalpha, looking forward to further testing on this before integrating.

alexanderdushkin commented 7 years ago

@weex great, just lmk if you need me to test something specifically.

weex commented 7 years ago

Gave this a bit of testing and though the signup and and request work I can't seem to get to any pages after setup. /, /bid, /post etc say not found. I tested this on a vm I had setup for other testing so not sure if there's some conflict. Just want to verify if this expected behavior for now.

alexanderdushkin commented 7 years ago

Not really expected, although I touched neither of those pages. Have you used rein request and rein sync prior to accessing those URIs? If you did, lmk I will review the issue.

I only worked on my module and for the server, everything remains the same. At least that's what I expected, that's why I only tested my module.

weex commented 7 years ago

The issue of not getting into any pages was because the project didn't have a MANIFEST.in file. This is why installing with pip install --editable . worked but python setup.py install did not. The latter needs to know which non .py files to copy whereas the first just links the OS directly to the source directory which includes rein/html.*.

One other question though @adsalpha. Can you point to the bip32 path scheme this is using and where that lives in the code? Thanks.

alexanderdushkin commented 7 years ago

I think I will add it to 'Addresses and payments' in the README file.

alexanderdushkin commented 7 years ago

@weex, done.

weex commented 7 years ago

Awesome, thanks.

weex commented 7 years ago

Just an FYI, akrmn is integrating this with his latest changes in preparation for a v0.3 release. So this PR won't be merged directly though commits will be included with appropriate attribution.