Moving assets between Algorand and Milkomeda Algorand Rollup (Testnet).
We were very excited to announce the deployment of the Milkomeda A1 rollup to the Algorand testnet in July and we know that many of you who have been following it are excited too!
The launch of the Algorand Rollup is a big milestone for Milkomeda, Algorand, and the blockchain ecosystem as a whole. Not only because it is one of the first deployments of a rollup outside of the Ethereum ecosystem, but also because it brings EVM (Ethereum Virtual Machine) capabilities to Algorand and opens up this layer 1 blockchain to smart contract developers working in Solidity.
Before we dive into the process of moving assets between the Milkomeda rollup and the Algorand main-chain (also technically known as wrapping and unwrapping), we’re going to delve into what token bridges are and, after we’ve been through wrapping and unwrapping, we’ll talk a little bit about blockchain confirmations and why they’re important.
What is a Token Bridge?
Each blockchain is slightly different from all the others and this means that they are unable to directly communicate with each other. So you cannot simply move tokens from one of these non-communicative blockchains to another. This is why we use Token Bridges, also known as blockchain bridges, are protocols that connect two different blockchains and allow you to transfer assets from one to another.
The assets cannot really be sent from one chain to another because the blockchains don’t have built-in capabilities to export and import assets with other chains. Instead the bridge takes custody of the asset from one side and releases a mirrored asset on the other. In order to guarantee the safety of the assets in the bridge’s custody we have multi-signature schemes in place. The bridge has already two audits with well-known security companies and we are in the process of formally verifying it. The participants of the multisignature scheme are called Validators and we expect a minimum number of validators to participate in the protocol in order to perform each action: this is the quorum. In the near future, the bridge will be updated to upgrade to a PoS system (more information coming on this in the next couple of months).
Moving assets from the mainchain (Algorand) to the Layer 2 (the Milkomeda Rollup) is called wrapping. A wrapping is initiated by a user sending a special transaction to the stargate address: a multisignature account on the Algorand mainchain. That transaction must contain a special note in order for the bridge validators to know where to send the given assets. The validator will then vote on a special smart contract on the L2 to release the funds. Each votes provides us with more guarantees that the wrapping was actually requested by a user on the mainchain and that the funds are indeed in the bridge’s custody.
Moving assets the other way (from the Layer 2 to Algorand) requires the user to interact with the bridge’s smart contract in order to request their unwrapping. The validators will then coordinate to build the transaction to release the assets from their custody on the mainchain. Each validator (at least the quorum) needs to provide the necessary signatures in order to validate the transaction on chain.
So how can you use a token bridge to port funds to the Milkomeda Algorand A1 rollup?
Transferring Assets from Algorand Testnet to Milkomeda A1 (Testnet)
Completing the wrapping process requires connecting your wallets to the Milkomeda bridge dApp and then creating and confirming the transaction.
1. In the Milkomeda Algorand bridge dApp click the “Select Token” drop-down to select “Algorand (ALGO)” and you’ll see the fields underneath populate.
2. Click “Connect Wallet” on the Origin (or in the dApp’s top right corner) side and your MyAlgo wallet (we recently also added Pera Wallet support — see our announcement!) will require you to enter your password and confirm which account to connect to the dApp.
You’ll want to make sure that you’ve set your Algorand wallet to operate on the testnet (the dApp will ask you to change your network if not). Your available balance of test ALGOs, simply called ALGOs, will then be displayed below the select token field. If you don’t have any test ALGOs you can get them for free from the faucet here.
3. Click “Connect Wallet” on the “Destination” side of the dApp (or in the top right corner) and your Metamask wallet will ask you to confirm that you want to switch networks(if you are not already connected to it) to the “Milkomeda A1 Testnet” network. Then you need to select and confirm which account to connect to the dApp.
4. Enter how many test ALGOs you want to transfer to the A1 rollup and click next (If you want to send your whole balance click “Max” to have the bridge calculate the maximum amount you can send minus the transaction fee).
5. Click “Next” to view a transaction summary, complete with “Estimated Fees” and an “Estimated Wrapping Confirmation Time”.
6. Click “Sign and Send” and then watch as your tokens get sent to the bridge, wrapped, and sent to your Metamask wallet on the Milkomeda Algorand Rollup!
7. You can now watch your transaction pass through the bridge
Congratulations! You just wrapped your tokens onto the rollup outside of the Ethereum ecosystem!
Transferring Assets back from Milkomeda A1 (Testnet) to Algorand (Testnet)
1. In the Milkomeda Algorand bridge dApp click “Select Token” and select “Milkomeda (milkALGO)”.
2. Click “Connect Wallet” on the “Origin” (or in the top right corner) side and log in to your Metamask wallet to connect to the dApp. Remember to log in to your MyAlgo (or Pera Wallet) wallet also. Your available milkALGO balance will then be displayed below the token field.
3. Once your wallets are connected, enter the amount of milkALGO you want to send back to the Algorand mainnet (If you want to send your whole balance click “Max” to have the bridge calculate the maximum amount you can send minus the transaction fee).
4. Click “Next” to view a transaction summary, complete with “Estimated Fees” and an “Estimated Unwrapping Time” information.
5. Click “Sign and Send”, then click “Confirm” in your Metamask wallet to send the transaction to the bridge.
6. You can now watch your transaction be processed by the bridge:
Congratulations! You’ve just unwrapped your tokens from the Milkomeda Algorand Rollup to the Algorand!
If you want to learn more about the Milkomeda Algorand bridge dApp and explore the rollup itself then all the links are here:
Milkomeda Algorand Bridge dApp (Testnet): dApp
Milkomeda Bridge Explorer(Testnet): Website
Milkomeda A1 Rollup Explorer (Testnet): Blockscout
Milkomeda Documentation: GitBook
Blockchain Confirmations Time
When you are watching your wrapping or unwrapping transaction being processed you may have noticed that it says “Waiting for confirmations…” above the status bar. Why are we waiting for “Confirmations”?
Blockchains are decentralized networks and require consensus between the network’s participants to confirm that an action has happened, e.g. a transaction is valid and has been accepted and processed. When you send a transaction to the network it gets pushed out through the network by the nodes that the network operates on. Your transaction is then included in a block by a block producer. That block is then added to the blockchain by the block producer.
Once the block containing your transaction has been added to the chain, that information is sent out to the nodes in the network so that they can update to the latest version of the chain (which now has your transaction in it) and confirm that the block containing your transaction is valid and a part of the immutable blockchain.
Like everything, this takes time, and “transaction confirmation time” is one of the metrics by which many people judge different blockchains. It is standard for the senders and receivers of transactions to wait for a certain amount of confirmations before accepting a transaction as processed and accepted by the network.
When using a blockchain bridge you are using a protocol that connects L1 network with L2 interoperability solution. When you initiate a wrapping or unwrapping transaction between Milkomeda and layer 1 blockchains you send a transaction to the bridge and this then starts a process of confirmation.
Specifically, the other side of the bridge is waiting for confirmation of that transaction on the blockchain that it took place on before it can begin the process of creating the transaction on its blockchain network, where it will forward you your assets. So the confirmation time for a transaction on Milkomeda is the time difference between sending a transaction on one chain and receiving that confirmation, via the bridge, on the other and then sending that second transaction through that network. This often means that, while transacting on Layer 2s is often much quicker, getting on and off these networks can often take more time than conducting a standard transaction across one blockchain.
Give Wrapping and Unwrapping a Go on A1!
The release of the MIlkomeda A1 rollup testnet is pretty exciting stuff and the announcement of our mainnet launch is imminent! Now that you are up to speed with how this innovative and truly exciting piece of technology works you can go ahead and prepare yourself for using DeFi and other dApps that are already preparing to launch with the Milkomeda A1 rollup mainnet (more news coming soon!) by testing out the sleek Milkomeda Algorand Rollup bridge dApp. Just a few clicks and you’ll be a part of true blockchain growth!
Make sure to follow Milkomeda to keep up to date with release announcements and to see who will be launching protocols for you to use on the mainnet A1 rollup as soon as it’s out in the wild!
Milkomeda:
Website: milkomeda.com
Twitter: @Milkomeda_com
Medium: @milkomedafoundation