0:00 Hi everyone, I just wanted to show off our new Zcash sidechain. 0:08 So, this software is primarily for Linux, but if you're running Windows, you can use a free piece of software, VirtualBox. 0:16 I think Mac users have better experience with a different piece of software, but its name escapes me right now. 0:23 But once you have this thing, you can make little computers within computers, and you can put Linux on there. 0:28 This is Ubuntu, that's a version of Linux. All this is free software, so it's kind of a neat trick. 0:35 Once you get all that set up, you want to open up your Linux operating system, and I have that here. 0:42 And then you want to go to the internet and download, this is the drivechain.info releases page, this little trophy. 0:51 Here's where we host all the software files. 0:54 You need to get the mainchain, and you need to get zside if you want to use it. 1:00 We will put the latest version up here when it's ready, and I've downloaded them all. 1:05 When you get them all, they'll be in these tar.gz files, that you'll have to open and then extract. 1:14 They're compressed to save space, but you're going to uncompress them into these folders. 1:19 Now we're just going to run them all and take a look at them. 1:22 To do that, you go into this bin folder for binary files, and you open a terminal window. 1:28 The Qt is the graphical user interface, so this is the one that you want with a Q. 1:38 This is what it looks like when the blockchain is blank. 1:44 We want to run it in something called write-test mode, so that we're all on our own and we can just generate blocks as much as we want. 1:52 We'll be God over there. 1:54 This is the first piece of software. It looks just like Bitcoin Core, except it has the sidechains tab. 2:00 There's no sidechains here yet. 2:02 We're going to add them now. 2:04 Now we go into this second folder for the testchain. 2:08 We're going to give this a run. 2:10 Then we're going to do the same thing with the last piece of software, which is zside, which is what we really want to look at today. 2:30 This is all three softwares with no blocks and a brand new version of the blockchain. 2:37 I'm going to move all this stuff so that we can take a better look at it soon. 2:58 Now we have three pieces of software. This is the mainchain. 3:01 This would be Bitcoin Core 16.99 with BIP300/301 activated on it. 3:10 We're in write-test mode for all three. 3:12 This is the testchain. It's basically just a blank sidechain that does nothing, but it can send and receive coins. 3:19 This is zside. It has cool Zcash technology in it and a cool little user interface that we built for that, which I think you're going to enjoy seeing. 3:34 The first thing we have to do is, since sidechains are layer 2s, we have to link them all up to our full node, which is this guy. 3:42 This is the full node. 3:44 There's actually a little trick for this. 3:49 We have this little thing here. 3:56 You have to restart, though. That's the only hitch. You have to close these pieces of software down and restart them, which is a little annoying. 4:07 Other than that, it's just clicking a button, which is pretty convenient. 4:11 We use a command line to get them all back. We're on the same command as we did before. 4:18 Now they're all going to be connected. If you go to the parent chain tab, you see that it's now connected to the mainchain. 4:27 Now, since we're in write-test mode, we're going to be conjuring some blocks out of thin air. 4:34 On the debug window on the console, you can just make some blocks if you like. 4:42 You can make as many as you like. Now we have coins. 4:44 In particular, we're going to need to activate these sidechains, so we need some information in order to do that. 4:56 The sidechain parameters. 4:58 Sidechain 0 is the test chain. 5:03 We're going to add it. 5:05 Create sidechain proposal. 5:17 We will now click this button. 5:21 We'll just do them one at a time, just so you can see them come to life. 5:40 Generate another 20 blocks. Now it exists. 5:45 Generate another 20 blocks. Now it exists. 5:52 Now we will do zside. 6:14 This is sidechain number 1. The sidechain has to know what number it is. 6:18 Right now, you can only add them in order. 6:31 It's much easier to add a sidechain in this test than it would normally be. 6:36 We just shortened it for ease of testing and demonstration to 64 blocks, which is obviously a very short amount of time. 6:45 Anyway, now they exist. 6:47 We will go to zside, parent chain, transfer. 6:51 Here's all these ways of interacting with the sidechain. 6:55 What we want to do now is transfer coins over. 6:58 We're going to deposit to the sidechain. 7:00 It gives us an address here. 7:02 We can just copy it over and put it over here. 7:05 Thanks to all these blocks I've been finding, I have all these coins. 7:12 Let's just send 1,000 over. 7:16 This thing will complain about the fee if it's set wrong because it's poorly designed by whoever made it. 7:22 It wasn't me. 7:25 You have to type in some fee there. 7:27 It can't be too high or too low. 7:30 The other thing you need to do is, in order to find blocks, you have to enable Blind Merged Mining. 7:36 You have to go to BMM, Blind Merged Mining, and click Start. 7:43 You can also do it manually, but I don't recommend that because it's pretty confusing. 7:47 We're going to mine blocks on the test chain as well. 7:49 Why not? 7:51 Oh, that's what I said not to do. 7:53 Okay. 7:55 Now we have... 7:57 The blocks are being... 7:59 It's going to try to find blocks in concert with the mainchain. 8:03 Now we're going to generate... 8:05 It's going to generate one block at a time. 8:10 As you can see, we find a block here. 8:13 We have a little thing here that you may be able to see. 8:15 237 blocks. 8:17 Now we have one block on Z side. 8:20 And we also have one block on the test chain. 8:26 So... 8:28 The deposit can't go through until there's some confirmations on... 8:33 At least one confirmation on both pieces of software. 8:38 So, that was two blocks. 8:40 And now it's over here as immature. 8:42 We're going to keep finding blocks, block by block, until the coins become available on... 8:48 Z side, which they now are. 8:50 So now we have our coins on Z side. 8:52 And the coins are in a T address. 8:56 Over here. 8:58 That we can see. 9:00 And we can see that it has two confirmations in this address. 9:04 And if you want to shield these... 9:06 You can use this Zcash tab to click shield. 9:10 And shield a certain amount. 9:12 So let's say you want to shield 40 coins. 9:15 You click this button. 9:18 And then it does some calculations. 9:21 You know. 9:23 In the background. 9:25 But it's going to need more blocks to show up. 9:29 On the right. 9:31 Which is where it belongs. 9:33 Now that it's a Z address. 9:35 So you can see it went down to 659. 9:37 The 40 coins are gone. 9:39 But three blocks and then... 9:41 Let's see, still three blocks. 9:45 Let's see if we can get some... 9:48 Five blocks. 9:50 Here we go. 9:52 And now you see 40. 9:54 Minus the fee. 9:56 As you may have noticed. 9:58 This amount will be... 10:00 There's a fixed shielding fee. 10:02 In the world of Zcash. 10:04 So let's do another example maybe. 10:06 We'll do like 100. 10:08 And we'll add the fee in. 10:10 Put the fee in here. 10:12 So that it comes out to a nice beautiful number. 10:16 So we'll do that. 10:18 And then we'll get more blocks on everything. 10:20 When I do generate on the main chain. 10:22 It's finding blocks on all the networks at once. 10:24 You see even the test chain is going up to five. 10:26 It's finding these blocks over here. 10:28 Of course nothing has been deposited here. 10:30 So there's no coins in the test chain. 10:32 The parent chain on there knows. 10:34 That there's a thousand coins. 10:36 Here. 10:38 So let's... 10:40 Remember those calculations took a while. 10:42 Oh this is funny. 10:45 We've mined over here. 10:47 We've mined the fee that it took to shield this. 10:49 So we shielded this. 10:51 And we also mined that. 10:53 It showed up here as a... 10:55 I forgot that that happened. 10:57 So we should get another one. 10:59 If we just keep mining. 11:01 Keeps track of the confirmations. 11:03 This is a change now. 11:05 So it has less. 11:07 So now we had our round number of 100 show up. 11:09 And we should get another shielding fee. 11:11 Should we not? 11:13 So... 11:15 Now we have some transparent coins and some shielded coins. 11:17 And... 11:19 We can... 11:21 You know, send them around. 11:23 Or... 11:25 To another Z address and they'll be totally private. 11:27 Or we can deshield them. 11:29 So let's take... 11:31 100 and we're going to say... 11:33 Well we want... 11:35 14 and then back. 11:37 And we'll add the fee back in. 11:40 Actually, I don't know what... 11:42 I don't really remember where the fee will come out. 11:44 So we'll see what happens with that. 11:46 But it will come out to a new T address for us. 11:48 When it does these operations, 11:50 you can click this button 11:52 and look at the history of what happened. 11:54 Because it's kind of actually confusing 11:56 without this button, so we added it. 11:58 To figure out what's going on. 12:00 Now we need some more blocks. 12:02 And we deshield. 12:04 So we're just going to find more blocks. 12:06 You can see how the number of confirmations keeps going up. 12:08 Keeps driving up the confirmations. 12:10 Coins have. 12:16 Great. 12:18 Almost. 12:20 There. 12:28 Oh, we saw that vanish from that. 12:30 Now we have... 12:32 Success, success, success. 12:38 Our 100 output is gone. 12:40 Will it give us a new... 12:44 There it is. 12:46 85.9999. 12:48 And 14. 12:50 Oh wait, that's the shielding. 12:52 Oh, there it is. 12:54 14, 859, and then three of these. 12:56 Okay, now. 12:58 This is important. 13:00 Because most of the people who use 13:02 Zcash 13:04 actually screw up 13:07 and leak all the privacy 13:09 that normally would have been added. 13:11 So we've reduced... 13:13 To stop the user from screwing it up 13:15 we've reduced it to two steps called Melt and Cast. 13:17 Now all you have to do is click Melt 13:19 and it will shield 13:21 all of your coins. 13:23 And then you just click this button 13:25 and then just wait. 13:27 It won't... That's a good point. 13:29 It won't shield these because 13:31 it's so small that it can't pay the shielding fee. 13:33 But it will melt all of your other coins. 13:37 And then they'll show up over here 13:39 this Available to Cast area. 13:41 So let's mine some blocks again. 13:45 And we'll just wait for them to show up. 13:47 And remember it should be like 1,000, right? 13:49 It was 1,000 coins. 13:51 So okay, there they go. 13:53 They've showed up. 13:55 999994. 13:57 Now what this is going to do is 13:59 when you click Cast 14:02 it's going to show the largest bills 14:04 that are all powers of two. 14:06 And it's going to remove them all 14:08 on a given day. 14:10 So these are fixed amounts. 14:12 1, 2, 4, 8, 16, 32, 64, 128. 14:14 And as you can see 14:16 there's Saturday through Sunday 14:18 and it's repeated again Saturday through Sunday. 14:20 So what's going to happen is 14:22 on this given day 14:24 there's just going to be a lot of people 14:26 de-shielding the coins 14:28 that all have the exact same amount. 14:30 A lot of people on Tuesday 14:32 de-shielding 0.33554432 14:36 in Bitcoin or whatever. 14:40 It will then be impossible 14:42 to determine 14:44 whose shielding 14:46 operations are associated 14:48 with whose de-shielding operations. 14:52 So I just click this button 14:54 and it will then 14:56 extract 14:59 all these coins. 15:01 So you start with 999 15:03 and it's going to get D987. 15:05 So if we get most of them 15:07 sometimes it's luckier than other times. 15:11 That's just a function of 15:13 how close your 15:15 balance amount is 15:17 to some sum of 15:19 four powers of two. 15:21 So now that it's scheduled these four casts 15:23 you can always cancel them of course. 15:25 Now what happens when you 15:27 end up de-shielding the coins? 15:33 This has it queued up 15:35 but it won't 15:37 do it for a while 15:39 so let's 15:41 just manually de-shield some coins 15:43 so that we have more 15:45 so that we can withdraw a good amount. 15:47 Let's take this and just de-shield 500. 15:49 This is again not how you should 15:51 de-shield but if you are determined 15:54 to do so 15:56 then you can do it anyway. 16:02 Now I'm going to find 16:04 two more blocks 16:06 blah blah blah 16:16 Oh yeah it takes a while to do those calculations 16:18 to de-shield the 16:20 coin. 16:22 Here it is. 16:24 Shields and now we have 500 16:26 coins basically over here 16:28 in the transparent world. 16:30 So we want to take those coins back 16:32 from Z-side 16:34 back to the main chain 16:36 and go back to transfer without a withdraw. 16:40 And we have 16:42 504 in the 16:44 transparent balance 16:46 so 16:48 let's withdraw 16:51 Oh whoops 16:53 400 of that. I'll put that here where it belongs. 16:57 And then main chain fee 16:59 it's important to pay a good main chain fee. 17:01 Let's make it 90 17:03 and then the sidechain 17:05 transaction fee can be pretty small. 17:07 I'll just make that some random number. 17:09 Then we have the total costs. 17:11 Now we need a main chain 17:13 Bitcoin address which 17:15 we will get by going over here 17:17 receive, click new a bunch 17:19 of times. We'll copy it. 17:21 We'll copy it over. 17:23 Then we click 17:25 withdraw. 17:27 And then it says that this amount it doesn't like 17:29 is prejudicial 17:31 against this fee amount. 17:33 Okay there we go. 17:35 This fee estimation 17:37 stuff sometimes. 17:39 Okay so it's done 17:41 that and you see the balance 17:43 went down to 99. 17:45 We now need to explore 17:48 Go to the withdrawal explorer to see 17:50 these withdrawals show up. 17:52 So we're going to mine some more blocks. 17:58 Okay here it is. 18:00 It's programmed 18:02 to wait to make the first one 18:04 for there to be 10. 18:06 So I'm just going to click this 18:08 I'm going to make this really small and I'm going to click it 10 times. 18:10 Since we have 99 coins. 18:12 And we'll use 18:14 a new address why not. 18:16 Another burner. 18:18 Just click this. 18:20 1 18:22 2 18:24 And in practice there would be months 18:26 between these so they would be accumulating. 18:28 It's just this first one that's a little quirky. 18:30 10 but we'll now check. 18:32 So now we'll mine some blocks 18:34 and this should all show up. 18:40 28 blocks 18:42 29 blocks 18:45 And now we have more than 10 18:47 Do we? I think so. 18:49 So it should construct this 18:51 WT Prime thing here. 18:53 It says none yet. 18:55 Waiting for withdrawals. 18:57 Very accurate. 18:59 Okay now it's made this thing. 19:01 This thing is 19:05 these rare Drivechain withdrawals. 19:07 Now for testing 19:09 we've made it short 19:11 but it normally would take 19:13 So here we have this 19:15 we're back on our main chain screen 19:17 you go Z side 19:19 and then the deposit 19:21 screen you can click this other tab 19:23 it says see withdrawals 19:25 and it will show you any withdrawals 19:27 that are trying to get through 19:29 and this one hasn't shown up yet because it was just made. 19:33 But these pieces of software 19:35 will be talking to each other. 19:43 And you see here it is. 19:45 And we've programmed it to expire after 19:47 300 blocks and only need 140 blocks 19:49 for testing and normally 19:51 again it would be 6 months 19:53 it would be 26,000 19:55 blocks and change 19:57 and this would be 13,150 19:59 it would be a huge number. 20:01 But you can see that this 20:05 thing here has to match this thing 20:07 this is the Drivechain security model 20:09 does this and this match 20:12 can we do anything about it in 3 months 20:16 we have to click this gear 20:18 since we're mining blocks over here 20:20 we get to drive this around 20:22 normally most users would not 20:24 so we're going to set this to upvote 20:28 and then we're going to mine a bunch of blocks 20:30 we're going to mine 1 20:32 you'll see it goes up from 1 out of 140 to 2 20:34 and it goes up to 3 20:36 and now we're going to type in a huge number 20:38 like 100 20:42 and it will go up by 100 20:44 and now how many do we need 20:50 and now 20:52 we'll have let it go through 20:54 so it's gone through and now we can see 20:56 those coins somewhere 20:58 if we look at the 21:00 let's see if we can get this 21:02 open here 21:04 enable coin control features 21:06 okay 21:08 so now you can see 21:10 the 21:12 these 50's are all the coins 21:14 that I mined 21:16 let's see the confirmations 21:18 I don't know why they say 25 at all 21:20 oh I know what that is 21:22 that's because of Blind Merged Mining 21:24 is spending them and making all these change outputs 21:26 so sorry about that 21:28 it's confusing 21:30 but at the end you can see 21:32 that here are all these 21:34 three confirmations exactly 21:36 here's the 400 of what I sent 21:38 before 21:40 n2 by whatever 21:42 that's this thing over here 21:44 and all these n1g 21:46 ka1 21:48 those are all these other ones 21:50 so you can see that I got the coins back over 21:52 so that was the demo 21:54 I hope you liked it