Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add private invite system #3

Merged
merged 1 commit into from
Dec 10, 2017
Merged

Add private invite system #3

merged 1 commit into from
Dec 10, 2017

Conversation

backus
Copy link
Contributor

@backus backus commented Dec 10, 2017

Add private user invitation system. This system works like so:

  1. Alice already has an account on Bloom

  2. Alice generates a secret value and computes

    sha3(secret + "/" + aliceAddress)
    

    add publishes this to the smart contract via createInvite

  3. Alice shares the secret value with Bob out-of-band (not via the
    blockchain).

  4. Bob computes sha3(secret + "/" + bobAddress) and calls the function
    beginAcceptInvite

  5. After 4 confirmations, Bob calls

    finishAcceptInvite(aliceAddress, secret)
    

    at which point he should have an account

This system is designed to allow Alice to invite Bob without knowing his
Ethereum address. The secret makes sure that only he is able to claim
the invite. The separate beginAcceptInvite and finishAcceptInvite
functions are to avoid an attacker replaying accepting an invite but
with their own account. They can't replay the beginAcceptInvite
function because the hashed value does not contain an address they
control. They could observe the finishAcceptInvite call and replay
both the begin and finish functions, but the contract requires that they
happen at least 5 blocks apart. This delay gives the person accepting
the invite a secure window of time where no one else can replay and
steal their invite.

There are still small risks that could come from user error that we should be able to avoid via the UI. For example, if I reveal the secret in a transaction that fails or is submitted with a really low gas price, then an attacker could possibly get their transaction in 5 blocks later if I don't get a successful transaction processed before that.

Add private user invitation system. This system works like so:

1. Alice already has an account on Bloom

2. Alice generates a secret value and computes

   ```
   sha3(secret + "/" + aliceAddress)
   ```

   add publishes this to the smart contract via `createInvite`

3. Alice shares the secret value with Bob out-of-band (not via the
   blockchain).

4. Bob computes `sha3(secret + "/" + bobAddress)` and calls the function
   `beginAcceptInvite`

5. After 4 confirmations, Bob calls

   ```
   finishAcceptInvite(aliceAddress, secret)
   ```

   at which point he should have an account

This system is designed to allow Alice to invite Bob without knowing his
Ethereum address. The secret makes sure that only he is able to claim
the invite. The separate `beginAcceptInvite` and `finishAcceptInvite`
functions are to avoid an attacker replaying accepting an invite but
with their own account. They can't replay the `beginAcceptInvite`
function because the hashed value does not contain an address they
control. They could observe the `finishAcceptInvite` call and replay
both the begin and finish functions, but the contract requires that they
happen at least 5 blocks apart. This delay gives the person accepting
the invite a secure window of time where no one else can replay and
steal their invite.
@backus backus merged commit c42f78e into master Dec 10, 2017
@backus backus deleted the feature/privateInvites branch December 10, 2017 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant