Integrating the Ethereum Blockchain into Java Apps
4 stars based on
41 reviews
A secure blockchain programming java tutorial ledger with smart contract capabilities not requiring a bank as an intermediary! Also a single source of truth with complete traceability. Definitely something we want! Blockchain technology promises to make this possible. Blockchain became famous through cryptocurrency like Bitcoin and Ethereum. The technology could also be considered to replace B2B functionality.
Blockchain is the new kid on the block and there is not much experience yet on how well he will play with others and will mature. In this blog I summarize some of my concerns concerning blockchain of which I hope will be solved in due time. Also, this is my personal opinion. It might deviate from my employers and customers views. Most of the issues discussed here are valid for public blockchains.
Private blockchains are of course more flexible since blockchain programming java tutorial can be managed by companies themselves. You can for example more easily migrate private blockchains to a new blockchain technology or fix issues with broken smart contracts. A pure public blockchain not taking into account sidechains and off chain code is an immutable chain.
Every block uses a hashed value of the previous block in its encryption. You cannot alter blockchain programming java tutorial block which is already on the chain. This makes sure things you put on the chain cannot suddenly appear or disappear. Thus you cannot accidentally create money for example on a distributed ledger unless you create immutable smart contracts to provide you with that functionality. Security and immutability are great things but they require you to work in a certain way we are not that used to yet.
For example, you cannot cancel a confirmed transaction. You have to do a new transaction counteracting the effects of the previous one you want to cancel. See for example here. Blockchain programming java tutorial for example blockchain programming java tutorial DAO hack on Etherium. In an enterprise environment with a private blockchain, you can fork the chain and replay the transactions after the issue you want corrected on the chain.
This however needs to be performed for every serious enough issue and can be a time consuming operation. You do have to take into account however that transactions can blockchain programming java tutorial different results based on what has changed since the fork.
Being careful here is probably required. It is really cool you can also put a contract on the chain. Execution of the contract can be verified by nodes on the chain which have permission and the contract is immutable. This is a cool feature! However there are some challenges when implementing smart contracts. A lot becomes possible and this freedom creates sometimes unwanted side-effects.
They can clog a public blockchain and cause transactions to take a really long time. This is not the first time blockchain congestion occurs see for example here. This is a clear sign there are scalability issues, especially with public blockchains. When using private blockchains, these scalability issues are also likely to occur eventually if the number of transactions increases of course you can prevent CryptoKitties on a private blockchain.
Smart contracts are implemented in code and code contains bugs and those bugs, depending on the implementation, sometimes cannot be fixed since blockchain programming java tutorial code on the chain is immutable. Especially since blockchain is a new technology, many people will put buggy code on public blockchains and that code will remain there forever.
See for example the Etherium DAO hack. Because the code is immutable, it will remain on the chain forever. Every hello world tryout, every CryptoKitten from blockchain programming java tutorial will remain there. Downloading the chain and becoming a node will thus become more difficult as the blockchain programming java tutorial of code on the chain increases, which it undoubtedly will.
If they can create deterministic error free contracts which will be on the blockchain forever, that is of course possible. Blockchain programming java tutorial is a question though how realistic that is. In my experience technical people need to do that in a controlled, tested manner. There is no bank in between you and the public blockchain. This can be a good thing since a bank eats money.
However in case of for example the blockchain loses popularity, steeply drops in value or has been hacked compare with a bank going bankrupt, e. Your money might be gone. Updating the core code of a running blockchain is due to its distributed nature, quite the challenge. This often leads to forks. The issue with forks is that it makes the entire cryptocurrency landscape crowded.
It is like Europe in the past when every country had their own coin. You have to exchange coins if you want to spend in a certain country using the intermediaries everyone wants to blockchain programming java tutorial or have a stack of each of them. Forks, especially hard forks come with security challenges such as replay attacks transactions which can be valid on different chains. Some reasons you might want to update the code is because transactions are slow, security becomes an issue in the future quantum computing or new features are required e.
Security is one of the strong points of blockchain technology and helps with the security by design and by default GDPR requirements. There are some other things to think about though. Things put on a blockchain are permanent. You cannot delete them afterwards, although you might be able to make then inaccessible in certain cases. This conflicts with the GDPR right to be forgotten. Every node has the entire blockchain and thus all the data.
This might cause issues with legislation. For example requirements to have data contained within the same country. This becomes more of a challenge when running blockchain in a cloud environment.
In Europe with many relatively small countries, this will be more of an issue compared to for example the US, Russia or China. It is really dependent on the types of services the blockchain cloud provider offers and how much they charge for it. It could be similar to using a bank, requiring you to pay per transaction. In that case, why not stick to a bank? Can you enforce the nodes being located in your country? If you need to fix blockchain programming java tutorial broken smart contract, will blockchain programming java tutorial be a service request and will the cloud blockchain programming java tutorial fork and replay transactions for you?
Will you get access to the blockchain itself? Will they provide a transaction manager? Will they guarantee a max transactions per second in their SLA? A lot of questions for which there are probably answers which differ per provider and based on those answers, you can make a cost calculation if it will be worthwhile to use the cloud blockchain programming java tutorial.
In the cloud, the challenges with being GDPR compliant are even greater especially for European governments and banks. If you have lost your private key or lost access to your wallet more business friendly name of a keystore containing your private key, you might have lost your assets on the blockchain programming java tutorial.
Luckily a blockchain is secure and there is no easy way to fix this. If you have a wallet which is being managed by a 3rd party, they might be able to help you with recovering it. Those 3rd parties however blockchain programming java tutorial hacked quite often a lot of value can be obtained from such a hack. See for example herehere and here. A transaction is put on the blockchain.
The transaction is usually verified by several several nodes before it is distributed to all nodes and becomes part of the blockchain programming java tutorial. Verification can fail or might take a while. This can be hours on some public blockchains. It could be the transaction has been caught up by another transaction with higher priority.
In the software which is integrated with a blockchain solution, you have to keep track on the state of transactions since you want to know what the up to date value is of your assets. This causes an integration challenge and you might have to introduce a product which has a blockchain transaction manager feature. Blockchain requires large amounts of resources when compared to classic integration.
Everyone node has the complete chain so everyone can verify transactions. This is a good thing since if a single node is hacked, other nodes will overrule the transactions which this node offers to the chain blockchain programming java tutorial they are invalid in whatever way.
However this means every transaction is distributed to all nodes network traffic and every verification is performed on every node CPU. Also when the chain becomes larger, every node has a complete copy and thus diskspace is not used efficiently. See for example some research on blockchain electricity usage here. Another example is that a single Bitcoin transaction 4 can be processed per second requires the same amount of electricity as VISA transactions while VISA can do blockchain programming java tutorial per second, see here.
Of course there is discussion on the validity blockchain programming java tutorial such a comparison and in the future this blockchain programming java tutorial most likely change. Also an indication blockchains are still in the early stages. Blockchain is relatively new and new implementations appear almost daily. There is little standardisation.