- Original Content
One of the most interesting applications of blockchain technology has been the interoperability between different chains. Let's suppose that a user has a certain asset X (fungible or not) within the logic of a blochchain consensus. In turn, the user understands that there may be other chain that can interpret the information of X in another way, so that X is compatible with other applications and participates as an asset of those other chains, but at the same time X retains the properties it had in the original blockchain.
Let's take the example of a dapp on ethereum that enables the exchange of digital artworks printed as non-expendable tokens (NFTs). Let's suppose then that a Hive user wanted to sell the authorship of one of the works that he would have registered and shared in a community of digital artists of Hive. If an interoperability application existed, this user could transfer his work to the Ethereum network and commercialize its use, after some time of having exposed it to his Hive followers, he could even make "versions" of this work and sell a portion in different chains, integrate it to other applications such as collectibles in games, exhibition in virtual museums of NFTs, and many other possibilities, taking advantage at every moment of the benefits that could give him the use of some networks in particular.
There are blockchain platforms that have evolved a lot and that offer very interesting solutions to the dilemma of interoperability. Algorand is one of these platforms that are ahead of the game: Smart contracts in layer 1, both fungible and non fungible assets also in layer 1,a threshold of thousands of transactions per second, and confirmation times of less than 2.5 seconds. At the same time it has a whole environment to facilitate the work of developers as SDKs in several languages, free public access to APIs to interact with the blockchain and a Developer Center with development tutorials at various levels of complexity.
Today I will show you a simple example of interoperability that I have developed between Algorand and Hive, more specifically Algorand-Bloque64, a decentralized Hispanic news site that runs on hive-engine. The native token of the Bloque64 platform is BLQ.
Imagine that you manage an account that you use to cure content and somehow you want to distribute the "act of voting" through fungible tokens, that is, a Algo token represents a vote in Hive, the transfer is equivalent to "delivering" the right of a vote; and sending it to a special address (manager) is equivalent to voting on a certain post. In Algorand creating this type of token is relatively simple and it is not necessary to declare a Smart Contract for it, anyone can do it in layer 1 and declare the fields and distinctive attributes.
How does it work in practice?
In this example I create the token BLQV (BLQ Vote) and use the Hive @cubanblock account with currently about 100K BLQ in stake or voting power, I set a maximum supply and the address that initially will have the tokens. I also set a "manager" address that I will explain a little further below what it is used for. After defining all the parameters, I create the new token through a special transaction, and I transfer it to certain addresses so that the circulation starts. In a next post I will explain all the technical details involved in creating this token and the example in general.
Now, Bob is a Hive user and writes content for Bloque64, in turn Bob has a public address of Algorand. Bob has in that account Algo 10 BLQV, he just published a news post in bloque64.com and wants to receive a vote from @cubanblock in that post. To do this, Bob transfers from his Algo wallet to the freezing address 1 BLQV (at a rate of 1 BLQV = 100% cubanblock vote) and in the memo or text section of the transaction he enters the link to his post.
In a few moments, the backend receives the transaction at the "manager" address and casts the voting operation to the post received in the memo to an RPC node of Hive. That is, by means of a token-freeze action in Algorand, in this case BLQV, a healing vote is cast in Hive. The manager address is that specified at the time of creation of the asset in Algorand.
This address has the authority to destroy and modify certain parameters in the previously created assets. This operation (the sending of the BLQV token) can be done from the Algo Wallet for mobile devices, AlgoSigner plug-in for browsers, from the client node for computers, or using the own SDKs currently available in various programming languages. To add a new token in your Algo wallet you only need to make an authorization signature.
-Screenshot of Algo Wallet for Android, you can download it here
I clarify that this example has implementation details that if you are a developer you might like to know to implement your own cross-chain use cases. That's why I invite you to a next post in which we will address more technical details. (This example was made in Go)
Let's take the example to practice. Create an Algorand wallet, add the token BLQV, and send me your address something through a comment in this post, I will send 10 BLQV to all who comment this publication with your address after authorizing the token in your wallet. Start posting content for Bloque64, and get full upvotes from @cubanblock.
A simple case but one that demonstrates all the possibilities of interoperability!
Pablo Lara, Cuba Algorand Ambassador.