Author Topic: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)  (Read 3133 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12722
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Dear community,

this is my 10,000th post in this forum and I have prepared something special to show my passion about BitShares (and the
Graphene Technology) and try to establish a profitable business in this ecosystem:

Two Factor Authentication
I would like to introduce a second factor authentication service for the BitShares network. It will require users to
request a new account by sending a memo and a registration fee to on of our accounts. To secure your new account, We
will make heavy use of "proposed transactions".

Note that we are currently running in a beta testing phase and hence recommend to only use small amounts of
your money to test this system. It is also required to use a patched cli_wallet for now. I hope to see proposed
transactions in the GUI wallet somewhen in Q1/2016. Until then I can only recommend very advanced users to try out this
service.


Costs for the users
Providing increased security for your funds is a service that cannot be offered "for free". Hence, we need to cover our
costs and find a way to fund future development. During the beta testing we will offer our service at a cost of
0.4% of the transfer amount and 200 BTS account registration fees (see below).

Only during the beta testing, the service fee will be 0.0%. Accounts will be migrated from the beta testing once
we eliminated all issues yet to be found.

Procedure (for discussion)
Registration
  • A customer sends a 200 BTS from his account to the account peermit-reg and puts his email address in the memo
  • These funds will be used to register your new "secured account" (of which YOU will be the only owner)
  • We will send you an email containing the secured accounts' name

Funding your secured account
Your secured account can be funded similar to any other account: Just use the account name you have received by email.
You should take a look at the permissions tab to see that YOU are the sole owner of the account and are among the list
of active permissions with half the weight that is required by the threshold.

Spending funds
  • To spend funds from the secured account one of these conditions have to be
       met:
    • your OWNER key signs the transaction
    • your ACTIVE key AND our ACTIVE key sign the transaction
       By this, it is ensured that
    • you control the account and can opt-out of the service
    • your active key alone cannot spend funds of that account unless you also have access to the mail account
       
  • You propose a transaction that spends from the secured account
  • You approve your own proposal
  • We notice that proposal and send an email verification token to your registered mail address
  • Upon clicking the verification link on the mail, we will sign the proposal
  • After the expiration time your proposal will validate and the proposed transaction will execute.

Security aspects
  • The customer can Opt-Out at any time since they own the "owner" authority
  • Transactions need TWO signatures (ours and yours) or your owner authority
  • Owner key of our multisignature account is stored offline and never touched an internet-connected device
  • Active Key of our multisignature account can (and will be) rotated on a regular basis to ensure that a compromised key cannot sign future proposals.
  • Access to the signing machine is restricted by VPN and API-control restrictions
  • If the proposal is not verified, the funds will not move (of course)
  • This scheme allows to "combine" several multisig schemes with additional required authorities by 3rd parties
  • Aribtrary expiration (e.g. 24h). If the proposal is not verified, the funds will not move (of course)

Attack scenarios
  • Our multisignature account is compromised:
        Since only the active key can be compromiese (owner key is 'very cold') we can remove it from our accounts authority
        and place a new one leaving the attacker with a worthless key.
  • Your active key is compromised:
        An attacker would need to also conquer your second factor (currently: email) to have any transaction approved.
  • Your original account's owner key is compromised:
        This will also compromise your secured account since the owner of it is identical to your original account. Hence,
        make sure to have your brainkey and owner prive key secured (offline) and only use your active key! Also note, that
        you can change the owner account to something else at your own risk.

Known Issues
Since the GUI is not yet capable of producing proposals, we currently only offer a python call that can propose a
transaction as required (see below) Another inconvenience for some users may be that besides proposing a transaction,
users must manually approve their own proposed transaction

There is currently a pending patch for proposing a transaction that needs to be installed into the cli_wallet first:
Code: [Select]
git remote add graphene https://github.com/cryptonomex/graphene
git fetch graphene
git cherry-pick 7a5c5c4
make cli_wallet

Python library for testing
I wrote a new Proposal class to make it easier for people to play around and/or integrate. This class does not yet take
the service fee into account but will do so once we are out of beta.

Installation
Code: [Select]
git clone https://github.com/xeroc/python-grapehenelib
cd python-grapehenelib
python3 setup.py install --user
pip3 install
pip3 install --user asyncio autobahn requests

Note that you need two active keys installed: a) an active key that can pay for
the proposal and b) the active key of your secured account because you need to
approve your own proposal.

Demo code:
Code: [Select]
import time
import json
from grapheneapi import GrapheneAPI, GrapheneWebsocket
from grapheneextra.proposal import ProposalManagement
class Config() :
    witness_url      = "ws://localhost:8090/"
    witness_user     = ""
    witness_password = ""
    wallet_host      = "localhost"
    wallet_port      = 8092
    wallet_user      = ""
    wallet_password  = ""
    proposer_account = "fabian"         # this account proposes a proposal
    from_account     = "fabian-secured" # this is the secured account
    to_account       = "fabian"         # target account
if __name__ == '__main__':
    config = Config
    ## New instance of proposal management
    propmang = ProposalManagement(config)
    ## Propose a transfer transaction on the chain (proposer_account must fund the tx fee)
    proposal = propmang.propose_transfer(config.proposer_account, config.from_account, config.to_account, 333.5, "BTS", expiration=60)
    ## Print the proposal transaction
    print(json.dumps(proposal,indent=4))
    ## Wait for the Proposal to verify on the blockchain
    time.sleep(10)
    ## Approve proposals that require from_account's approval (does not ask for manual confirmation, yet!)
    propmang.approve_available_proposals(config.from_account, config.proposer_account)

FAQ
Q: Why register new accounts
A: For sake of convenience. It is still more difficult for users to set another
   active authority than to send funds with a mail address in the memo to a given
   account.

Q: Why is their a public key as owner of the secured account and not my origin account?
A: Simply because if it was your account name, anyone with your active key is
   owner of the secured account. By putting the owner key of your original
   account as owner, your secured account's owner key is "as secure as your
   original account".


For those that read through the whole post: Thank you :D
Hope to hear your thoughts about the over all process!

Cheers
 -- Fabian
« Last Edit: December 18, 2015, 07:38:15 pm by xeroc »
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline cass

  • Hero Member
  • *****
  • Posts: 4317
  • /(┬.┬)\
    • View Profile
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #1 on: December 15, 2015, 12:02:03 pm »
Top notch !!
█║▌║║█  - - -  The quieter you become, the more you are able to hear  - - -  █║▌║║█

Offline Riverhead

Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #2 on: December 15, 2015, 12:46:47 pm »



Looking forward to playing around with this. It is a great use case for the sophisticated key structures offered by Graphene. Awesome work and congrats(?) on your 10 thousandth post!

Offline bitacer

Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #3 on: December 15, 2015, 01:13:19 pm »
 +5% :D

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3482
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #4 on: December 15, 2015, 01:38:49 pm »
Very good stuff.  +5%
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3482
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #5 on: December 15, 2015, 03:03:31 pm »
Account created.
Building patched cli_wallet.
Need more help on how to create proposal via cli_wallet.

By the way, the owner key and active key of my old account are same, so keys of the new account are same as well, I think it will be problematic..  ::) how to solve?
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12722
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #6 on: December 15, 2015, 03:17:03 pm »
Account created.
Building patched cli_wallet.
Need more help on how to create proposal via cli_wallet.
Read the part "Python library for testing" of the announcement. It shows a demo code

Quote
By the way, the owner key and active key of my old account are same, so keys of the new account are same as well, I think it will be problematic..  ::) how to solve?
Yhea .. those accounts are VERY old (maybe even keyhotee founders) .. I can't fix that from my end and decided to still register the accounts accordingly. .
Since you are the sole owner of both accounts you can set your keys as you wish ..
the easiest way would be to update the active key of your original account and only work with that one from now forward ..
make sure to keep the private key for the owner authority as secure as humanly possible
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline Thom

Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #7 on: December 15, 2015, 03:58:18 pm »
+5% Sounds great xeroc!

Glad to see a 2FA scheme not based on cell phones, which a very porous and insecure b/c of the openness at some levels of the comm. stack required for multi-carrier interoperability. That risk may be low, but it is difficult to evaluate. I am very paranoid and would never rely on the security of any 2FA based on cell phones UNLESS I rooted the phone and was very confident of the ROM and other tools to protect the device's security. Even with that, I still have reservations about security compromise at the hardware level.

I presume that the memo field used to communicate the email account is not visible without the transaction private key to unlock?

The use of VPN is great, consider chaining more than one together from 2 or more vendors for added protection.

Consider using a trusted secure email provider like startmail (or setup your own on a VPS) if you haven't already. Only connect to that server via VPN. Email is probably your weakest link in terms of security vulnerabilities.

 :) Oh and condrads on your 10,000th post! I only just recently past 10% of that and got into the triple digits  :)
« Last Edit: December 15, 2015, 04:02:00 pm by Thom »
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12722
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #8 on: December 15, 2015, 04:19:22 pm »
Glad to see a 2FA scheme not based on cell phones, which a very porous and
insecure b/c of the openness at some levels of the comm. stack required for
multi-carrier interoperability. That risk may be low, but it is difficult to
evaluate. I am very paranoid and would never rely on the security of any 2FA
based on cell phones UNLESS I rooted the phone and was very confident of the ROM
and other tools to protect the device's security. Even with that, I still have
reservations about security compromise at the hardware level.
I hear you .. and I have my phone rooted as well (in fact I have another ROM
installed)

Quote
I presume that the memo field used to communicate the email account is not visible without the transaction private key to unlock?
Correct. Actually, the key required (by default) to decode the memo is a shared
secret of your pub key and other parties priv key .. or vice versa.

Quote
The use of VPN is great, consider chaining more than one together from 2 or more
vendors for added protection.
Indeed .. Once we made some profit to pay for even more security, this will
happen. I have also started to write transaction signing process in python
directly .. that way we don't need to run a cli_wallet at all and can harden
the system even more.

