Episode 33: Explaining RGB Tokens
Ep. 33

Episode 33: Explaining RGB Tokens

•

Episode description

In this episode of The Van Wirdum Sjorsnado, hosts Aaron van Wirdum and Sjors Provoost are once again joined by Ruben Somsen. The trio discusses RGB tokens, a Layer Two protocol for Bitcoin to support alternative currency and token schemes (like the currently popular non-fungible tokens, or NFTs).

Aaron, Sjors and Ruben explain that the Bitcoin blockchain has been (ab)used by users to host data since the project’s early days. This was initially done through otherwise-useless transaction outputs, which meant that all Bitcoin users had to store this data locally. A feature called OP_RETURN later limited this burden.They also explain that people have been using the Bitcoin blockchain to host alternative currency and token schemes for a long time.

More resources on RGB Tokens:

Chapters

00:00:00 RGB, NFTs and blockchain data
00:07:36 OP_RETURN and provably unspendable outputs
00:10:10 Rare Pepes, NFTs and digital ownership
00:13:32 Colored coins and real-world assets
00:18:58 RGB commitments and client-side validation
00:25:14 Transferring proofs and backing up token history
00:28:50 RGB tokens in Lightning channels
00:32:22 Routing, atomic swaps and token incentives
00:36:27 Growing and intertwined token histories
00:39:58 Bitcoin fees, security and alternative designs

Transcript

Download transcript (.vtt)
0:00

Aaron van Wirdum Before the show, a quick word from our sponsor. Live from Utrecht, this is the Van Wirdum Sjorsnado. Hello.

0:14

Sjors Provoost Hello. Hey, who's there?

0:16

Ruben Somsen It's another Dutch guy.

0:19

Sjors Provoost Welcome to the show, Ruben.

0:20

Ruben Somsen Thank you.

0:21

Aaron van Wirdum Welcome back, Ruben. Ruben, did you start selling your tweets yet?

0:24

Ruben Somsen You know, like I tried to sell one of my tweets to my sister, but she said, what the hell are you doing? And then she just laughed at me. So I failed.

0:32

Sjors Provoost Which rule of acquisition is it? Exploitation begins at home?

0:36

Ruben Somsen Yeah, exactly. I mean, families who you got to exploit first, right?

0:41

Aaron van Wirdum Sjors, did you make any good deals?

0:43

Sjors Provoost No.

0:44

Aaron van Wirdum We are actually going to discuss NFTs today.

0:46

Sjors Provoost I have been making some really bad price predictions because I hope those tweets will become worth a lot.

0:50

Aaron van Wirdum Bad price predictions?

0:52

Sjors Provoost Yeah, bad takes usually make more money than good takes.

0:54

Aaron van Wirdum I didn't know that. That's a good tip. Pro tips. But anyways, we are kind of discussing NFTs today, aren't we?

1:01

Sjors Provoost Yes, we are.

1:02

Aaron van Wirdum Not exactly, but partly.

1:04

Sjors Provoost Very exactly. Amongst other things.

1:07

Aaron van Wirdum Yeah. RGB, that's what it's called, right?

1:11

Ruben Somsen That's right.

1:13

Aaron van Wirdum Jogged my memory there. What does it stand for, guys? RGB.

1:16

Sjors Provoost Well, I think it's just a reference to the color scheme, red, green, blue.

1:20

Ruben Somsen Yeah.

1:20

Sjors Provoost But it doesn't actually mean anything in the context that we're going to talk about it. It's just the letters.

1:25

Ruben Somsen Yeah, and I think it's because…

1:26

Sjors Provoost Unless they made it a backronym. I don't know.

1:28

Ruben Somsen No, no, I don't think there's an acronym. It's referring to colored coins, right? So the colored coin idea of having other coins on the Bitcoin blockchain. The word color, RGB, that's how it's connected.

1:39

Aaron van Wirdum Clever. I didn't know that. Okay, so we're going to discuss RGB tokens today. Wait, is it RGB?

1:47

Sjors Provoost The RGB system.

1:48

Aaron van Wirdum The RGB system.

1:49

Ruben Somsen Yeah.

1:49

Aaron van Wirdum Okay, where do we start, Ruben?

1:51

Ruben Somsen Well, that's a good question.

1:52

Sjors Provoost I think we should start with the very, very long time ago in a blockchain far away. It was really, really, really cheap to make transactions and people thought they could put everything on the blockchain. For example, the Bitcoin PDF. The Bitcoin white paper is on the blockchain in its entirety. And this was done in a very, very, very inefficient way, which is by creating fake transactions. And those fake transactions, so you're not spending to real other people, to real addresses, you're creating fake addresses that you can actually interpret and then you can reconstruct a file from it. So this would be, for example, multisig addresses.

2:32

Aaron van Wirdum Yeah, so the idea is that addresses, as our listeners will probably know, they're just a bunch of numbers and letters. They're effectively a number in the end. And by, I guess, you're manipulating these addresses, you're just creating addresses, even though you don't have the private key. Yeah, you're sending some coins to these and then special software can interpret these numbers and turn them into…

2:57

Sjors Provoost Yeah.

2:58

Aaron van Wirdum Whatever data you want.

2:59

Sjors Provoost Pretty much. So we addressed addresses in an earlier episode, but in this case, the thing you're sending to wouldn't even be an address. It's a script that you put directly in the output of a transaction. And that gives you a lot of space to put stuff in. The technicalities don't really matter, but exactly. There is no private key with which to spend these coins because the public key, or even the hash of the public key, was generated as if it wasn't really a public key. It was just a series of bytes that looked like a public key, but actually just contained the contents of a file. And this means that money is unspendable, which is very annoying. And the reason for that is that... Coins, we have this thing called the UTXO set. The UTXO set is the set of coins that exist on the blockchain that can be spent by anyone. And nodes keep that in RAM. So when a new block comes in, the node will check whether or not it's spending money that actually exists. And this check is done using the UTXO set, which generally is kept in RAM, could be 10 gigabytes. And so it's very annoying when there's something in that blob of memory that everybody needs to keep track of that has no meaning, that can never be spent. Because the node doesn't know it can't be spent. The node just thinks anytime somebody could spend this, even though we know it's the Bitcoin PDF, you can't spend it.

4:20

Aaron van Wirdum Yeah. So what you're saying so far is that people were using, basically abusing the Bitcoin system in a way. They were manipulating addresses and sending coins to these addresses. Not a lot, but just some coins to have these addresses on the blockchain. And that translated into data that could be images or the Bitcoin white paper or other pieces of text or memes or whatever people felt like they were uploading. And because normal Bitcoin software can't really tell the difference, normal Bitcoin software just sees addresses. So now all these normal Bitcoin nodes like mine and yours and all our listeners who are running Bitcoin nodes, they actually have to check the coins on these addresses.

5:02

Sjors Provoost I think they have to keep those addresses in mind. So there's two things that happen, right? Because these things were put in the blockchain, well, you have to download the blockchain. So that's just wasted bandwidth for downloading. But that's not too bad. The problem is that it has to be interpreted as potentially valid coins. And as an optimization, you want to keep in memory those coins that could potentially be spent. And there's no way to drop them from memory. At least there wasn't.

5:25

Ruben Somsen So the problem is that you think they are spendable as a regular full node, but actually they are not. But there's no way of knowing other than kind of externally figuring out like, hey, this is just a white paper.

5:38

Sjors Provoost Yeah, but you couldn't… you couldn't add that to the node right? If… if… Say, we made a change to Bitcoin Core that says, you know what, we know that's the white paper. Let's just skip those coins.

5:48

Ruben Somsen I guess theoretically you could throw it out of UTXO sets if you're certain they're unspendable.

5:52

Sjors Provoost That's the problem. If you're certain. What if some really, really smart alien actually made it look like it's just the white paper? But no, no, no. It's really... There are private keys for it. And one day this alien tries to spend... The white paper. And we accidentally soft forked those coins out of existence and this alien gets really angry because he's like, hey, you can't just confiscate my money.

6:14

Ruben Somsen That sounds like an ECDSA break, but I'm not sure. Depends on, I guess, how it's done.

6:19

Sjors Provoost Maybe the person who created the white paper actually generated lots of public keys from private keys and then reordered them in such a way that it… Created a readable white paper. I don't think that's even practical.

6:33

Ruben Somsen No, but to your point, maybe there is a way in which it is actually valid, and we [unclear] be 100% certain. But one thing I wanted to add...

6:40

Aaron van Wirdum There's also a thing of where do you draw the line, because we do have vanity addresses, and you can sort of use that as well to create stuff. And where… at what point are you sure it's a vanity address and at what point…

6:51

Sjors Provoost Well, this… this would be like that would be absolutely unacceptable right? So the idea that you can't just decide what is vanity and what should be thrown away.

6:59

Aaron van Wirdum That's my point, I agree.

7:00

Sjors Provoost But if you could mathematically prove that a coin cannot be spent, like theoretically impossible to be spent, then you could have that discussion. But the problem is we can't really prove that.

7:11

Ruben Somsen But yeah, so one thing that I wanted to add is that... It is actually important that if you want to put data on the Bitcoin blockchain, it needs to be a valid transaction. So you can't just, that's why we're talking about these addresses, right? Because you can't just take the Bitcoin white paper and just put it there and just be like, hey, please put this in the blockchain. No, you need to do it in a format that the blockchain recognizes. And that's how you end up with these addresses.

7:35

Sjors Provoost Yeah.

7:36

Aaron van Wirdum Okay. So that was... The original problem, people were just bloating the blockchain with all sorts of nonsense that most of us don't care about. And we still need to all validate it and store it or whatever. That needs to be solved. Sjors, how did we solve that?

7:52

Sjors Provoost Well, this was solved many, many years ago using something called OP_RETURN. And the idea of OP_RETURN is that you create a transaction that spends coins and then it produces a coin, quote unquote, which has the instruction OP_RETURN. And then it's followed by whatever text you want to put on the blockchain. And now when a full node sees this, it knows, okay, if it starts with OP_RETURN, this coin is not spendable. Therefore, yeah, this coin is not spendable so I can forget about it. I do not have to put this in my RAM. I don't have to remember this. And the idea there was it was kind of a compromise. Say, well, people are going to put spam on the blockchain whether we like it or not. Let's at least reduce the amount of damage they're doing and make sure they pay like a reasonable fee for it as well. So there are some restrictions on the size of OP_RETURN to make sure that it's not too cheap to use it, but it is also cheaper than just spamming a blockchain.

8:46

Aaron van Wirdum Right, so I guess we're still sort of unhappy about it, but if people are going to do it anyways, then this is the least damaging way of doing it.

8:54

Sjors Provoost Yeah, well, at least it pays fees when you do this, and nodes only have to download it, but they can throw it away. They don't have to remember it. So the resource wasting is just a little bit of bandwidth and one-off CPU, but it's not wasting people's RAM, and RAM is probably one of the most scarce resources.

9:14

Ruben Somsen Right.

9:14

Sjors Provoost So it's fine. It can't be done any better.

9:17

Ruben Somsen Yeah. So the main thing is it doesn't enter the UTXO set and therefore it is a lot better than the previous solution.

9:24

Aaron van Wirdum So how much data fits into... One of these OP_RETURNs.

9:29

Sjors Provoost 80 bytes.

9:30

Ruben Somsen Yes and no, because I think that's not a consensus rule. That's just a propagation rule. So I believe it's actually valid to create one with more data, but then it won't be propagated. So yeah, practically speaking, you're right.

9:45

Aaron van Wirdum But... Can we do better? Can we compress it somehow?

9:49

Sjors Provoost Yeah, we could. No. Well, I mean, I think I know where you want to go towards the so-called Merkle tree.

9:55

Aaron van Wirdum Yes, please.

9:55

Sjors Provoost But I think we want to go somewhere else first because we can talk about the kind of fun things you can put in OP_RETURN that have meaning.

10:05

Aaron van Wirdum Okay.

10:06

Sjors Provoost Without actually compressing it. So we'll get to the compression part later.

10:09

Aaron van Wirdum Okay.

10:10

Sjors Provoost So let's say you really like Rare Pepe.

10:14

Ruben Somsen I know I do.

10:15

Sjors Provoost So Rare Pepe was a trading card system on the blockchain. And the way it worked is you could have a card and then you could offer it for sale and somebody could buy it and then that other people would have the card and they could sell it, etc.

10:30

Aaron van Wirdum Yeah, when you say card, you mean image. It's a digital image.

10:35

Sjors Provoost Yes, but in this case, it's important to note that the image is not on the blockchain. There's a reference to the image on the blockchain, the hash of the image. So I wouldn't still not call that compression, but I would say you're not spamming the blockchain with the entire image.

10:49

Aaron van Wirdum Sure, so explain this to someone who's new because it sounds like it makes no sense at all. You have an image and then you have a hash and then you have it on the blockchain. Why should people care about the hash or the image or any of this?

11:01

Sjors Provoost Well, this is exactly what's going on with the NFT hype nowadays.

11:05

Aaron van Wirdum That's why I'm asking.

11:06

Sjors Provoost So I would say there's no reason to care about this, but people were doing it. So we just have to sort of explain at least what they were doing. And so what you would do is you would have this image somewhere, maybe on a web server or maybe on your own computer. And so everybody would have access to this image because it's just data. But the question is who really owns the image from whatever that means, right? Whatever it means to own the image.

11:31

Aaron van Wirdum That sounds like an important question though. What does that mean? But go on.

11:35

Sjors Provoost I think it meant absolutely nothing.

11:37

Aaron van Wirdum Right.

11:38

Sjors Provoost But the way it was done is like everybody would have the image and you could take the hash of the image and then the hash of the image would be on the blockchain. And so that's how...

11:47

Aaron van Wirdum Let me… let me give you an example, where I think it might make sense, possibly, if you're playing something I've never played this, but you've got something like Magic The Gathering, if you'd want to make that into a digital version then, you could somehow prove that you own a specific card if you want to play it against another player. Well, if it's just an image, then everyone would have all the cards all the time. So now if you use...

12:12

Sjors Provoost Well, that's the idea. Yeah, you prove that you have the image, whatever having means.

12:16

Aaron van Wirdum Right.

12:16

Sjors Provoost But at least if everybody agrees on the rules, then you can do that.

12:20

Aaron van Wirdum Right. So yeah. So within some contexts, it might actually make some sense.

12:24

Ruben Somsen Yeah. I mean, I think it does make sense in some limited context. But the main thing is, is there going to be some kind of person who controls the NFT, right? If somebody issued it or they can issue more of it, then it becomes kind of questionable. But if it's like a one-time thing, like, you know, maybe somebody made a card game and it's just, it's kind of like a full node where you download the software's open source and then the software interprets the NFTs. And as long as everybody kind of agrees on the card game and the NFTs, then you have a card game with like you said, with cards that are actually rare. But, you know, anyone can just take the same game and play it for free. Right. So that's that's always inevitable.

13:06

Sjors Provoost Which is pretty much how this Counterparty slash Rare Pepe system worked as far as I know. So basically, you would put on the blockchain the hash of the image probably, and then you would say well, I'm now transferring this to this other person by just sending them coins essentially. And then whoever has the private key of where you sent the card has is now the new owner, and so you would have a piece of software that would read the blockchain and would see okay, this card is now moved to this other person and it's moved again.

13:32

Aaron van Wirdum Yeah, I want to take a small step back, and Ruben this is also something you wanted to discuss is the idea of colored coins. So we already mentioned it in this in the beginning of the episode. Yeah, so the idea of Ruben, colored coins, can you explain what colored coins are? and then we'll move on… Then we'll move back to NFTs.

13:50

Ruben Somsen Yeah. So, well, it is very similar because a NFT is a colored coin of one, basically. So it really is just the issuance of an asset. The name colored coin has been kind of what's been used. I think it's been maybe Counterparty was the first.

14:07

Sjors Provoost No, Counterparty is not a colored coin.

14:09

Aaron van Wirdum Colored coins predate Counterparty.

14:11

Ruben Somsen Yeah. There's Mastercoin. I don't know.

14:14

Sjors Provoost I can give you an example of a colored coin. If you want, but let's explain how it works.

14:19

Ruben Somsen Well, yeah, okay. But, I mean, are you saying that Counterparty doesn't have colored coins? Because I think technically they do. You could issue coins.

14:26

Sjors Provoost Counterparty can do colored coins, among other things.

14:29

Ruben Somsen Yeah.

14:29

Sjors Provoost But colored coins was a system on its own.

14:31

Ruben Somsen I see. Okay.

