StackAsk is a community where developers ask questions, share answers and learn from each others real-world experience, so every solved problem helps the next person who runs into it.
sign
ecRecover
const Web3 = require('web3'); const fs = require('fs'); const Strings = require('./strings'); let provider = new Web3.providers.HttpProvider("http://localhost:8545/"); let web3 = new Web3(provider); web3.eth.defaultAccount = "0x3c31b4b9d6c24bad29498f99aaa6914231362c7f"; // contract address not account address var registerJson = '{' + ' "username": "dzung",' + ' "password": "123456",' + ' "email:": "dung@youngmonkeys.org"' + '}'; var registerHex = Strings.stringToHex(registerJson); web3.eth.personal.sign(registerHex, web3.eth.defaultAccount, "123") .then((signed) => { console.log("signed register: ", signed) web3.eth.personal.ecRecover(registerHex, signed) .then((address => console.log("the address: ", address))); });
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click