Your ether balance is 0, which is insufficient to pay the fee for the transaction you're doing. All transactions in Ethereum require gas, and ether is used to pay for that gas. Transfer some ether into that account and try again. (You should need less than a dollar's worth of ether.)
I think there are two issues:
- In Web3.js 1.0.0, the order of the parameters is
web3.eth.sign(dataToSign, accountToSignWith, callback)
, but you're passing the account to sign with first.
- I don't think there's a way to sign objects like that, though maybe you know something I don't?
Try this to start with:
web3.eth.sign(web3.utils.sha3("test"), '0x2E290A50d3193753F156e5b0b12e4231Bd568526', function (err, result) { console.log(err, result); });
Make sure that works and then move on from there to signing what you want.
EDIT
Per https://github.com/MetaMask/metamask-extension/issues/1530, personal_sign
may be a better option:
var fromAddress = '0x2E290A50d3193753F156e5b0b12e4231Bd568526';
web3.currentProvider.sendAsync({
method: 'personal_sign',
params: [
web3.utils.fromAscii('hello world'),
fromAddress,
],
from: fromAddress,
}, function (err, result) {
console.log(err, result);
});
EDIT2
Better yet, eth_signTypedData
:
web3.currentProvider.sendAsync({
method: 'eth_signTypedData',
params: [
[
{ type: 'string', name: 'Message', value: 'Hi, Alice!' },
{ type: 'uint32', name: 'A number', value: 1337 }
],
fromAddress,
],
from: fromAddress,
}, function (err, result) {
console.log(err, result);
});
Best Answer
It doesn't appear so, at least during creation. (You can verify this by watching for network traffic during the creation process.)
By default Metamask uses Infura. When submitting transactions, traffic routed via Infura will contain the usual HTTP headers - which will create a specific fingerprint of the browser being used - as well as the source IP address. I believe they use some of this information to rate-limit their services and prevent abuse.
As above, probably for a short period of time for rate limiting. Not really possible to answer this without asking them.
Could they tie IP addresses to wallet addresses? They could, but such things can be easily fooled (e.g. Tor, VPNs, etc.). (Even without trying: GeoIP is bullshit.) I'd also speculate that anyone doing anything particularly illegal - if that's why you're asking - wouldn't be using a centralised service like Infura (via MM) - they'd be running their own node, and creating and managing their own wallets.