Parity SMS verification
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 |
+------------------------------------+
- client requests verification (
request()
) - client calls verification server (
POST /?number=…&address=…
) - server generates
code
and computestoken
- server posts challenge (
puzzle(address, sha(token))
) - server sends SMS to client (with
code
) - client computes
token
- 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
git clone https://github.com/ethcore/sms-verification.git
cd sms-verification
npm install --production
The account calling puzzle
has to be the delegate
of the contract.
- Set up an account and put its password in a file.
- Run Parity with
--jsonrpc-apis net,eth,personal,parity
. - Create a config file
config/<env>.json
, which partially overridesconfig/default.json
. 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
)