IOTA: Stateful client libraries: part 1

  • Thursday, 11 April 2019 14:55
Stateful Client Libraries: Part 1Today, we are officially releasing the beta versions of our new stateful client libraries, which contain what we call an ‘Account module’. The name does not do justice to what is a very substantial update, so we will try to summarize the changes in the two blog posts we will be releasing about the libraries. This post is part 1.Client libraries have always been an important part of the puzzle when building applications on top of IOTA. They are designed to make implementing your ideas simpler, in the language of your choice.The IOTA Foundation has been maintaining Java, JavaScript, and Golang versions of client libraries for quite some time now. And while we see you building great things using the libraries, we were always aware that they are far from the ideal developer experience that we would like you to have.A couple of months back we set out to redesign the client libraries completely and try to abstract away as many complicated operations as possible. So that developers would only have to care about what they really care about: sending transactions and receiving transactions. All without the complicated bits and pieces that require an in-depth knowledge of the IOTA protocol.What do the new libraries do?Previously when working with our client libraries, developers had to implement many components themselves from scratch. This required an advanced knowledge of many IOTA concepts. For example, you had to be quite intimate with:TransactionsBundles and how to construct themKnowing which addresses are safe to use for a deposit and which can be used for input selectionPromotion and re-attachment of pending transactionsand much moreAs the client libraries had no state, the developer had to manage or fully rely on the network. Even operations like getting transaction data required a network call, and the pruning of old ledger data by snapshots had to be taken into account.All this made building on top of IOTA unnecessarily complicated. The upfront investment you had to make before being able to send a transaction was a real issue.Especially when you wanted to experiment with simple applications on top of IOTA. With the new libraries however, most of the low-level aspects are abstracted away. A developer can create an account and start sending and receiving transactions with much less effort.The new client libraries store the account information locally, removing the need to call nodes for information like address state or balances. They are also resilient to snapshots. The libraries now:Store the account information and settings locally. You can also export and import existing accounts.Store pending transactions locally.Handle the promotion and reattachment of pending transactions via a predefined strategy. You can also define your own strategy. The reattachment and promotion functionality is supported via a plug-in and you can develop your own plug-ins that extend the library functionality.Have a notion of which addresses from your account have been deposited to and spent from, and which should be used for input selection. So whenever you request a deposit, you are doing so in a safe manner.Provide event handling functionality. You can now listen out for different events, for example every new deposit, or every confirmed, outgoing transaction.Introduce a concept of Conditional Deposit Addresses (CDAs), which are now the primary means of communicating with depositors. This is a very important feature which we will expand on in the next post.You can read more about the client libraries in our documentation. Or get the libraries from their respective repositories:Go libraryJava libraryJavaScript librarySee part 2 of this post.Stateful client libraries: part 1 was originally published in IOTA on Medium, where people are continuing the conversation by highlighting and responding to this story.

Additional Info

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

Disclaimer: As a news and information platform, also aggregate headlines from other sites, and republish small text snippets and images. We always link to original content on other sites, and thus follow a 'Fair Use' policy. For further content, we take great care to only publish original material, but since part of the content is user generated, we cannot guarantee this 100%. If you believe we violate this policy in any particular case, please contact us and we'll take appropriate action immediately.

Our main goal is to make crypto grow by making news and information more accessible for the masses.