Quote
Consider using a trusted secure email provider like startmail (or setup your own
on a VPS) if you haven't already. Only connect to that server via VPN. Email is
probably your weakest link in terms of security vulnerabilities.
Peermit.com is hosted solely on a fat machine. We have our own mail server of
course and we plan to add PGP signing for all messages eventually.
Keep in mind that the current beta is really just a MVP or proof-of-concept
(with security already in mind). Give us some more time and we will make it even
stronger :)
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline puppies

  • Hero Member
  • *****
  • Posts: 1659
    • View Profile
  • BitShares: puppies
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #9 on: December 15, 2015, 04:23:52 pm »
Very very nice.  If someone wanted to add your account active key to their existing account in a 2 of 2 scheme would you support that? 

How are you planning on taking your fee?  You can't stop someone from sending to this account, and if they want they can use their owner key to withdraw without 2fa.  Are you planning on charging a portion for each spend from this account that uses the 2fa system?
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12722
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #10 on: December 15, 2015, 04:32:43 pm »
Very very nice.  If someone wanted to add your account active key to their existing account in a 2 of 2 scheme would you support that? 
We can support that aswell .. actually it was my first idea to do it that way
and have the corresponding routines implemented already. However, it is way
easier for most users to get a new account registered with the correct
authorities already .. plus, peermit.com sees referral income.
In theory we can even arrange a different scheme for every user.
For instance, we could have premium member ships that are cheaper.
Or we could use instancly approve any trading activities but require 2FA for
transfers of USD and BTS, but not BTC :)

Possibilities are endless :)

Quote
How are you planning on taking your fee?  You can't stop someone from sending to
this account, and if they want they can use their owner key to withdraw without
2fa.  Are you planning on charging a portion for each spend from this account
that uses the 2fa system?
We have two options:
Either we only approve transactions that have a second transfer in them that pay
the service fee to our account,
or we demand withdrawal_permissions from an account and withdraw the service fee
monthly, weekly ...
Alternatively, we could even use a prepayed scheme and have people preload an
account at peermit.com .. though that would not be my preferred choice

What would you prefer?
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline Thom

Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #11 on: December 15, 2015, 04:43:20 pm »
Very very nice.  If someone wanted to add your account active key to their existing account in a 2 of 2 scheme would you support that? 

How are you planning on taking your fee?  You can't stop someone from sending to this account, and if they want they can use their owner key to withdraw without 2fa.  Are you planning on charging a portion for each spend from this account that uses the 2fa system?

Interesting thought puppies. If so it's similar to the move the multibit wallet did in their Multibit HD version, where they take a small fee in addition to the bitcoin transaction fee on every transaction performed from that wallet. The problem is, you can't opt-out, it's not a donation it is a mandatory fee. It's worse than a license fee, it's more like an income tax!

[member=120]xeroc[/member], if you plan on taking a cut of transfers, no matter how small, consider making it an optional donation. Even if the default is ON, allowing it to be turned off and fully disclosing that this is any part of your funding model is the ethical thing to do. I see reviews and info about Multibit that fail to disclose the mandatory fee they take to fund development (i.e. like on cryptocompare.com) which I think is manipulative.
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html

Offline fuzzy

Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #12 on: December 15, 2015, 04:51:06 pm »
Wow.  Nice Xeroc.  So how have you figured out the exact amount that will be charged?
WhaleShares==DKP; BitShares is our Community! 
ShareBits and WhaleShares = Love :D

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12722
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #13 on: December 15, 2015, 05:28:53 pm »
Interesting thought puppies. If so it's similar to the move the multibit wallet
did in their Multibit HD version, where they take a small fee in addition to the
bitcoin transaction fee on every transaction performed from that wallet. The
problem is, you can't opt-out, it's not a donation it is a mandatory fee. It's
worse than a license fee, it's more like an income tax!
To make it clear again. In this scheme you can OPT-OUT at any time.
I want to have it that way to not end up with a service that needs to be run
indefinitely. Every user can simply opt out by importing the owner key of the
original account. That of course also opens up an attack vector: If the original
account's owner key is compromised, so will the secured account!!!

Quote
[member=120]xeroc[/member], if you plan on taking a cut of transfers, no matter
how small, consider making it an optional donation. Even if the default is ON,
allowing it to be turned off and fully disclosing that this is any part of your
funding model is the ethical thing to do. I see reviews and info about Multibit
that fail to disclose the mandatory fee they take to fund development (i.e. like
on cryptocompare.com) which I think is manipulative.
Good point. I could have a "free" plan with some restrictions and ask customers
to upgrade at a fee to gain access to "more features" or faster approvals or
somthing similar. Good idea. I will keep it in mind!
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12722
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: [Ann] Peermit.com - 2FA for BitShares (early beta for advanced users)
« Reply #14 on: December 15, 2015, 05:34:40 pm »
Wow.  Nice Xeroc.  So how have you figured out the exact amount that will be charged?
The reigstration fee of 200 BTS is just a little to pay for the account registration fee (50 BTS) and have some funds available initially to approve proposals.
The 0.4% fee is just an idea and not fixed yet .. However, I wanted to show people the progress I am making and let them play around it ..

Not sure how to deal with the business/profit related issues yet .. that's why I started with a bold 0.4% flat ...

Any suggestions on how to please the customers and still have the service be profitable?
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH