Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Antenna SDK for Arduino boards #25

Open
3 of 16 tasks
simonerom opened this issue May 4, 2021 · 5 comments
Open
3 of 16 tasks

Antenna SDK for Arduino boards #25

simonerom opened this issue May 4, 2021 · 5 comments

Comments

@simonerom
Copy link
Member

simonerom commented May 4, 2021

Description

This port will provide transaction signing and broadcasting for IOTX token (transfers, balance, etc...), XRC20 tokens (transfers, balance, etc...), and smart contracts interaction, as well as utility functions like account creation, token units conversion etc... It will interact with a JSON-RPC API server (like our Babel service that implements Ethereum JSON-RPC API, or any other API server. communication with IoTeX Full-Node to broadcast transactions.

The library will suport popular Arduino boards, including ESP32, ESP8266 and Arduino Nano 33 IoT

Context

Arduino is a great platform for people & makers to experiment, learn and build IoT applications.
Joining Arduino & IoTeX would take these IoT projects to the next level, allowing users to effectively integrate an IoT-friendly Blockchain into their devices and applications. While IoTeX already provides some C++ examples (antenna-embedded), a comprehensive antenna-arduino library that implements IoTeX Antenna SDKs and is easily imported into Arduino projects is missing.

Acceptance criteria

The final deliverable will be made up by an Arduino library with PlatformIO compatibility. The library will follow the Arduino code standards. Along with the library, a set of examples and documentation will be created for the supported Arduino boards.

Below the Milestones with respective acceptance criteria:

Milestone 1: JSON-RPC over HTTPS

  • JSON-RPC parser/serializer
    This is a Class including utilities to construct and parse JSON-RPC requests and responses. This will leverage a third party lightweight JSON library such as JSMN or cJSON
  • IConnection
    This is an Interface for a HTTP/HTTPs connection. Possibly a mock implementation or an implementation for one board (eg. ESP32)
  • Api
    This is a class/interface for the IoTeX JSON-RPC api. Will implement the following methods, which construct the payload using the JSON-RPC parser, send a request over HTTP using IConnection, parse the response and return it in an adequate struct/class. Implements the following methods (initially)
    • getAccount()
    • getNonce()
    • getTransactionByHash()

Milestone 2: Signature

  • Transfer
    This is a class that represents a transfer. Holds the following data, as well as possibly some utility methods: amount, recipient, payload, gasPrice, gasLimit

  • Wallet: a class that represents a wallet. Provides the following methods:

    • getPrivateKey(): creates a new wallet and returns the private key
    • getIoTeXAddress(): returns the native IoTeX address
    • getEthereumAddress(): returns the address in the Ethereum format
    • signMessage(): hashes a message using the private key and returns the hash
    • signTokenTransferAction() this will construct the token transfer message then call the signMessage and return the signature.
  • Api: the following methods will be added to the Api class

    • sendTokenTransfer(Wallet, Transfer): Signs and broadcast a IOTX transfer

Milestone 3 - Contract execution

  • Execution: class that represents a smart contract. Holds the following data and methods

    • contractAddress
    • amount
    • Methods to generate contract data:
      • setupContractData()
      • getData()
  • Wallet: add the following methods

    • signContractExecution(amount,execution)
  • Api: add the following methods

    • sendContractExecution(wallet, execution)

Milestone 4 - Test boards, Examples & publish

  • Implement the existing interfaces for each of the supported boards:
  • ESP32
  • ESP8266
  • Arduino Nano 33 IoT
  • Cellular board - Possibly, depending on time
  • Create a set of examples and documentation
  • Publish the library

Time estimation

No specific deadline, but we'd like to have it ready by July 15th, 2021

Misc/References

Signature of actions

The message must be “constructed” in protobuf format (version is 1, nonce can be obtained from milestone 1, action will be of type Transfer for token transfers, Execution for contract calls and fields are passed as arguments to the call). https://github.com/iotexproject/iotex-proto/blob/28696168bf02b64a9fbf71edda0a68a4ad714c08/proto/types/action.proto#L205

Refer to the existing antenna-embedded signing module. If any fix is required to the signature function the IoTeX team will provide help on this

Protobuf

Protobuf encoding is needed for sending actions to the server. This will be handled by integrating a lightweight third party library such as NanoPb

Reward

3500 USD

  • Milestone 1: 750 USD
  • Milestone 2: 750 USD
  • Milestone 3: 750 USD
  • Milestone 4: 1250 USD

Important Links

Getting started: https://docs.iotex.io

IoTeX Blockchain Explorer: https://iotexscan.io

IoTeX Testnet Faucet https://faucet.iotex.io/

Follow Us

https://iotex.io
https://t.me/IoTeXGroup
https://twitter.com/iotex_io
https://medium.com/@iotex
https://www.reddit.com/r/IoTeX

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 3500.0 USDT (3500.0 USD @ $1.0/USDT) attached to it as part of the iotexproject fund.

@gitcoinbot
Copy link

gitcoinbot commented May 7, 2021

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 265 years, 6 months from now.
Please review their action plans below:

1) as-iotex has been approved to start work.

I am interested in addressing this issue

Learn more on the Gitcoin Issue Details page.

@gitcoinbot
Copy link

gitcoinbot commented May 10, 2021

@as-iotex Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@as-iotex
Copy link
Member

@gitcoinbot WIP

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 3500.0 USDT (3500.0 USD @ $1.0/USDT) has been submitted by:


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants