Abstract:
In modern days, transactions can vary from a huge transaction to microtransaction. But Bitcoin and other cryptocurrency doesn’t allow a microtransaction without any transaction fee. A new cyptocurrency called IOTA has no transaction fees which means IOTA can be used for micropayments. We can send IOTA to an address with no fees charged. Basically, instead of a smaller subset of the network being responsible for the overall consensus (miners/ stakers), the entire network of active participants are directly involved in the approval of transactions. As such, consensus in IOTA is no longer decoupled from the transaction making process: it’s an intrinsic part of it, and it’s what enables IOTA to scale without any transaction fees. A full node environment is setup and added this node to neighbors which are attached to the tangle. Performed a microtransaction from full node to the other node and addressed few concerns which existing system is having like transaction speed and scalability. This removes the existing problem of transaction fee and at the same time provides various benefits like scalability and high transaction speed.
Introduction:
What is blockchain?
A blockchain is made up of two primary components: a decentralized network facilitating and verifying transactions, and the immutable ledger that network maintains. The question is how do we perform microtransaction in this ledger.
The answer to the above question is that with blockchain, we can imagine a world in which contracts are embedded in digital code and stored in transparent, shared databases, where they are protected from deletion, tampering, and revision. But using bitcoin, the transaction fee is greater than the normal fee using the bitcoin and how fast and scalable is the solution.
The Problem with Blockchain
The new feature can totally change the mobile business and some related paid content, like apps or games. This field deals mostly with micro-transactions and its expensive fee structures. However, “Bitcoin has the potential to help this problem by generally lowering fees. But things get really powerful with off blockchain transaction, because it literally brings the fees down to zero”. But this would really not be a good option to make a microtransaction as the transaction fee is really high.
Scalability
• Bitcoin’s blockchain takes about 10 minutes to confirm a transaction. About 200K unconfirmed transactions at a time.
• This is annoying. As this deals with higher transaction fee and deal with transaction uncertainty.
It’s hard to scale. As we don’t want to store the data directly in block chain as there is thing called block chain bloating so we want to have a pointer which is pointing to a data living in a distributed hash table.
Fees
• Average transaction fee for transaction is in bitcoin network is $1. It might not be too much for high transactions but for the transactions dealing with microtransaction, it means a lot!
• Solutions include increasing block size limit, lightning network, central servers for off chain transaction, sidechains and treechains.
Lots of Computing Power required
• Mining is somewhat centralized in blockchain by giant mining pools.
• Transaction speed declines as the network increases in size as more transactions compete for the limited block spaces.
• It will take more and more computing power to mine the same amount of bitcoin.
Vulnerable to Quantum attack
• Bitcoin and other proof of work based blockchains are susceptible to being broken by a powerful quantum computer.
There is another technology which has evolved called “IOTA”.
IOTA ARCHITECTURE
IOTA USES BLOCKDAG
• IOTA is not an acronym for Internet of Things, IOTA just mean something very small. Block chains are sequential chains where blocks are added in regular intervals.
• The tangle a DAG (Directed Acyclic Graph) is able to achieve high transaction throughput and no transaction fees on transactions.
• As it grows and more participants make transactions, the overall system becomes more secure and faster, with confirmation times/ transaction finality going down.
• But look it’s still uses distributed database, it’s still a P2P network and it still relies on a consensus and validation mechanism.
• The more the nodes, the faster the transaction speed will be.
Green Blocks: Transactions on which consensus was achieved.
Red Blocks: Transactions where we are still uncertain on their full acceptance.
Grey Blocks: Tips (Unconfirmed transactions).
There is no transaction fee as there is no mining involved. When we make a transaction we need to approve two other transactions using the proof of work.
Height
• Height is the length of the longest oriented path to the genesis.
• For example: G has a height of I. D has a height of 3
Depth
• Depth is the longest reverse- oriented path to some tip.
• For example: g has a depth of 4 to TIP A. Path = F,D,B and A.
It’s a 3 step process to make a transaction
1) Signing – You sign the transaction inputs with your private keys.
2) Tip selection – Markov chain Monte Carlo is used to randomly select two tips (i.e unconfirmed transactions), which will be referenced by your transaction.
3) Proof of Work: In order to have our transactions accepted by the network, we need to do some proof of work- Similar to hashcash.
Your node checks if the two transactions are not conflicting. Next, the node must do some proof of work by solving a cryptographic puzzle (hashcash). Hashcash works by repeatedly hashing the same data with a tiny variation until a hash is found with a certain number of leading zero bits. This PoW is to prevent spam and Sybil attacks. A Sybil attack is based on the assumption, that half of all hash power is coming from malicious nodes.
Once you’ve done that, your transaction will be broadcast to the network. Someone else will come along, choose your transaction in the tip selection process and validate it. And just like that, transaction is confirmed.
• It’s quite easy to determine the confirmation level of your transaction: it executes the MCMC algorithm N times, the probability of transaction being accepted is therefore M of N.
• As a merchant, in IOTA you have complete freedom to decide with what probability you will start accepting transactions. If you are happy with 51% transaction you can increase the threshold to 99 or 100.
How does IOTA prevent double spending
• In the tangle, transactions are atomic. During processing though, bundles are.
• When a full node is asked to provide tips to a light node to create a transaction, the full node will walk backwards along the edges of the DAG to the general transaction and check if there are any conflicting transactions along the way. If there is then that tip is discarded. If there isn’t then the tip is considered valid.
• An attacker would have to outpace the input flow of new transactions. The tangle is network bound – requiring an attacker to be everywhere at the same time.
• So full nodes are constantly being asked to provide branch and trunk tips to the light nodes for bundling purposes and will only select tips free of conflict. The attacker will try and do the same with the double spend and has to find a way to overwhelm the entire network’s influx.
• There is no global consistency in the tangle. There is only eventual consistency.
• Stuck transactions are called orphans. They can be grouped together in subtangles.
To make it possible for the network to grow and protect it against certain attacks, IOTA currently relies on a coordinator. The coordinator checkpoints valid transactions, which are then validated by the entire network. The coordinator is being run by the IOTA foundation in a multi-signature. The coordinator cannot go rogue as he is being checked and validated by the entire network.
IOTA FEATURES
• Infinite Scalability
• No fee micro- transactions
• Quantum- resistance
• Making micropayments in the Bitcoin network makes no sense if the fees are higher than the transaction value.
Setup:
1) To set up the Full node we need to install the java by going to this link: http://www.oracle.com/technetwork/java/javase/downloads/index.html
2) We install Java SE 8u171 since it is considered to be stable version.
According to the Operating System install the desired version. I have used Windows x64.
3) Go to https://github.com/iotaledger/wallet/releases to install the wallet and it acts as front end for the node.
4)
5) Go to https://github.com/iotaledger/wallet/releases and download the above showed jar file.
6) Once, the wallet is being installed it will have the screens as shown below
Mention the port number you see in the wallet after installation.
Once this is done mention the name u desire and create a rule which will allow the wallet port to go through the firewalls and interact with the IOTA network.
• Once this is accomplished, it will throw an error which needs the iri file to be pasted which was downloaded in step 5 in the where the iota wallet folder is created. For instance over here, my iota folder is created in C folder under AppData\Local|Programs\Iota. Go to resources under iota folder and create a new folder called iri and paste the one we downloaded in step 5. Only after this step a full node is installed.
• If the above step is successful, then this is how the wallet GUI looks.
We can add neighbors who plays a very vital role in performing the microtransaction. The full node needs to have neighbors and they approve the other 2 transactions using the consensus and proof of work and then they can make their own transaction. The below screenshot shows how the neighbors beings added in the network.
The neighbors can be added by going to iota.slack.com and then we need to make a request saying we are interested in having neighbors and then send a personalized information to the who approves to be the neighbor and then send the ipaddress with the port number to the user in this way: udp:// ipaddress: portNumber.
Below screenshots show that the node configuration my full node is hosting.
• Once, the Full nodes is running, we need to run a curl command to check the status of the node.
The command is :
$ curl http://localhost:14265 \
> -X POST \
> -H ‘Content-Type: application/json’ \
> -H ‘X-IOTA-API-Version: 1’ \
> -d ‘{“command”: “getNodeInfo”}’
To setup the Curl, one of the ways is to install Git as it comes with lot of advantages
• Git takes care of the PATH setup during installation automatically.
• You get the GNU bash, a really powerful shell, in my opinion much better than the native Windows console.
• You get many other useful Linux tools like tail, cat, grep, gzip, pdftotext, less, sort, tar, vim and even Perl.
We can get the neighbors node information using the following node.js script
var request = require(‘request’);
var command = {
‘command’: ‘getNeighbors’
}
var options = {
url: ‘http://localhost:14265’,
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
‘X-IOTA-API-Version’: ‘1’,
‘Content-Length’: Buffer.byteLength(JSON.stringify(command))
},
json: command
};
request(options, function (error, response, data) {
if (!error && response.statusCode == 200) {
console.log(data);
}
});
Here is the script which shows a sample hello world program with a microtransaction of 0$ with the IOTA Tangle.
To enable the node.js in the windows OS , follow the instructions mentioned in the https://blog.teamtreehouse.com/install-node-js-npm-windows
Below is the code:
> var IOTA = require(‘iota.lib.js’);
undefined
> var iota = new IOTA({
… ‘host’: ‘http://localhost’,
… ‘port’: 14265 });
undefined
iota.api.getNodeInfo( function( err, res){ if(!err){ console.log(res) }else{console.log(err)}});
undefined
> { appName: ‘IRI’,
appVersion: ‘1.4.2.2’,
jreAvailableProcessors: 4,
jreFreeMemory: 671289976,
jreVersion: ‘1.8.0_161’,
jreMaxMemory: 3804758016,
jreTotalMemory: 1680343040,
latestMilestone: ‘999999999999999999999999999999999999999999999999999999999999999999999999999999999’,
latestMilestoneIndex: 338000,
latestSolidSubtangleMilestone: ‘999999999999999999999999999999999999999999999999999999999999999999999999999999999’,
latestSolidSubtangleMilestoneIndex: 338000,
neighbors: 4,
packetsQueueSize: 0,
time: 1522086043868,
tips: 0,
transactionsToRequest: 0,
duration: 0 }
> var seed = “JDKPNDVNY9MEHYIUODCSGBSPKLOZRKLEWXIFRJPHDILBIFF9QKSTUJWVXDJP9YZSOKPEHPQI9YWEGYABB”;
undefined
> iota.api.getNewAddress(seed, function( err, res){ if(!err){ console.log(res) }else{console.log(err)}});
undefined
> CQ9XWXFSUPBXWUQG9BPJVFJGMWIGVF9WOIRJBMRZWFTNCLWMOXACDLLKSN9C9AA9WZCMNIUICKBCBDGBW
> var sendAddress = “CQ9XWXFSUPBXWUQG9BPJVFJGMWIGVF9WOIRJBMRZWFTNCLWMOXACDLLKSN9C9AA9WZCMNIUICKBCBDGBW”;
undefined
> var messageTag = “HELLOWORLD”;
undefined
> var messageToSend = “Hello World!!!! My IOTA message”;
undefined
> var messageTrytes = iota.utils.toTrytes(messageToSend);
undefined
> messageTrytes
‘RBTC9D9DCDEAFCCDFD9DSCFAFAFAFAEAWBMDEASBYBCCKBEAADTCGDGDPCVCTC’
> var transfer = [{ ‘address’: sendAddress, ‘value’: 0, ‘message’: messageTrytes, ‘tag’: messageTag}];
undefined
> iota.api.sendTransfer( seed, 1, 14, transfer, function( err, res){ if(!err){ console.log(res) }else{console.log(err)}});
Undefined
This screen shows the microtransaction of $0 and just in case if there is any error, then it’s either because there is no graphic card available as tangle needs to have a graphic card or because there is no proper neighbors been added.
Future Work:
1) Powershell Script which would automate the installation and setup of the
Full node.
2) A Interface where in the user can provide the details required to automate the script.
References:
https://iota.readme.io/docs/what-is-iota
https://www.networkworld.com/article/3250680/internet-of-things/when-iot-met-blockchain.html