A way of enabling blockchain access for devices
1. The problem
So far Ethereum proved to be the most popular blockchainâââthis article focuses on Ethereum and Ethereum virtual machine / EVM based blockchains.
Unfortunately the access to Ethereum instances for decentralized app-s / Dapp-s has been âcrippledâ.
What do I mean by âcrippledâ?
To access the blockchain, no matter how many intermediate layers a Dapp goes through, it finally calls the Ethereum RPC APIâââhttps://eth.wiki/json-rpc/API
The function which actually writes on the blockchain isâââ
eth_sendTransaction
and its variationâââeth_sendRawTransaction
.These 2 functions are responsible for:
- Transfer of the native coin (ETH, BNBâŚ) from one account to another
- Deploying of smart contracts
- Calling functions of smart contracts
As part of the infrastructure for Dapp developers blockchains provide URL-s for RPC API access like for ex.:
- https://ropsten.infura.io/v3/<developer key>âââEthereum / Ropsten testnet
- https://data-seed-prebsc-1-s1.binance.org:8545âââBinance smart chain / BSC testnet
- https://matic-mumbai.chainstacklabs.comâââpolygon/matic testnet
The answer to the questionââââWhat do I mean by âcrippledâ?â is that the calls to
eth_sendTransaction
and eth_sendRawTransaction
are disabled.As a result of the restriction a Dapp developer can not directly do transfers, and/or deploy or call smart contracts.
And, as a result of of the restriction a layer of middle-men providers was created and keeps growingâââMetamask and a lot of wallet providers.
To state the problem differentlyâââmost blockchain infrastructure providers allow read-only access to the blockchain.
To be able to write on the blockchain most Dapps have to call not only the blockchain infrastructure URL but also Metamask and/or wallet provider RPC API-s.
(The âgatekeepersâ for posting transactions (writing) on the blockchain)
2. One solution
Facing restrictions the question comesââââHow do we bypass the restrictions and be able to make transfers, and deploy and call smart contracts?
An independent Dapp developer can run their own node of a blockchain and able to make transfers, and deploy and call smart contracts.
How exactly is this done?
The most popular software to run an Ethereum node isâââgeth . In addition to having the ordinary Ethereum APIs it has its own RPC APIsâââ
https://geth.ethereum.org/docs/rpc/server
https://geth.ethereum.org/docs/rpc/server
An independent Dapp developer can start a node of a specific Ethereum blockchain instance, like for ex. -
gethâââdatadir node-p1/ââârpcââârpcapi âpersonal,db,eth,net,web3,txpool,miner,admin,cliqueâââânetworkid 137âââallow-insecure-unlock console
where:
- networkid 137âââconnects to polygon/matic mainnet
- networkid 56âââconnects to BSC mainnet
- networkid 1âââconnects to Ethereum mainnet
The important api added to the list of API-s is âpersonalâ. When a node is started, normally it is not included in the list of ââââ
rpcapi
â .3. Overview of âpersonalâ RPC API
The list of additional APIs is available on -
https://geth.ethereum.org/docs/rpc/ns-personal#personal_sendtransaction
https://geth.ethereum.org/docs/rpc/ns-personal#personal_sendtransaction
The important API-s on this list are -
personal_lockAccount
personal_newAccount
personal_unlockAccount
personal_sendTransaction
It is these few APIs that allow bypassing the âmiddle-manâ layer of Metamask and all wallet providers.
A sequence of commands for a Dapp developer is -
-
There is no need of choosing a sequence of 12â24 words (Metamask, Binance wallet), and one or more passwords, or key files.
personal_newAccount
âââcaller specifies a password and receives an addressThere is no need of choosing a sequence of 12â24 words (Metamask, Binance wallet), and one or more passwords, or key files.
-
personal_unlockAccount
, personal_sendTransaction
, personal_lockAccount
âââcaller specifies a password to unlock and send transaction (transfer, or deploy/call contract), and then locks the account4. Ultimate solution
Running a node is âheavy burdenâ to carry for a Dapp developer.
Most of Dapp-s in the Ethereum and alike instances go âlightâ having only a white-paper, web site and a smart contract.
The ultimate solution to the problem of âcrippledâ RPC API access is for an infrastructure provider to enable this access.
The specific action to be taken is for the network administrator running the specific blockchain infrastructure to :
- modify the geth start script to include âpersonalâ namespace
- kill the geth daemon, and then start geth daemon
The downtime for the blockchain can be seconds to minutes.
Whether this proposal is going to be accepted or not remains to be seen.
The proposal may spark funding of countless grants analyzing the security of the proposal of enabling âpersonalâ namespace.
Most likely it is going to not an existing infrastructure provider but new ones which will be the pioneers in adopting of the proposal.
5. Benefits of the proposal
Removing the âmiddle manâ layer of Metamask and wallet providers and enabling full RPC API blockchain access are not the only benefits of the proposal.
Most of the current Dapp-s developers âliveâ inside of a web browser.
This means that the Dapp needs a web browser, and/or node.js , and an operating systemâââwhether desktop or mobile.
Allowing full RPC API access allows access to the blockchain for embedded devices that have neither a browser/node.js nor an operating system.
The number of embedded devices is much, much bigger than the number of desktop and mobile systems.
The number of embedded devices is much, much bigger than the number of desktop and mobile systems.
(Read and write access for users and devices, with or without an operating system)
Additional reading
Connect with meâââLinkedin