14:32

Sjors Provoost Okay. So the example I once even used, I think, was called Bits of Bullion. And what this was, was there was a trust, like a UK or whatever Cayman Islands structure, probably Gibraltar. And this trust owned gold in the real world. And then this trust had basically had its own bylaws and it would define the beneficiaries of the trust. So the nice thing about a trust is like nobody really owns the trust. The trust simply exists. And you create it and you set it in motion and then it kind of just exists out there. It's kind of a cool legal structure. But basically this trust would own gold and then there would be an instruction in the bylaws of the trust that says, well, there's this colored coin out there on the blockchain with this and this block hash or this and this transaction hash. And whoever owns descendants of this original transaction is actually a beneficiary of the trust legally. And so is entitled to that gold to be able to redeem it if they wanted to.

15:33

Ruben Somsen Right. So what you're saying is basically that the... There is a UTXO on the Bitcoin blockchain and somebody basically said like, hey, if you own parts of the coins that are in here, then you also have ownership over something else.

15:47

Sjors Provoost Yeah. So for example, they might start with 10,000 satoshis and they would say every satoshi represents one gram of bullion in this specific vault, you know, at Brink's. And then if you were to buy this gold, you could basically go to whatever an exchange, you would send the right amount of Bitcoin or fiat. And then they would send you 30 satoshis. Now you'd own 30 grams of gold. And if you send those exact same 30 satoshis back, you could redeem it. But you could also send those 30 satoshis to somebody else.

16:18

Ruben Somsen Yeah, so the coins, the satoshis were colored, basically. So it's where the naming comes from, right?

16:23

Sjors Provoost Exactly. And this is very, very brittle because you need to use a special wallet that understands these coins and keeps them separate. If you... put those satoshis in a regular wallet, it doesn't understand it. It will just spend it. And your entire scheme, you just destroyed your gold. But this really existed, so it's kind of cool. 2014 or 2015.

16:42

Aaron van Wirdum Yeah, the analogy I used when I tried to explain this to people is imagine you're organizing like a small festival and you go to the bank and you get a whole bunch of pennies. You put special stickers on the pennies. And at the festival, you can use these pennies with the special stickers and they're worth a beer. Right yeah, if you walk out of the festival with the pennies then there's still worth the penny, but only a penny.

17:07

Sjors Provoost Yeah, and if you accidentally like try to give somebody a euro, you know, 100 pennies, then you're screwed, because you actually just gave them 100 beers.

17:15

Aaron van Wirdum Exactly yeah. If that person knows how to get back to the festival at least. So yeah, you're… you're giving a new meaning to the satoshis on the Bitcoin blockchain. That's what colored coins are. Yes. And then we just discussed Rare Pepe and Pepe Cash and all that. And they did something similar, but they used OP_RETURN and it works technically in a bit of a different way, right?

17:38

Sjors Provoost Yeah, very much differently. So the colored coins really just use Bitcoin's normal transaction mechanism. You just combine these satoshis and move them around. But the Rare Pepe used more like a series of instructions. So I think two things that I guess it used, right? A series of instructions where you could say, create a new asset and do something with it. But also, if the asset moved on the blockchain, I guess it would also move. I've never really studied it in enough detail to completely [unclear] this.

18:05

Ruben Somsen Yeah, I'm not entirely certain whether or not satoshis were moving and they had meaning inside of Counterparty. I thought it did, but I'm not certain.

18:13

Aaron van Wirdum I'm pretty sure that's not the case. I think they just used the data from the OP_RETURNs and that data just meant something else within the Counterparty context.

18:23

Sjors Provoost Yeah, but at least the new owner was probably done using who got the coins, like which private key received what? I'm not sure how they would do it. Yeah maybe, they would have… the transaction might have two outputs, and one output would be OP_RETURN and the other would go to some address and then I… don't know somebody… it doesn't matter because there's something new and better RGB.

18:44

Aaron van Wirdum That's what the episode is about.

18:45

Sjors Provoost That's right.

18:46

Aaron van Wirdum I think that's where we… we are now. We discussed: OP_RETURN, colored coins, the other thing, Counterparty.

18:54

Ruben Somsen Yeah.

18:55

Aaron van Wirdum And that was all to get to RGB.

18:57

Sjors Provoost That's right.

18:58

Aaron van Wirdum Sjors, what is RGB?

18:59

Sjors Provoost Do I have to explain it? I thought Ruben was going to explain it.

19:01

Aaron van Wirdum Ruben [unclear].

19:03

Ruben Somsen Okay, so... With RGB, it's a very similar system in the sense that we still have these tokens that are being generated and they're being moved on the Bitcoin blockchain. But what we're doing here is we're using the existing UTXOs as kind of a vessel for which we add the coins there and we move the coins there. So let's say I have a UTXO and I have some RGB tokens in there. Well, first I would have to generate them, but let's skip that for a second. There's an output. It's mine. There are maybe there's 10 USD Tether RGB tokens in there.

19:40

Aaron van Wirdum When you say in there, what do you mean?

19:43

Ruben Somsen Somehow, and that is of course like, so there needs to be some kind of Genesis moment, right? Where the tokens were generated. So the whole point of this system is that it allows you to create tokens and then spend them. And so first the USD Tether people would have to issue this token. And generally, the way that's done in RGB is actually you do use an OP_RETURN. So first, there's going to be a transaction. The transaction has an OP_RETURN, so everybody can kind of see it. And that transaction says, hereby, I declare that now inside of this new UTXO, there are just $1 million worth of USDTether.

20:18

Sjors Provoost Yeah, and this is actually where your, well, hash at least comes up. Because what is in the OP_RETURN, as far as I know, is a hash of a JSON file. So anybody who has the JSON file will know that the hash refers to it, and they can then read the JSON file and see what the supply is and what the rules are for whatever asset has been created.

20:40

Aaron van Wirdum A JSON file is just text, right?

20:43

Sjors Provoost It's just text, yeah, with annoying brackets and, you know.

20:46

Ruben Somsen So, okay, so now we have a UTXO with $1 million in their USD Tether dollars IOUs, and... When they first sent them to a buyer, somebody who says, okay, I'll give you $1,000, you give me $1,000 worth of these coins. So the first thing is what RGB does is client-side validation, meaning that the JSON file that Sjors just pointed out needs to be transferred during the coin transfer. So as soon as these coins, they move from one owner to the next owner, you also have to provide all the data, which refers to the hash that you put in the Bitcoin blockchain.

21:21

Aaron van Wirdum Right.

21:22

Sjors Provoost So the first person who buys the Tether, basically, has to receive an email. And inside that email should be the JSON file. And I guess also a proof that, you know, they now own the coins.

21:35

Ruben Somsen Yeah.

21:36

Aaron van Wirdum Right. So that's the big difference compared to colored coins and Counterparty is that now we have a separate layer essentially of JSON file texts that are also being sent around and they're being linked to in the Bitcoin blockchain. Is that right?

21:50

Sjors Provoost Yeah. And this also detaches the amount from the amount that's really being moved from the amount of satoshis that's being moved. Yes, you're making a transaction.

21:59

Aaron van Wirdum But I think that was already the case for Counterparty.

22:01

Sjors Provoost Yeah, for Counterparty it is, but for colored coins it wasn't. For colored coins, the satoshis really mattered. But in the case of RGB, you're just sending somebody a transaction and then along with the transaction an email with what's actually happening. And that transaction might move one satoshi or a thousand satoshis. It doesn't really matter. The instructions are separate, are not on the chain.

22:19

Ruben Somsen Right. So, okay, so we have this one output with $1 million worth of USD Tether, and now they want to send $1,000 to somebody else. So what they do is they take that output and they spend it and they send it to another output. And it's still owned by the same USD Tether people who issued the first $1 million. But inside of that output, there is going to be, basically, there is a public key there that is the person who owns the UTXO. And inside of that, there is through some cryptographic trickery that's very similar to Taproot they add another hash inside of this new UTXO and inside of this new hash There, they point to an output where they want a certain amount of these coins to move. So they would point to, in case, let's say I was buying $1,000 worth of USDTether, I would have to give an output to the USDTether people. And then when they spend their output, they will point back to me with the committed data. And they say, okay, now $1,000 are inside of Ruben's UTXO.

23:25

Aaron van Wirdum Who else can read this? Can I read this? How do I know this transfer happened?

23:30

Ruben Somsen So this is a hidden transfer in the sense that it's a commitment that's hidden inside of the public key. So it is literally... The USD Tether people need to show the commitment to me. So I can open a commitment. They can open a commitment. And I can show the commitment to you. And I can prove that I have a thousand of these USD Tether coins. And that's what I would have to do if I… let's say, I want to then send a hundred dollars to you Aaron. Then I would have to show that data. And that is the entire story of the client-side validation. The entire history of the coin in this case. The coins were created, then the coins were sent to me. I would have to show an entire history to you. And once you see the history and you're satisfied, you see like, okay, yeah, this is correct. Ruben does have 1,000 of these USD Tether coins. Only then will you accept another 100 from me.

24:19

Sjors Provoost And… and this is kind of nice because it creates a really selective privacy thing. So, yeah, Aaron, you can see that you really got the 100 because you… you get all the history you need to confirm that. So from the 1 million, you see that 1,000 was sent to Ruben and from that [unclear] was sent to you. You can see all that. But what happened to the rest of that 1 million, you cannot see. I… I guess the only thing you'll be able to see is that you know, 1 million minus 1,000 was sent somewhere else. So it wasn't like increased, but you can't see what happened after that. So you get a… you know… You can imagine history as a giant tree of transactions, but you only get everything that leads to your little branch in the universe.

25:00

Ruben Somsen Yeah.

25:00

Aaron van Wirdum Right. So this sounds like we're making, well, I'm not making anything. The RGB people are making an entirely different cryptocurrency system that's being anchored in the Bitcoin blockchain, right?

25:12

Sjors Provoost Yeah, I guess.

25:14

Aaron van Wirdum I think this already came up, but did you mention this off-chain part of it, the JSON files, are these actually sent through email? Is that actually how it works?

25:25

Sjors Provoost You can do whatever you want, but I believe there is a little do-it-yourself web server that comes with it. And if you run that do-it-yourself web server, then your special wallet... will actually know that it needs to send certain files to that web server, and it needs to fetch certain files from that web server in order to make sense of just the UTXOs. So it can all be automated, right? In essence, when you're using it, at least if the software has developed all the way to being nice, you would just say, I'm going to send 1,000 [unclear] to, you know, you have 100, Aaron, so you're going to send me 10. And you just click, you know, I give you an address, you click copy-paste the address, and you enter the number 10, you click send, and it just works. On your end, your wallet is uploading certain files to a server that has all the proofs, and on my end, it's actually fetching files from the server to see all those proofs. And in the case of something like Tether, I guess it would make sense for the Tether Corporation To… to be hosting that server because in the end they're the they… decide what happens anyway right? They're the counterparty. So you're already trusting them. So it doesn't matter that they also host some data which as far as I know they can't really decode. So it's still kind of nice from a privacy point of view right?

26:43

Ruben Somsen Yeah, but it is important that you… you save your own data right? Because when I received one thousand dollars there may be maybe you know Tether has that data as well, and I have the data. but if the Tether company then starts to stops cooperating, now I can't spend it without the data that they were holding for me. So I need to hold my own data. I need to make sure that I have my entire history. So at the very least, maybe if Tether cooperates, great, you can get the data through them. But if they don't cooperate, I need to then go and show my data to you.

27:16

Sjors Provoost Yeah, exactly. It just means your backup is more than just your 12 words or your 24 words. You need the other data too.

27:22

Ruben Somsen Right. The history is basically your coin. If you don't have the history, you don't have your coins.

27:28

Aaron van Wirdum Got it. This does sound like for every... Tether transaction, I guess that's the example we decided to run with. For every Tether transaction in this RGB system, we need a Bitcoin transaction.

27:43

Sjors Provoost Yeah, so the amounts don't have to match, and the Bitcoin itself doesn't have to go from person to person, but you do need a unique Bitcoin transaction for every Tether transaction, yes.

27:55

Ruben Somsen But it's good to point out that it only has one input and one output. So you're not, even though there's only $1,000 of the $1 million went to me, on the Bitcoin blockchain, you'll have one input, one output, both owned by USDTether. And then another output that was already mined, it was already on the blockchain. That's where the $1,000 go.

28:16

Sjors Provoost And I guess that means you could piggyback. So if you have to send money to an exchange anyway. Well, I don't think you can tweak that. Well, then at least your input isn't duplicated, but you would have two outputs, one that goes to the exchange and one that goes back to you, which actually has some meaning in the RGB protocol. Either way, you don't need a lot of data to do this.

28:38

Ruben Somsen Yeah.

28:38

Sjors Provoost Very small transactions, and maybe you can piggyback on your normal transactions.

28:42

Ruben Somsen Yeah. Yeah, you can combine it with a Bitcoin transaction that you were going to send anyway, and then also do an RGB transaction at the same time.

28:49

Sjors Provoost But there's more.

28:50

Aaron van Wirdum Can we do better?

28:51

Sjors Provoost We can do better.

28:53

Aaron van Wirdum Sure. Who's going to explain how to do this better? Ruben, sure.

28:57

Ruben Somsen I'm confused where we're going.

28:59

Sjors Provoost We're going to use a concept from Ruben's little show.

29:02

Ruben Somsen Oh?

29:02

Sjors Provoost The Lightning round.

29:04

Ruben Somsen [unclear] Lightning round.

29:05

Sjors Provoost But yeah, we can do better with Lightning. At least in the example that we just talked about, because we talked about a fungible asset. So it doesn't matter which us Tether you have it's the same we previously talked about rare Pepe where it does matter what you have so what we're going to talk about only works for the fungible stuff.

29:24

Aaron van Wirdum Yeah, every usd Tether is interchangeable. You don't care which one you have, while when it comes to trading cards you definitely care which one you have.

29:33

Sjors Provoost So that's… that's a difference. And so that means that you can start basically creating Lightning channels where the coins in the channels are these these special tokens. Though I'm a little vague on how exactly that works.

29:45

Aaron van Wirdum Well, so to be clear, that only applies to the fungible version, the Tether example we gave or the gold example we gave previously.

29:53

Sjors Provoost But the awesome thing about that, of course, is that it means that if you somehow get these Lightning channels to work with these colored tokens in it, we can start sending very small amounts of dollars back and forth Indefinitely. And only when the channel needs to be closed, we create this like Bitcoin transaction and send all the proofs that are needed just for that. So it means that the metadata you need to keep isn't isn't growing too quickly either.

30:19

Aaron van Wirdum Ruben, RGB tokens on Lightning? Do you see it happening?

30:22

Ruben Somsen Yeah, so the way I look at Lightning is that it works for every blockchain. At least as long as they support, you know, they have time lock and maybe some kind of hash lock or point locks, what are they called?

30:34

Aaron van Wirdum Very basic smart contracting tools.

30:37

Ruben Somsen So I think it doesn't really matter what blockchain, what kind of blockchain you have. I think sooner or later, especially when scaling becomes an issue, you have to start using Lightning. And RGB is kind of made… so I would say it works for every every chain. It works for every kind of system. But in this case RGB is made very specifically to start working with Lightning as soon as possible. So they're really they're trying to make it happen right from the get-go so specific to NFTs, you can have them in a Lightning channel so you know maybe like Sjors and I we can open a Lightning channel but then we can only send the NFT to each other basically.

31:15

Aaron van Wirdum So there's more like a regular payment channel then, not a Lightning.

31:19

Ruben Somsen Exactly.

31:20

Sjors Provoost So how would you have collateral of the same NFT or you would split it then?

31:25

Ruben Somsen So, well, there would be one NFT and it would be with me. And then every time we update the channel, I can then give the NFT to you and then you can give the NFT back to me and we can go back and forth. But there will never be, you cannot do the hops, right? With Lightning, the whole point is that multiple people have channels and they can kind of send from one person's channel to another person's channel. Because Alice and Bob have a channel, Bob and Carol have a channel. So then if Alice sends an NFT to Bob, Bob cannot send the same NFT to Carol because it's a different channel and the NFT doesn't exist in the other channel.

31:58

Sjors Provoost Of course, you could tokenize the NFT. So then the NFT itself would be divided in like a thousand subunits. Whoever owns the majority of the subunits is actually in charge of the NFT. But people can trade sub-NFTs.

32:12

Aaron van Wirdum You're unnecessarily complicating things now. You're just inventing a new currency based on a single NFT.

32:20

Ruben Somsen A great business proposal.

32:22

Aaron van Wirdum Let me ask a concrete question about this. Let's keep focused on the fungible RGB tokens, because these can be used in Lightning. So would that, in that case, mean that all of the hops need to actually also accept this fungible token as a fee to forward the payment?

32:41

Sjors Provoost In other words, do you need a colored Lightning network, like a completely separate network just for those colored [unclear]?

32:47

Ruben Somsen So the answer is yes and no. At the very least, you need... The incoming… like the first hop needs to have the token and the last hop needs to have the token. But then all the intermediary… hops, they don't necessarily, like you can swap while doing, while inside of a Lightning channel. So you could have, USD Tether to Bitcoin. And then another hop that remains Bitcoin. And then the final hop is Bitcoin to USD Tether again. And in that way, you could kind of lean on top of the existing Lightning network, but you would still need these in points and out points, and you would still need these swaps to take place, people to accept the swap.

33:27

Sjors Provoost Bitcoin Lightning is complicated, and you think atomic swaps are complicated. Well, you can do both and have something really complicated, but then you could indeed send US dollar values across the world. Instantly. Well, even if not everybody supports it,

33:41

Aaron van Wirdum You say you can, but then there's sort of the other problem where hops on the network can decide not to forward and see what the exchange rate does in the meantime.

33:51

Ruben Somsen Yeah, exactly.

33:52

Aaron van Wirdum Based on that, then end up forwarding or not.

33:55

Ruben Somsen Yeah, so specifically there, I think ZMN, SCP, XJ, or something along those lines.

34:01

Sjors Provoost We call him Zeman.

34:02

Ruben Somsen Zeman, yeah. Very Dutch. Zeman, yeah. Yeah, he put something on the mailing list saying you basically have the American call option problem where you can either forward the payment or you can kind of wait and see what happens so the final person who is supposed to receive the payments can either accept it or they can wait and then they can see if the price goes up or the price goes down and based on that they can decide whether or not they accept the payments. So because of that it is actually sort of like problematic to do these atomic swaps between different currencies on Lightning network currently.

34:36

Sjors Provoost Which is a problem in general right? So the idea has been around to have a Lightning network of Bitcoin that could be connected to a Lightning network ish on Ethereum yeah, and you could just instantly swap between all these currencies but there are these kind of problems there. Yeah, then…

34:50

Aaron van Wirdum One other problem I think, is that unless miners are actually going to accept these fungible tokens in order to settle transactions on the Bitcoin blockchain which sounds like a stretch, they still need to have Bitcoin in the Lightning transactions that are using RGB and you need the fees for that. Yeah, it gets very complicated very fast.

35:13

Sjors Provoost Yeah, and I'm also wondering what the incentive structure are for like accepting, you know, you have these cheat transactions and then you want to punish them and if the monetary incentives are… if the monetary incentives in Bitcoin are not correct because most of the value is actually represented by a token which has its own exchange rate. I don't know what happens. This is where it's really [unclear] on the details. Sorry about that.

35:35

Ruben Somsen Yeah, it's got to be a little difficult. But, you know, I don't think necessarily, at least the thing that Aaron was saying, you can actually have a Lightning channel for Bitcoin, which I would assume, you know, even if you were an RGB user and you wanted to use it on Lightning, you would also want to use Bitcoin on Lightning. That seems like a safe assumption. So you could use the same UTXO for that. So you could have a channel that you're using to send bitcoins back and forth. And then you can also put RGB tokens inside of it and do the same thing at the same time with a single channel.

36:05

Sjors Provoost But then it'd be kind of like a collateral. But then how do you make sure that, you know, I don't end up with just five satoshis in the channel. So I have every incentive to cheat, but there's this huge value of colored coins in it.

36:18

Ruben Somsen Yeah.

36:18

Sjors Provoost So somehow you do need to compare the real value that's at stake in Bitcoin versus this tokenized value. So I think this gets pretty complicated. I don't know if we want to.

36:26

Ruben Somsen Yeah. Yeah. I'm not sure about that.

36:27

Aaron van Wirdum Too many worms for now. Let's move on to more worms.

36:33

Ruben Somsen Delicious.

36:33

Aaron van Wirdum There were more problems, I think.

36:35

Sjors Provoost I think Ruben had one final problem.

36:37

Ruben Somsen Yeah.

36:37

Sjors Provoost That's about it.

36:38

Ruben Somsen Yeah. What we were saying earlier about to USD Tether.

36:42

Aaron van Wirdum To be clear, we're not talking about Lightning anymore. We're just talking about RGB. We're back to basic RGB.

36:48

Ruben Somsen We're back to basic RGB.

36:49

Aaron van Wirdum And there's a problem with it.

36:50

Ruben Somsen So even for the Lightning network, right? Like you still need to use the base layer. And that's something that people shouldn't forget. You can't just be saying like, okay, well, because we can go on Lightning, it doesn't really matter how expensive the base layer is. You always need to have these base layer transactions first. Lots of people need to have USD Tether. Then they have to create channels with USD Tether. And then you can start using the Lightning Network. And even then, channels have to close and reopen and rebalance, et cetera. So you're still using the base layer. Okay, so the issue or the first issue would be simply if the token moved many times, you have to show the entire history to the person you are sending your coins to. So at some point, maybe first it's like one megabyte, two megabytes, three megabytes. Okay, fine. But after a while, it becomes hundreds of megabytes or maybe even a gigabyte. What's worse is that...

37:39

Sjors Provoost Because we did talk about how you only have to share the relevant part, so I only need to see how my money originated from the source, but I don't have to see the entire tree. That saves a whole bunch of data. But even then, if the money is passed around 100,000 times, I need all those 100,000 transactions to see where it's coming from.

