Monerujo’s PocketChange: what it is and how it works

Andrés
7 min readJun 5, 2023

--

PocketChange is the latest feature to be added to the mobile Monero wallet Monerujo. In a nutshell, when it’s enabled Monerujo creates extra change transactions when you spend, so you have always unlocked funds to spend afterwards.

If that sounds like nerdy gibberish, don’t despair. Let’s break it down.

The context

Every time you send Monero (XMR) from one address to another, you’re using the monero coins you have in your wallet. No surprises there. But those coins (UTXOs) are different from their physical counterparts in a funny way, they can have any denomination on them. You can have a 3.9857648773 XMR coin, where in the real world you’re stuck with fixed amounts, like 50 cents.

So when you want to send moneros your wallet check the coins you have and chooses which one to spend. But 99.99% of the times, the amount you want to send is not exactly the same as the amount of any of those coins you already have. So, what your wallet decides to do is to split that coin and make two transactions. One with the amount you want to send, and one with the change (the chunk of that coin you don’t want to send) that will go back to you. It’s just like paying for a €3 coffee with a €5 bill, you’d get two €1 coins in return.

Your wallet is tearing bills apart all the time without you noticing.

The problem

Monero has a very special… let’s call it design. Have you noticed that when you receive moneros, they show as locked for a while? You see they arrived but they don’t get added to your wallet balance. That’s because Monero has a rule that prevents anyone from sending received moneros again until 10 blocks have passed. Since the Monero network is set up to have new blocks every 2 minutes in average, those 10 blocks usually take 20 minutes.

Why in the name of the goddess of crypto would Monero have such a cumbersome annoyance? The answer is security. It’s assumed that a reorganization of the blockchain that is 10 blocks deep is too expensive to be feasible, so if 10 blocks go by and you still have your coins, you (and everybody else) can be pretty sure those moneros are yours and you’re welcomed to use them as you please. Those 10 blocks are like a mandatory Monero coins purgatory. They’re already yours, but they’re not yours to use.

Monero protects you from a spending spree. Thanks Monero!

If we use Monero as a currency in real life (and we should), this is a problem. Imagine you’re at a Monero conference and you pay for a beer at the bar, you’d have to wait 20 minutes before you can buy peanuts to go with it. By the time your change is unlocked, you either drank the beer already, or it’s warm. Or if an attractive person happens to approach you, you cannot buy them a drink until 20 mins have passed. By that moment you’re either making out or they realized how many unresolved childhood traumas you have.

The solution

There’s of course a way to avoid this: to carry several wallets. But in Moneroland this is also cumbersome, because you’ll need to keep them all synced individually to be able to use them. This is a pain in the ass.

Literally.

A smarter (nerdier) way to approach it is to send moneros to yourself to break those coins. But if you don’t manually break those coins apart into different transactions that go to different addresses, your wallet will try to merge them all together again. That’s exactly what you would do, if the wallet supports sending to multiple address in one transaction. It works, but you have to really think it through, calculate the amounts, copy and paste all the different addresses, and do it all in advance, otherwise it won’t make any difference. Long story short: it’s possible but it’s level 4 hackery.

Enter PocketChange

What Monerujo does, if you enable PocketChange, is… exactly that! But it’ll do it for you, and you don’t have to calculate anything, and you get all the benefits without any of the hard work (and without the level 4 hacker certification).

As long as it’s enabled, every time you use Monerujo to send moneros somewhere, it will take a bigger coin, split it in parts, and spread those smaller coins into 10 different pockets. That way, the coins won’t merge again, and you’ll be ready to spend instantly from all those pockets without waiting the dreadful 20 minutes.

Fanny packs are cool again. Who would have thought?

What’s the downside, you may ask? Well, since in Monero you pay fees to the miners for the transactions you want them to write on the blockchain, if they need to write more because you’re sending several coins to several places, they’ll charge more. But since Monero decided to have dynamic block sizes, and therefore such low fees, even paying 4 times the regular fee is still fractions of a cent. Let’s say you won’t care much about it if you want to experience Monero spending like never before.

How to enable it? Just open a wallet in Monerujo and go to the wallet’s menu. Click on PocketChange. You’ll find a toggle to turn it on and off, and a slider to choose the size of those coins to be generated for every pocket. If in doubt, leave it on 0.1 XMR. That means that you could buy something worth less than €14, 10 times (or even more) in less than 20 minutes. If you decide you don’t need it, and want to minimize your fees as much as possible, just turn it off. It’s important to realize you’ll get the benefits after the first time you send anything with this setting turned on.

How it works under the hood

If you’ve gotten this far, you’re one of those people that likes to understand stuff. Good for you! When PocketChange is enabled, Monerujo takes the first 10 subaddresses of that wallet’s account and uses them as the pockets. Since balances are individual for every account, so is this setting (you could have just one dedicated PocketChange account and not mess with the rest of your other ones).

The next time you spend, it’ll look into your 10 subaddresses to see if they’re full with 0.1 XMR (or whatever you set it to). If they are, it’ll just construct a normal transaction. If they’re not, it’ll create as much change as needed to fill them up.

Make it rain!

You can tell if a transaction you’re about to make is gonna be a PocketChange one on the last screen when sending. It’ll say how much you’re actually sending to the address you entered, how much is the fee you’re paying, and how much is the sum of the UTXOs you’re sending back to yourself as change.

If you want to verify this, it’s visible in detail in the accurately named details screen of any transaction. You’ll be able to see every individual transaction and its TX ID. Nerd at will.

Wrapping up

The infamous 20-minute refractory period is something we as Monero lovers are used to bare with. It’s no surprise, and we sometimes have the foresight to prepare in advance. But Monerujo is intended as the wallet for the streets. Our dream is to Monero to be used as our daily cash, and Monerujo our daily wallet. You shouldn’t have to wait that long to pay for your meat after buying your vegetables, or whatever suits your gut the best.

Today, this restriction is mostly felt on rare and beautiful occasions like a Monero conference, where we can play for a day or two that we’re in adoption land, and pay for stuff with our beloved coin. But the tools have to be ready before they’re needed, or else we’ll never get there.

The development of this feature was funded by our beloved users. You can see it along with other ideas, some done and some still in progress, at our funding.monerujo.app page. Thanks to you all who supports us.

4AdkPJoxn7JCvAby9szgnt93MSEwdnxdhaASxbTBm6x5dCwmsDep2UYN4FhStDn5i11nsJbpU7oj59ahg8gXb1Mg3viqCuk

--

--