2

Im implementing a ethereum PoA network using go-ethereum

I have deployed a ERC20 Token on the network, and the idea is that the network must be accessed from any wallet on the internet (i.e metamask, myetherwallet, etc)

The idea for this network is:

  • Having N full nodes that are able to seal blocks (the nodes has the unlocked accounts)
  • Deploy a smart contract that is a ERC20 Token
  • Having one node that expose the network in order to be accessed from any origin, for example, Metamask, MyEtherWallet, a mobile app with a wallet, etc. The idea is that anybody can hit the ERC20 Token if they have the appropiate client.

In order to achive that, i create 2 full nodes that are in charge of sealing the blocks.

I run those nodes like this:

geth --datadir sealer1/  --syncmode 'full' --port 30351 --rpc --rpcaddr 'localhost' --rpcport 8502 --rpcapi='admin,personal,db,eth,net,web3,txpool,miner' --networkid 20 --gasprice '1' -unlock 'someaccount' --password s2/password.txt --mine

As you can see, there are some important things about those nodes:

  1. Unlocks the accounts
  2. Are only accessed from localhost (note the rpcaddres)
  3. Those nodes are miners

If i expose a node like that to the internet (enabling RPC access from any origin) any hacker could send the ether to another account, so, i create a third node, a standard node, that doesnt expose rpc apis but allows connections on port 8545 (in order to be hitted from metamask, myetherwallet, etc)

I run the node with this command:

geth --datadir standard1/ --syncmode 'full' --port 30352 --rpc --rpcport 8545--rpccorsdomain '*' --rpcaddr 'SERVER_PUBLIC_IP' --networkid 20 --gasprice '1'  

as you can see this node:

  1. Doesnt unlock account
  2. Allow rpc accesing from any origin
  3. Doesnt expose rpc apis like personal, admin, etc

My questions are:

  • is this aproach secure?
  • Is there another way to allow anyone in the world to use Metamask to hit my smartcontract without open the RPC access on the standard node?

Why i have those questions?

Because there are a lot of places that doesnt recommend open RPC ports, so im not secure if:

  • Dont have a node exposed with unlocked accounts
  • Dont expose critical rpc apis like admin and personal

is enough to expose securely my node.

Here are some issues related with opening RPC access:

https://blog.blockdaemon.com/ethereum-geth-configuration-made-in-ireland-7ba2e876c6e3 https://www.reddit.com/r/ethereum/comments/4z0mvi/ethereum_nodes_with_insecure_rpc_settings_are/

https://www.reddit.com/r/ethereum/comments/3ird55/holy_shit_my_eth_accounts_been_hacked/

https://www.reddit.com/r/ethereum/comments/4jav5u/mist_wallet_has_2_sec_vulnerability_for_rpc/

https://blog.3or.de/internet-wide-ethereum-json-rpc-scans.html

https://www.bokconsulting.com.au/blog/7218-ethers-stolen-from-miner-with-rpc-port-open/

https://blog.ethereum.org/2015/08/29/security-alert-insecurely-configured-geth-can-make-funds-remotely-accessible/

Here the team lead of ethereum recomendation:

Ok, your setup seems insanely dangerous. --rpcaddr=external_address essentially opens up the node to anyone in the world to access it. Forthermore, --rpcapi 'admin,personal,db,eth,net,web3,txpool,miner' permits anyone with access to do absolutely anything. I can imagine someone from the internet is brute forcing the passwords.

https://github.com/ethereum/go-ethereum/issues/17417#issuecomment-413877558

1

is this aproach secure?

It is reasonably secure, yes. You shouldn't be facing any issues with having the standard node exposed.

Is there another way to allow anyone in the world to use Metamask to hit my smartcontract without open the RPC access on the standard node?

You could allow people to run their own nodes by providing a bootnode and genesis.json to join the network.

  • About the second question, the idea is that if you have a ethereum wallet and i give you the RPC endpoint you can connect through MetaMask and send/receive some ER20 tokens, isnt about connect another node to the network. Is about consuming the smart contract – Marcos Martínez Aug 21 '18 at 0:56
  • If you don't provide an open RPC for metamask to connect to, the only other way is to allow people to run their own nodes. – Raghav Sood Aug 21 '18 at 0:59
  • So, in order to make public your network, the only 2 things to have in mind is to not expose a node with unlocked accounts and to not expose RPC apis (admin, personal, etc)? I was reading about opening RPC and there are a lot of people talking about it is a bad idea. On this blog there is a hub of issues related with that blog.blockdaemon.com/… – Marcos Martínez Aug 21 '18 at 1:01
  • As long as your RPC does not expose unlocked keys, no funds will be lost. Your current approach of not exposing admin, personal etc. is also correct, only the eth APIs need to be exposed for wallets – Raghav Sood Aug 21 '18 at 1:03
  • 1
    As long as the sealers' RPCs are not public, there is no issue – Raghav Sood Aug 21 '18 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.