I'm exploring the IoT side of the EVM. I've programmed Arduinos and ESP8266s to interact with a Geth JSON RPC. I'm trying to be minimalistic and avoid NodeJS on the Geth JSON server side. Currently the ESP8266 just unlocks the accounts via the Personal.sendTransaction function. I know this is poor security if someone infiltrated my wifi LAN (my Geth node is running on my wifi Router OpenWrt) I've seen examples of ethereumjs-utils being used to sign transactions offline. Is there a LIGHTWEIGHT (under 500k) C++ version of this, at least the ECDSA secp256k1 keccak256 algorithms?? Ideally the microcontroller would sign the transaction, then broadcast the the raw transaction. The only way a thief could get access to the IoT wallet would be physical access to the device, dump the flash ROM, reverse engineer the binary to extract the private key. Any suggestions?? Here is working example of ESP8266 ESP-01 pushing and pulling temperature data to the Rinkeby blockchain, the majority of the code being the JSON parsing https://github.com/gusgorman402/ESP8266_Geth
You can use our Firefly Hardware Wallet (https://firefly.city) for the ATmega328 to do:
- secp256k1 signing
- RLP decoding transactions
- generating checksum addresses (or raw addresses)
Signing requires in the neighbourhood of around 700 bytes of free memory, I believe, but everything else requires a fairly slim memory footprint.
If you require an OLED display, the Firefly source code also includes our zero-memory video driver.
Here is a link to the library: https://github.com/firefly/wallet/tree/master/source/libs/ethers
Also, all the code is BSD/MIT licensed, so should be fairly easy for any project to incorporate.