At present two RPCs allow dapps clients to ascertain a default account from which to send transactions: eth_coinbase and eth_accounts. Neither are well-suited. eth_coinbase is the already defined as the preferred block author for mining/sealing and in certain setups this may collide with the account from which transactions should be signed by default.
eth_accounts returns a list of available accounts with not a single one being necessarily favourite.
This proposal is to create a new RPC for the sole duty of determining a default transaction signing account.
Spec
defaultAccount() -> address: Returns the account that the node owner would prefer to see used. This can be contextual if the node supports multiple calling contexts. Should generally be a member of the set of accounts returned by eth_accounts().
Notes
To be as backwards compatible as possible, client authors should consider:
implementing eth_coinbase to return the same value as defaultAccount while not mining/sealing;
implementing eth_accounts to always have the first value of the list returned equivalent to eth_defaultAccount.
Incubation
We propose the final RPC endpoint for this be eth_defaultAccount; if an incubation period is required, we suggest arb_defaultAccount be adopted initially.
Summary
At present two RPCs allow dapps clients to ascertain a default account from which to send transactions:
eth_coinbase
andeth_accounts
. Neither are well-suited.eth_coinbase
is the already defined as the preferred block author for mining/sealing and in certain setups this may collide with the account from which transactions should be signed by default.eth_accounts
returns a list of available accounts with not a single one being necessarily favourite.This proposal is to create a new RPC for the sole duty of determining a default transaction signing account.
Spec
defaultAccount() -> address
: Returns the account that the node owner would prefer to see used. This can be contextual if the node supports multiple calling contexts. Should generally be a member of the set of accounts returned byeth_accounts()
.Notes
To be as backwards compatible as possible, client authors should consider:
eth_coinbase
to return the same value asdefaultAccount
while not mining/sealing;eth_accounts
to always have the first value of the list returned equivalent toeth_defaultAccount
.Incubation
We propose the final RPC endpoint for this be
eth_defaultAccount
; if an incubation period is required, we suggestarb_defaultAccount
be adopted initially.