Showing posts with label Blockchain. Show all posts
Showing posts with label Blockchain. Show all posts

What are Smart Contracts?

Ethereum Technology

The year 2015 was very important for blockchain and cryptocurrency technologies. It was at that time that Ethereum appeared on the market. Unlike Bitcoin, Ethereum's main task was to create a fully decentralized application platform for users.

In addition to modern technology and innovations that came with this new open-source platform, smart contract is "probably" the most important business solution of the future.




So, what is a Smart Contract?

As I have already mentioned, Ethereum's main goal is to provide users with a decentralized application platform. Where any developer can create his/her own decentralized app with smart contract. 

To understand how this system works, we must first understand the concept of smart contract. The idea of ​​this solution appeared in 1996 - more than 20 years ago, but only now we have the technical possibilities to apply it through Ethereum.

Smart contracts are used to enforce individual lines of code. In other words, if there is an event A, the reaction will be B. The key point here is that blockchain, or individual nodes on the blockchain would verify if that event A happened to process reaction B. This would get rid off intermediaries and reduce costs.

It is a very simple process that happens simultaneously in thousands of blockchains. Also due to the existing technology, smart contracts provide extremely powerful computing power and new possibilities for everyone.

The main idea of ​​smart contracts is to use blockchain technology not only to enforce a certain type of action, but also to automatically verify and facilitate it. These actions must be carried out automatically. When this condition is met, the system proceeds to the automated execution of transactions.

This system is useful in many fields, not only for banks. Blockchain's ecosystem has an advantage over classic transaction, contract and agreement process. Blockchain doesn't need a third party to verify transactions or contracts. This is one of the main reasons why Ethereum is successful and is becoming more and more popular.


How to use Smart Contracts?

Now that you know what smart contracts are, I would like to point out some areas in which this technology can be practically used. Please note that not all of these solutions can be effectively introduced into the markets.

Let's think of automated payments or money transfer. "if the event A happen X amount of money has to be transferred to party B"

This technology would automate M2M (machine to machine) payments when it comes to Internet of Things. Where you drive your Tesla through the highway and the toll fee can be collected and verified automatically without you stopping.

Smart contracts will also allow us to replace traditional contracts.... think of rental agreements, labor agreements, etc.Thanks to smart agreements, we could automate the entire process related to traditional contracts.

Think of Sport Betting. All games and bets are in most cases conditional. If one team wins, you must pay X money to the user. Smart agreements will allow you to automate this process (no middle man to verify) and reduce the costs of bookmaking services, and increase their safety.

Considering everything I just wrote, it's easy to say that this unique technology will be quickly adapted by the market. The question is not whether this will happen, but when it will happen. Therefore, everyone should have fundamental knowledge about them and use their abilities!

Blockchain Security


Blockchain Technology and Security


