All Projects → paritytech → sms-verification

paritytech / sms-verification

Licence: GPL-3.0 license
SMS verification for Parity.

Programming Languages

javascript
184084 projects - #8 most used programming language

Parity SMS verification

Join the chat at https://gitter.im/ethcore/parity GPLv3

The following process verifies a number:

           confirm(token)
         +-------------------> +--------+
         |                     |contract|   puzzle(address, sha(token))
         |       +-----------> +--------+ <-----------+
         |       |                                    |
         |       | request()                          |
         |       |                                    |
         |       |                                    |
         |   +------+  POST /?number=…&address=…  +------+
         +-- |client| +-------------------------> |server| code=rand()
             +------+                             +------+ token=sha(code)
token=sha(code)  ^             SMS with code          |
                 +------------------------------------+
  1. client requests verification (request())
  2. client calls verification server (POST /?number=…&address=…)
  3. server generates code and computes token
  4. server posts challenge (puzzle(address, sha(token)))
  5. server sends SMS to client (with code)
  6. client computes token
  7. client posts response (confirm(token))

Now, anyone can easily check if a number is verified by calling certified(address) on the contract.

latest deployed SMSVerification.sol

Installation

git clone https://github.com/ethcore/sms-verification.git
cd sms-verification
npm install --production

Usage

The account calling puzzle has to be the delegate of the contract.

  1. Set up an account and put its password in a file.
  2. Run Parity with --jsonrpc-apis net,eth,personal,parity.
  3. Create a config file config/<env>.json, which partially overrides config/default.json.
  4. env NODE_ENV=<env> node index.js

Deploy to production using process managers like forever.


To run on both testnet and mainnet, just create two config files. Make sure to use

  • separate Parity processes listening on different ports (parity.host)
  • separate db files
  • separate ports to listen on (http.port)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].