MAST or Merkelized Abstract Syntax Trees, is an important development with which several tools are being created that will allow them to take Bitcoin to a new level and even give it greater potential to create advanced smart contracts. 

Ldevelopers of Bitcoin They are always in search of alternatives and solutions that improve the characteristics of the blockchain. Thus, the proposal of Merkelized Abstract Syntax Trees, also known as MAST, has the purpose of improving the capacity of Bitcoin scripting, as well as their safety. A function that can not only be applied to Bitcoin, but also to any cryptocurrency implement the update followed

This proposal arises and is created due to the constant competition that exists against other blockchain networks. Especially those that offer very attractive features like advanced development smart contracts, even for novice developers. So this improvement to the Bitcoin system can lead to this network offering greater and better functionalities. A point that can further enhance Bitcoin's position within the huge cryptocurrency and blockchains universes 

The implementation of MAST was released by the developer Johnson lau in 2016, under the BIP-0114.. And this will be possible if the SegWit update continues to bear fruit, paving the way for the application of a new range of technical improvements to the system.

Formulation of the MAST proposal

This proposal arises from 2 concepts. First the Merkle tree. This is an integrated feature from the early days of the Bitcoin blockchain. Its function is to allow the verification of transactions within the blocks of the blockchain, and also the verification of the same blocks. Thanks to it, it is possible to know if they are part of a set without having to download the complete information. 

This reduces the need for storage space to store all the blockchain information. An example of this functionality can be seen with the SPV wallets. These lightweight wallets allow us to verify if a transaction has been added to a block, without the need to download the entire blockchain. Something that is possible thanks to the use and application of Merkle trees.

Second, there are the ÁAbstract Syntax Trees, also called AST. These have their origin in a type of algorithm that divides the information into different individual parts. This makes it easier to understand and classify this information, while allowing us to access relevant or interesting data quickly. All this without the need to publicly display or expose all the information they contain. 

It is thanks to the combination of these two tools, that we can build MAST. A method that makes it possible to include much more complex data and information to the blockchain network. While your privacy is improved and the need for storage space is reduced.

MAST objectives

Now what are Bitcoin developers looking for with MAST? Well, first of all they seek to create a mechanism to fragment the information of the blockchain in a more specialized way. More specifically they seek to fragment the programming of the Bitcoin Script. But at the same time, they want to maintain a verification mechanism for those scripts avoiding security problems. From there, they decided to link the Merkle trees with the abstract syntax trees.

Calculation of a MAST or Merkelized Abstract Syntax Trees

Thanks to this, the developers of Bitcoin designed a new mechanism to segment the scripts and verify them without the need to download all the information from the blockchain. Also, this method allows the parts or fragments of that script that were not used can be replaced or hidden. The latter, in order to reduce the space occupied on the network, while improving the privacy of the system by not having to reveal the unused parts. 

To understand the scope of this clearly let us cite an example: 

When a user owns a certain quantity of goods, he can establish conditions on their spending. If Maria has the amount of 10 BTC in a Bitcoin address, she can establish a script that allows her husband to use that money after a while. In case something happens to her and then she can no longer spend it. 

Well, Maria can spend the BTC at any time she wants, but if for any circumstance that certain time elapses, let's say 6 months, and the BTC have not moved from her account, María's husband can make use of those money. Now, Maria's husband, preventing any situation, can also establish a script where, also if for some reason he cannot use the funds in 4 months, his children can have the money. All this chain of script and conditions to spend the funds demand a lot of space on the network, in addition to remaining public, regardless of whether they are fulfilled or not. 

So, considering that the scripts that contain all the information (both the public keys of Maria, the husband and the children, the conditionals and the established times) are added to the blockchain, this considerably increases the storage space used. At the same time they reduce privacy, because all the data and conditions established in a public way are exposed.

Therefore, it is necessary to add a tool that guarantees privacy and minimizes the size of transactions. This is what MAST does by eliminating the need to add unused parts of a script to the Bitcoin blockchain. 

Creation of more complex smarts contracts

The example above looks like an advanced smart contract, don't you think? It is quite similar. And here is another of the great benefits that the implementation of MAST will bring. MAST opens the doors to expand the programming capacity of Bitcoin Scripts. In a nutshell, it is one step further in the implementation of smarts contracts o smart contracts high complexity. 

This is possible thanks to the fact that MAST allows the creation of a large number of scripts and liens without demanding too much space. What makes it possible to create more complex smarts contracts within the blockchain. All without having to harm blockchain scalability

How much do you know, cryptonuta?

Would MAST break Bitcoin security?

FALSE!

MAST, or Merkelized Abstract Syntax Trees, does not pose any security risk within Bitcoin. In fact, applying MAST together with the Schnorr signatures, Bitcoin's security and capabilities would visibly improve, both in terms of security and privacy.

Advantages of implementing MAST

MAST will bring multiple benefits to the Bitcoin blockchain. Firstly, by reducing the size of the transactions with the use of the Merkle tree, they take up less space within the blockchain. With which you can improve the scalability problem that the network presents, since it does not have to include all the information within the chain. This leaves more free space to process more transactions quickly. 

Also, the level of Privacy of transactions will also be improved on the blockchain. With the implementation of AST in MAST, only the essential information of a transaction or script can be revealed. Without having to show all the previously established conditionals and restrictions. Thus, conditionals and restrictions that are not activated in the transaction will simply not be included within the blockchain. Guaranteeing the privacy of users by not disclosing their data, and optimizing the space and use of the blockchain.  

On the other hand, MAST can also contribute to improving the fungibility of the system, since it could prevent certain cryptocurrencies from being associated with a smart contract or a particular transaction.

However, these functionalities are still under development and testing, so it will take some time for us to finally see them applied in the Bitcoin blockchain.