View Tags: How One Byte Will Reduce Monero Wallet Sync Times by 40%+

Published:
By Seth For Privacy

One of the most common complaints around using Monero day-to-day is the time that it can take to sync up a wallet before being able to send Monero. Thankfully, developers and researchers in the Monero community have found a brilliant way to reduce the time it takes you to sync your wallet by 40%+ without any added blockchain bloat, fees, etc.

Enter “view tags”, a one-byte addition to the data of each transaction – coming to Monero in the next network upgrade!


Why is Monero’s wallet sync slower than Bitcoin’s?

One of the first questions we have to answer to better understand the need for a solution like view tags is why Monero’s wallet sync is slower than cryptocurrencies like Bitcoin.

In Bitcoin, as all transactions are not private and reveal the coins being spent, the amounts, and the addresses involved on-chain, Bitcoin wallets can simply look for any unspent transaction outputs (UTXOs) or used addresses for a given wallet, quickly scanning the blockchain for only UTXOs owned by those addresses to figure out which coins belong to your wallet and can be spent.

In Monero, however, all transactions preserve the user’s privacy by hiding the sender, receiver, and amounts involved in each transaction. This privacy, while vital to protecting the users of the network, also introduces slower wallet synchronization. In Monero, your wallet has to compare every transaction output (TXO) that exists on the network with your wallet’s private keys.

This comparison involves a lot of complex math and cryptography to validate that an output is truly yours, since all amounts, addresses, and known-spent outputs (or coins) are hidden on-chain in Monero.


What are view tags?

As a way to help reduce the synchronization time for Monero wallets, a researcher named UkoeHB came up with a novel approach – add a 1-byte “tag” to each transaction using a shared secret known only to the sender and receiver of that transaction.

This shared secret is generated by the sender using the address provided to them by the recipient, and does not require any active collaboration by the sender and receiver. The first byte (or character) of this shared secret is then added to the transaction’s data when publishing it to the Monero network.

When one of the participants in that transaction want to sync their wallet with the Monero blockchain afterward, instead of needing to perform all of the complex math and cryptography for each and every TXO on the network, the wallet can now just check for that 1-byte field in each transaction and only then perform the time consuming verification on transactions that have that tag – 1/256 TXOs on the network, to be precise!

This tag does not reveal any information about the transaction to outside viewers, only adds 1-byte (a negligible amount) to transaction sizes, and yet allows us to reduce sync times by 40%+ by cutting down on the complex verifications necessary!


View tags: a simplified example

Imagine you have 4,096 boxes in a room, of which only 5 boxes belong to you. The boxes are all entirely indistinguishable from the outside, and the only way to tell if a box is for you is to open it and solve a time consuming math problem written down inside to ensure it’s yours.

Now, imagine you decide to have the person sending you those 5 boxes generate a special code using your address, and then put only the first character of that generated code on the outside of each box being sent to you. Everyone else does the same thing for their boxes (to ensure all boxes are still indistinguishable), but now you can simply look at the one character code on the outside of the box, and only open those boxes which have that character on them.

While other boxes will match your code, even some that are not owned by you, the number of boxes you need to open and solve a math problem on is now only 16 (1/256 boxes!) instead of all 4,096.

Now you open those 16 boxes, solve the math problems, and keep the 5 boxes that actually belong to you from that group!


When will view tags be available in Monero?

View tags are one of the features currently planned for inclusion in the upcoming network upgrade, and should be released some time this spring. The community raised 23.3XMR (at the time of writing) to incentivize the development and implementation of view tags, and as a result the vast majority of the work to include view tags in the Monero code base has already been completed by j-berman in collaboration with reviewers and researchers.

Once view tags are enforced by the network, all transactions sent after the network upgrade will benefit from the drastically improved wallet sync time. You won’t need to do anything special to start using view tags, your favorite wallet for Monero will simply start using them after the network upgrade automatically!


How can I learn more?

If this has piqued your curiosity around view tags, take a look below for some additional links that go in-depth into the topic:


Further reading

© 2024 Blue Sunday Limited