Undoubtedly Bitcoin’s Blockchain has some strong advantages. One of them is anonymous transactions. Bitcoin holder does not need to provide personal information. Users are using a cryptographic hash function (which the blog explains later) to represents their pseudonymous identity on the network. Bitcoin payments are fast, and almost no-cost transfers to anywhere in the world, for which different transaction parties only need to access the Internet. The system has double-spending protection meaning that one cannot send the same coin to several people at once. This attribution is done through proof of work protocol.         


            The Bitcoin system is very user friendly where convenience and ease of use of Bitcoins is a fundamental aspect of this currency.  The other main advantage of Bitcoin is that transactions are made without intermediaries, as opposed to any other payment system where all the reactions must go through the clearing house as banks or central banks. This independence from governments and financial institutions makes it very attractive to the users that would like to maintain its privacy as well as it makes it very popular on the black markets. As previously discussed the limited and strictly planned supply of this currency reduces risks of inflation. Safety and security are probably one of the key advantages in use as long as one follow the basic safety rules in the network. Bitcoin has some great advantages in its security procedures which are accomplished through implying a blockchain systems to store the information.

            The essence of the blockchain is to maintain a common and collective accounting book of transactions, in digital form, distributed throughout the network in the same copies. This technology is based on peer-to-peer networks without central computers, systems that manage and verify transactions. Each computer on the network can participate in the transmission and authentication of the transaction. In the case of the blockchain, these will be blocks within the transaction book. The book is open to everyone but fully protected from unauthorized access by complex cryptographic tools. The user has only insight into his transactions. Because of this transaction, the transactions are public, but only accessible under the user's access rights and their entire history, from the very beginning of the blockchain to this day, can be reviewed and verified.    

           The chain of blocks as a transactional accounting book with current technology and computing power cannot be counterfeited. It is estimated that to break the blockchain network requires computing power equal to half the internet. Nevertheless, the introduction of quantum computers will require the implementation of new cryptographic security. The blockchain transactions recorded in the blockchain are irreversible. Attempting to change one block entails a change in the entire blockchain following it. If someone tries to cheat, change, or enter an unauthorized transaction, the blockchain nodes in the verification and reconciliation process will discover that one of the copies of the book is a non-compliant transaction on the network and refuses to include it in the chain of blocks. Data, transactions and their order are resistant to counterfeiting and manipulation of any kind. The same blockchain philosophy, advanced mathematical methods, and cryptographic security allow us to trust the data contained in the accounting books of the transaction. Next section will describe key protocols or producers involved in the creation of a blockchain.

Blockchain ecosystem and security

The blockchain ecosystem and all the different protocols involved in creating/verifying transaction are making Bitcoin very secure, resistant to fraud or double spending. Cryptographic hash function is used to digest a message of transaction that is coming from party A to party B. Bitcoin is using the SHA256 standard to accomplish such a digest. SHA 256 converts any message (doesn't matter what length) to 256-bit length numerical representation of that message. If the message is changed then the SHA256 function will change too. This process is irreversible, which mean that we cannot translate hash function back to the original message.       
            The Digital Signatures are used to sing this transaction message by the sender. Each of the Bitcoin users has two different sign keys. One is private and one is public to verify if party a sign the document. Both of those keys are mathematically connected. If the party A signed one document is will result in digital signature which is just like SHA 256 just set of alphanumeric figures that are connected to the public key. Each signed message will result in the different set of numbers which makes it very secure (more than the manual signature that is always the same).

            When the transaction message is created it is sent out to everyone on the system to verify it. Other parties have public verification key of party A to do it. Now people with huge computers with enormous computing power can begin “mining” and competing for the reward associated with “mining”. Previously mentioned “mining” is a reward based system, where different nodes compete to be the first one to create and add a new block to a chain of a block. The first person to do it will receive a reward of 12.5 Bitcoins as of this year. This reward will get smaller over a time and there is a system that determines it. Sometime in the 22nd century, there will be no more rewards available because the system will reach the limit of 21 million Bitcoins issued.
               
            Those “miners” collect different transaction and put them into the ledger structure (like in the accounting system) to create a list/ block of those transactions. All transactions are connected to each other through hash functions.
Once the block is ready to be connected to the chain. Mainers include the hashtag (generated through Proof of work protocol) of the previous block to the new block. After that competition starts. Computers are trying to generate the hash that correspondents to challenges issued by the system, which is asking them to create a hash with many 0 in front of the hash function. As one knows, one message will result in only one particular hash function; therefore, miners have to include a nonce which is an arbitrary set of text to the block that will help computers meet the challenge. Computers accomplished that by guessing random values, just like in brute force attack that is used in cracking the password. The first computer to do it will be accepted through the others and add to the system.
               
            Now, if anyone would like to change a block or create a different transaction then he or she would have to have a computer with the greatest power on the system to create the new chain of blocks that is longer than existing one, so the system can accept it; because only the longest chain is accepted. This computer must have a better guessing power than all the other computers together, due to proof-of-work protocol. And it would have to generate longest chain of block in just 10 min.  It seems impossible as of now. And it might be impractical. If some have the best computer out there one could be just “mining” and getting the rewards.

I know that it all seems very complex. If you would like to understand it better, please watch these videos made by Khan Academy, that explain everything carefully.