38:00

Ruben Somsen Yeah, the data does keep growing regardless. And there is sort of an intermediate solution to that depending on what kind of token you have, you could give back the USD Tether to the USD Tether company and then they could reissue a new token with a history that's completely clean again. But that works only in the example of USD Tether where there's sort of an IOU system. If you have some… yeah, I'm not sure what kind of token this would be, but if there's some kind of token that is issued once and then never issued again then you can't do that. But problem is that the history of the tokens actually becomes intertwined. So if I have one USD… USDT, and let's say Sjors has one USDT and we both send these to to you Aaron then the the history of of both these coins becomes connected. So the proof for your $2 is both our histories. Now, after that, if you want to split them up again, and now you send $1 to one of your friends and $1 to another one of your friends. The history doesn't become unconnected again. The history stays connected. So each of them has to check the history of both Sjors coin and my coin. So this is basically another way of saying this would be if you have a Bitcoin on the Bitcoin blockchain, you can't actually go back and figure out exactly inside of which Bitcoin block that Bitcoin originated because the history is connected. And so because of that, what you end up with is you might have to download a significant chunk of everybody's history instead of these paths that in the ideal case.

39:42

Sjors Provoost So I guess you're saying is the spaghetti strain gets longer and longer. And you get more and more spaghetti strains as money is being combined. So you end up with a ton of spaghetti, which is cool for an Italian project. I think that's all we got, right?

39:57

Ruben Somsen That's right.

39:58

Aaron van Wirdum Well, I want to ask you guys, do we want this on Bitcoin? Because it sounds like...

40:02

Sjors Provoost We don't have a choice.

40:03

Aaron van Wirdum It's just a whole bunch of data.

40:06

Sjors Provoost Well, it's mostly data that exists outside of Bitcoin that we don't care about.

40:10

Aaron van Wirdum Yeah, well, it still requires transactions on the blockchain at least.

40:13

Sjors Provoost Yeah, but who can stop that? Because they look like regular transactions, so it doesn't matter what we want. We can't stop it.

40:20

Ruben Somsen Yeah, so it's kind of like if we could maybe, let's say if you had the option to very easily add native tokens to Bitcoin where you could issue assets and you could just use them on the Bitcoin blockchain. If you did something like that... In terms of blockchain usage, it will be very similar, right? Because with RGB, you have kind of the same thing where every time you move a token, you do need to create a Bitcoin transaction. But that Bitcoin transaction doesn't really have anything to do with Bitcoin other than that it wants to kind of connect to it to be connected to its proof of work. So would we want that? Would we want people to just issue any token they want just natively on Bitcoin? And then most people would kind of say no. So RGB kind of forces that, the issue basically, and says like, well, you can just do it if you do it like this. So do we want that? Do we not want that? I don't think it's going to be terrible. I think it's going to be okay. And, you know, I don't think there's going to be some kind of token that is so popular that it will pull away most of the proof of work or something along those lines that would be kind of, you know, the doomsday scenario.

41:21

Sjors Provoost Yeah, the risk there is, we talked about that in other episodes about sidechains as well. If there is, say, the entire world's supply of gold is expressed as an RGB token, that's a problem because the market cap of gold is, you know, 10 times that of Bitcoin at the moment.

41:37

Ruben Somsen Right.

41:37

Sjors Provoost Which means that somebody who wants to steal gold through a double-spend attack, you know, might want to do that. And from a Bitcoin point of view, that attack would look uneconomical, but from a gold point of view it would look economical. And therefore it just messes with the incentive structure that we have. Yeah, but we're not there yet, and I'm not really worried about it.

41:55

Ruben Somsen Yeah exactly. I'm actually, I think the opposite problem is more likely where Bitcoin, the fees are going to go up. And at that point you have to… if you want to use USD Tether you have to pay the Bitcoin fees to use your USD Tether and then you have to ask well, If I can use my USD Tether on any chain, why would I use it on the expensive Bitcoin blockchain? So I think that kind of becomes the bottleneck for RGB, where any token you want to move on RGB, at least without using Lightning, and as I pointed out earlier, at the very least you will have to use the base layer every now and then, will have to pay as high of a fee as Bitcoin transaction. And whether or not that's going to be economical, I don't know.

42:35

Sjors Provoost Yeah, exactly. And I don't know, if you're doing client-side validation anyway, maybe you just want to use a database, but...

42:43

Ruben Somsen Perhaps, yeah. And yeah, so specific, you know, the space chains, yeah, it wasn't called space chains back then, but the episode we did on the perpetual one-way peg and blind merged mining, it is actually a very similar system, right? So you could compare the two, but the difference is that… you are less connected to the proof of work right? Instead of having one… every every RGB transaction you make you need to make a Bitcoin transaction, you now have one Bitcoin transaction, that represents an entire block of of tokens basically. So that would at least make it cheaper to do tokens, but at the same time, you're also I guess less secure, because you don't have the the full proof of work kind of… it's not directly connected. It's a little bit more indirect. Okay.

43:31

Aaron van Wirdum Okay. Wait, Sjors, I have one last question. Did you want to get into the Proof Marshal thing or are we going to leave that for a different episode?

43:38

Sjors Provoost Exactly. We have another can of worms that's called Proof Marshals. We are not going to open that.

43:42

Aaron van Wirdum Okay. Do you want to end on a positive note?

43:45

Sjors Provoost I want to end on saying thank you, everybody, for listening to the Van Wirdum Sjorsnado.

43:50

Aaron van Wirdum There you go.

43:51

Ruben Somsen There you go.