CPChain / chain

Mirror of https://bitbucket.org/cpchain/chain
GNU General Public License v3.0
51 stars 10 forks source link

A password prompt should be given when sending tokens via RPC API #98

Closed hvredevoort closed 4 years ago

hvredevoort commented 4 years ago

Is your feature request related to the chain, the wallet, the console, the explorer, or other aspect? wallet/address

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] When I use the RPC API to send tokens to another address, no password is required.

Describe the solution you'd like A transaction using any API should be protected by a password. If someone breaks into an RNode, the wallet address is already unlocked after having started the RNode. A password prompt for the keystore file should be requested before making a transaction, just like starting or stopping the RNode

Describe alternatives you've considered An alternate password for the API could be considered.

Additional context An example of using this API to send 10 CPC

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x11111111111111111 1111111111111111111111", "to":"0x222222222222222222222222222222222222222","gas":"0x76c0" ,"gasPrice":"0x9184e72a000","value":"0x8AC7230489E80000","data":"0xd46e8dd67c5d32be8d46 e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}],"id":1}' --url 'http://127.0.0.1:8501' -H "Content-Type: application/json"

CPC-Yao commented 4 years ago

We will open a formal proposal channel in the future. If new features are voted through, we will consider it.