Here are a few lessons learned while working on IOTA for the past 4 months.

1. Attaching addresses to Tangle

A new address can be generated using getNewAddress API method. The libraries/API do not attach the address to the Tangle automatically for you. You can always successfully send IOTAs to non-attached addresses but it is recommended to attach an address before using it.

You can attach it by sending a zero-value transaction.

Wait a minute! Then what would be the source address?

Good question, in IOTA, a zero-value transaction bundle does not have (or need) a source address. So, your source address will be the destination address you want to attach.

2. Javascript vs Java IOTA(JIOTA) client lib

The IOTA javascript library is simple to use. The Java library has almost the same inbuilt function names. Minor heads up, “optional” parameters in Javascript are to be replaced by empty (equivalent to the argument type) in Java. Always good to check the Java documentation before making an assumption.

Also, there can be few caveats with optional parameter assumption. The optional parameter is not an empty string but an equivalent null. Below is a simple prepareTransfers method:

List <String> trytes = jiota.prepareTransfers(seed, security, transfers, remainderAddress, inputs, tips, validateInputs);

Here remainderAddress is an optional param. When

String remainderAddress = "";

remainderAddress is an empty string, it would work fine for 0 value transactions but would fail for any > 0i value transactions. The correct way to make it optional is setting to null.

String remainderAddress = null;

3. Promoting vs Reattaching

When the transaction is pending for a long time, it is unlikely to be accepted because the tip selection algorithm favors newer transactions. Users that are in a hurry to see their transaction confirmed are thus likely to rebroadcast it.

Rebroadcasting can be done by “promote” or “reattaching”. In practice “promoting”, which involves the creation of a zero value transaction, appears to be more effective.

The difference is promoting will create a zero value transaction and is now the top of Tangle and is more likely to get confirmed by other transactions, whereas, reattaching we create a new transaction with the same signed bundle as the original.

Not all transactions can be promoted. In IOTA.js, there is a handy method isPromotable that tells you if a tail transaction can be promoted or not.

Read the Full Article

This post was originally published on——2. The IOTA-News Community curates, examines, and summarizes news from external services while producing its own original material. Copyrights from external sources will be credited as they pertain to their corresponding owners. The purpose is to make use of 3rd party content or pictures as either allusion or promotional endorsement of mentioned sites. If you have a claim of copyright infringement with respect to material, please mail to support[at] is a community run website and is NOT affiliated with the IOTA Foundation in any way.