anyl-wallet icon indicating copy to clipboard operation
anyl-wallet copied to clipboard

[META] basic utils for building an ethereum transaction

Open pcppcp opened this issue 6 years ago • 0 comments

Goal

To create set of utilities that will help building and encoding an ethereum transaction on an embedded device.

Required features

  • [x] int eth_encode_tx(const transaction_t *tx, uint8_t *result, size_t *result_size); - returns a RLP-encoded transaction data
  • [x] int eth_sign(const privkey_t *pk, const uint8_t *data, size_t data_size, signature_t *sig_out) - signs arbitary data and fills in the signature_t structure
  • [x] int eth_encode_and_sign_tx(const privkey_t *pk, const transaction_t *tx, uint8_t *result, size_t *result_size); - encode and sign an ethereum transaction
  • [x] int privkey_to_address(const privkey_t *pk, address_t *out) - convert ECDSA private key to the ethereum address
  • [ ] int address_from_signature(const uint8_t *data, size_t data_len, const signature_t *signature, address_t *addr_out) - perform ECVerify on supplied data and return signer's address
  • ... to be updated ....

Requirements

  • must not use dynamic memory
  • must be decoupled from hardware-specific code (this is especially important for the crypto functions)
  • sanity checks in place to ensure consistency of input/output data
  • every routine must have an appropriate test using gtest framework. Test data can be generated by python's ethereum libraries.

Other remarks

  • EIP155 support would be nice
  • Do not close this issue - it's purpose is to keep track of sub-issues that are related to it

pcppcp avatar Sep 25 '18 11:09 pcppcp