 Great, so thank you for coming to this session. Hopefully it will be interesting. We have 30 minutes. I'll try to speak for maybe 25 minutes or so and leave at least five minutes for questions. And today we'll be talking about Hyperledger Yidroha v2. Some of you may not be familiar with Hyperledger Yidroha v1, so I'll give a brief overview as well. And as an introduction, I'm Makoto Takamiya. I'm the group CEO and co-founder of Sormitsu. So today I'll talk a little bit about... I'll say a few words about Hyperledger Yidroha v1 and then I'll talk about Hyperledger Yidroha v2, some of the overview, where the code is located, how it's structured, how would you set up the network, what are Yidroha's special instructions, and different things like this. So that way you can learn some of the basics of the network and some of the philosophy, and then figure out maybe how you can use this in your own applications. So for those who don't know, I'll just say for a couple of seconds about my company, Sormitsu, who we were founded in 2016, we actually joined Hyperledger project in 2016 as well. And we contributed Hyperledger Yidroha along with several other companies, like Entity Data and P-Touch and Coldiv, back in 2016. And we've been working as an active maintainer for the project since then. We use it in many of our applications, including our work with the Central Bank of Cambodia on a really exciting project called Backhaul. Another session that I think Brian was a chair of that talked about CPDCs, and if you didn't watch it, I encourage you to find the video and maybe see it. It's very interesting. But that project uses Hyperledger Yidroha V1. We've done many other projects as well over the years. For those who don't know, so we focus a lot in Hyperledger Yidroha on mobile interfaces and being able to connect to applications that people build in the mobile context. So Project Backhaul, which we built with the Central Bank of Cambodia, is actually the world's first retail payment system run by the Central Bank of Cambodia, that launched with real money back in 2019. And it's quite the exciting system that uses Hyperledger Yidroha at the core of the system. But today I'll be talking about Yidroha V2. Actually, this system actually won some rewards. So before I talk a little bit about Yidroha V2, I think it's important to understand some of the philosophy of what the original context or vision of Yidroha was, and really it was to create something that's kind of a simple blockchain that doesn't try to do too much, that really focuses on high performance and low latency and focusing on mobile interfaces in particular. So building libraries and different SDKs that can help with mobile apps has been a very big push. And then also Yidroha tries to be blockchain. So it means that more in like a traditional context. So instead of trying to be like a glorified database system or trying to do too many different things at once, it really is kind of like a traditional blockchain where you have a set of validators and all the validators don't trust each other. They get the data and they verify it all. So this means that they see all the same data and they verify it and that has implications for the types of contexts or applications that you can use Yidroha in. And so in Yidroha version one, we also tried to focus on limiting the scope of the blockchain platform so that you couldn't really do too many things like you couldn't do during complete user-defined smart contracts that would be defined at runtime. Instead, if you wanted to have new functionality, you would have to write this code in the original C++. So Yidroha one was in C++ and this was done really because we do focus a lot on financial applications and a lot of users, for example, central banks don't really want to have too much flexibility. In fact, having less flexibility in what you can do actually reduces the attack space. But it has trade-offs in that doing new things is more costly or takes developer resources. In Yidroha two, we're trying to improve on some lessons that were learned. Yidroha two is written in Rust, which is kind of a more and more... it's a language that's getting more and more popular over time. If you haven't used it, it's really a lot of fun. The learning curve is somewhat steep, but so is C++. I've written code in many languages, including C++ and Rust. What I like about Rust is that it's a little bit less flexible so the compiler is very strict about what you can do. This actually forces you to design things in a more standardized way. So it's actually easier... I would say it's easier to work in an open source or open context because there's not as many degrees of developer freedom in some ways because the language kind of forces you to do certain styles. So this makes it easier to work with other people's code. You don't have a lot of problems like you would have in C++ where C++ has a big range and if you're a very highly skilled C++ developer or kind of a novice, the quality of the code is very different. Rust kind of forces everyone to be close to the same level. Rust, also, the compiler is able to optimize code pretty well because it's a very strict compiler. So it's in many contexts it's easier to get faster running code than Rust and C++ if you're a novice to C++ like I am, for instance. It's also very opinionated about how data processing is and data handling is done. So we keep all data in memory and of course this doesn't mean that you lose data when the system crashes or something. All blocks and the blocks are kind of like the atomic unit of state change in the system. All blocks are updated atomically on the disk when they come in along with the in-memory data storage. So in-memory data storage, we have an in-memory block store and then also in-memory world state view that has different accounts like state data. So for example, how many assets a student account has. So all these data are kept in memory which makes validation of transactions extremely fast. We don't even use like an in-memory database. We use kind of Rust level maps or hash maps so it makes it really, really, really fast so you don't have any overhead. And this was done partly because in Ederhof V1 we did see a lot of the bottlenecks related to data processing. And V1 is actually still under active maintenance. It has a community around it. People are contributing code. Currently it's being upgraded to use a key value database and that's a lot faster than PostgreSQL which it was using before. But I would say V2 takes this to a whole other level by keeping all the data in memory and it makes it really, really exceptionally fast. We're also trying to give people more flexibility so being able to support turn complete computation that's user defined at runtime basically. So being able to define your own smart contracts while the system is running is really an important design goal that we have. Initially this is based around what we call Ederhof Special Instructions and I'll introduce these. These are not currently turn complete but in the future we're reviewing several proposals with the community and one of them is to include a WASM VM and then that way people can compile really any language that they like to WASM and then run their smart contracts that are user defined when the system is running. There's advantages and disadvantages to this of course. It makes compilation a little bit harder because the version of Rust we support has to be more specific. Currently, hopefully someday there will be better language support please. So Ederhof V2 has been in debt for a little bit more than a year, like maybe 15 months and it's still not at the first stable release but it's come pretty far and the network actually should be running stably and you're able to use the current Ederhof Special Instructions that I'll show off in today's presentation. Kind of as one of the introductions Ederhof V2 uses as did Ederhof V1 kind of a very simple data model and yeah, so I can type on this slide so instead of saying commands it should say instructions and maybe tell us how it's done. So domain is like a grouping of asset definitions and of accounts and an asset definition is just a name and then has maybe some other metadata for example what type of asset it is is it like a key value map, like a complex asset or is it like a currency that has a quantity. So you can define these and I'll show you how using Ederhof Special Instructions and then you have accounts and accounts are some data that has a set of signatories and the signatory is just a public key basically so you can have one or more public keys and you can have a quorum defining how the public keys are used to sign fund sections and accounts can also have assets and our assets are instantiations of the asset definition so you could have like an asset definition for US dollar and then your account has a hundred assets which are instances of a US dollar definition. So this is a very simple data model it easily incorporates basically any use case you would want because an asset definition is really like an object and so if you interpret it like a currency or something else it's really up to the business logic that you have you can deal with many different types of situations. Okay, so it helps structure so let's say that I wanted to help kind of join the community and maybe you guys can you can first go to hyperledger.com on github so github.com hyperledger.com as P2 is still under active dev and there's no staple release yet currently the main branch is Ederhof version 1 and then if you want to go to version 2 you have to go to Ederhof 2 or Ederhof Dev Ederhof 2 is updated occasionally but yeah we don't have a really well-defined release cycle for yet so you can probably at this stage use Ederhof 2.dev branch and this should always be compiling and running because we have a lot of github actions we run tests upon pull request and we don't really we try to keep it fairly stable so that there's no you shouldn't have a situation where you try to run Ederhof 2.dev and it doesn't start up or something but if you want to use in production you should be a little bit careful because it is still under active development but it's fine for playing around with even today and the code is reasonably high quality and shouldn't have any known major defects other than lack of functionality implemented so the implemented functionality should be working pretty well it's kind of organized into seven different crates that are compiled so for example we've got Ederhof crypto, we've got Ederhof and CLI different things like this so it should be pretty easy to kind of understand how this and you can build these kind of separately if you want to for cryptography we use Hyperledger Ursa I mean obviously writing your own cryptos is a bad idea so we don't use Ursa so you can check this out and play around with the dependencies if you want okay so yeah that's kind of some of the overview of GitHub let's move on let's say I want to play around with this and try to check it out like what can I do today so you can set up your own Ederhof V2 network I gave a demo this morning about it I'm not going to go into that level of detail now but I will just say you would build the client crypto CLI this should be a crypto you build the Ederhof crypto CLI and use this program to generate your own keys so if you run the script it gives you an ed25519 private and public key pair and then you can take these these these each server that you want to run like let's say if you want to have four different servers you have a config file in each server and then you plug in your private key and the public key here and this you don't have to use ed25519 I think we support maybe some other photography that's in Ursa but yeah it's recommended not to play around with this too much if you don't know what you're doing I mean you can read some of the explanation in the github but basically if you want to set up your own node you would get this config file from github just setting up port that you run for the ptp traffic this is between nodes on the network and then api which is the external query nodes and then you do need to define a genesis block and you need to have like a public and private key associated with this so that the data are so this is the genesis block then validated so you have just a simple json format that you can define your genesis block in just a list of transactions I think you don't even have to have anything but that would be a boring network without any user accounts so like in this example here you just have like iSize which are the interhouse special instructions which I'll talk about and then you can register you register first a new domain called wonderland and then you register a new account called alice and then you can register a new asset called a rose that's inside wonderland and it has a type of quantity which means you can have a quantity of roses you can have different value types as well and let's see and then you can have your user alice in wonderland and you give alice a rose you actually give 13 roses because this is mint commands you're minting alice assets into alice at wonderland's account pretty straight forward this is just a genesis block so this kind of defines the first account that maybe has some assets permissions and then you can kind of do everything around that genesis and then finally the third thing that you need to start up is a trusted peers file and this just has the initial peers that you have you can add new peers and remove peers from the network using either hospital instructions during runtime but you need at least a quorum of peers to start out with and the number of peers you need is actually so the consensus algorithm is called sumeragi and in sumeragi there's a max fault peers parameter if you run it locally with just one peer on your own system you would just make this zero if you want four peers you make this one so you have a 3F plus one fault tolerance of F so if you want to tolerate one fault you need 3F three times one plus one so four nodes so that's how you set up a network you just make config.json file genesis.json and trustedpeers.json and you do this for each of your peers and actually this morning in the demo a network and it's still running locally it hasn't crashed or anything one thing I'll just point out is idoh2 doesn't create blocks just for the fun of it you have to have transactions in your block so that's why it's not creating a bunch of blocks but if I go to my command line and if I run a command like let's create a new domain called block and you can see that we now have a new block height at nine because it just generated a new block that contains my register transaction the settings are here in the config.json so here it's one second per block so if you get a bunch of transactions being sent every second they're going to be grouped together in the block and now I have nine blocks and you can see these blocks the blocks themselves are not so interesting to look at for humans we use a parody scale codec to store blocks as I recall which is a very efficient binary format used in Hope.tap ok so let's go back and talk a little bit about idoh2 special instructions idoh2 special instructions are kind of yeah, a list of different kind of building blocks that you can kind of piece together to do lots of things and you might have seen some of this in my explanation just now of the genesis block for instance so to make a to make a let's take a look to make a register domain there's like the register instruction that is just register you can call register on different objects you can call it on a domain to register a domain you can call it on a new account register an account you can even call it on an asset definition to register a new asset definition so it's kind of like yeah, you have this kind of like the command or instruction called register and you've got under register which does the other thing if you want to add a new peer to your network I think you call register but remove the peer to create a new asset you've minted and you can burn the asset to kind of get rid of it you can transfer the asset there's some conditional logic in using if if clauses this this should work for really cool use cases like for example conditional multi-sig where if you want to to define like some signatories on an account you'll be able in the future to to like set up an account so that if you're sending more than 1000 of an asset you'll have to have three signatories and if you send less than 1000 you'll have two different rules like this that you'll be able to define just by piecing these different things together so that's kind of the idea to kind of create this like basic something like a domain specific language that you can kind of piece together right now it's not turn complete actually you can make it turn complete by implementing triggers on top of these that would be kind of like event-based functional programming which we which we're exploring but it takes a little bit of research if you're interested in this topic I'm very happy to you know to have any more collaborate okay so how would we use some of these ISIs so that you don't have special instructions so for example you can play around with our EdoHa client CLI which is command line tool in the future this will be probably deprecated with a nice Python library but it's still under work for now if you wanted to register like an account you can go to your command line and register an account you have to give it at least one key to be like you know to do the transaction notification so I just created a domain called night talk because it's night time where I am so you can hit this and let's see I see what's wrong so in Keynote it kind of takes my double dash line and turns it into one line which is not cool you have to do two dashes I created my new I registered an account and then the payload is not very fun to look at but you can see the different byte values this should probably be simplified a little bit but hey it works and then I can create a new asset if I wanted to so like this would be kind of like the equivalent of an Ethereum so just like a simple asset here a piece of stuff in line so this is a type quantity meaning it's like some kind of token let's put it in our byte talk domain and I don't know is there a cool name for this I'll call it nhd for night night token there's like so we just created a new token actually you can see all the assets by calling list assets so yeah sorry asset list all so you can run this and you can see we've got which was made this morning we've got some roses and we've got where did it go maybe I'm missing something here where did it go here nhd it's because I didn't mint any instances of the asset so I'm just looking at the definitions so we need to mint some quantity so we can just go over here and I think quantity has to have again double dashes otherwise it will fail the asset would be nhd at night token and I'm almost done almost out of time I gave it to makoto Iroha world let's give it to makoto at night talk let's mint some more tokens why not cool and then I can just go list all and then you can see the nhd asset now makoto Iroha world has also that it's quantity 1337 which is very cool and you can just keep going you can combine all these different things you could send for example Alice some Iroha tokens different things like this anyway I think you get the idea we're almost out of time so I'm just going to go to the chat if I can find it if there's any questions and if there's no questions I'll ask my own questions and feel free to so somebody wrote have you done any performance benchmarks with Iroha v2 if so how is it compared to v1 it's a good question here I'll stop sharing my screen because it's kind of distracting maybe so yeah so it takes some time to do proper benchmarks in fact we're having a hard time doing tools that will give transactions fast enough to Iroha v2 we've yeah but we recently set up like our own kind of network to test longevity and we created so we have a java library that we used along with jmeter to create like just create a bunch of transactions and test it and Iroha v2 is quite fast I don't really want to say any specific numbers because we've only really tested it on a small network but it's like thousands of transactions per second so it's pretty fast I mean it's really nice somebody asked a great question you know what v2 is in Rust it's SDK is still supported by python, javascript, etc. okay this is great so basically what do you do with SDK so for SDKs to really be nice for humans to use you have to kind of put a lot of care into the writing of them and for Android and java we have kind of a a rudimentary library that you can use and we're currently improving this and we're also looking at having some people work on a Swift version, a Swift library for iOS for python there's a Rust cargo crate that will kind of like put a wrapper around your Rust compiler pool I think it actually uses something related to C and Cython in order to do the bindings but it looks pretty nice we're actually testing it this week we haven't actually used it yet so I can't really say much about it but it looks really helpful so hopefully soon you'll be able to use python and for javascript we do have another I think at least a draft version of javascript library that people can use and this is going to get better somebody asked what's the main difference between Hyperledge Fabric and Hyperledge Redraw well I mean there's a lot of differences so the philosophy is very different the way things are built are different so which platform you use depends a lot on what you're trying to do Hyperledge 2 tries to be a lot simpler and less overhead and also all peers should have all the data so in Fabric they have different channels and things like that and double-layer consensus that happens maybe not with data validation but with just a hash hash ordering and that's not really what we well it's not the design choice that is in Iterha so Iterha is a little bit different so you should look at them and understand which ones are best in order to use your projects so yeah we're mostly done I think we're out of time now so thanks for joining you know you can connect you can go to our github page I think there's some links to the chats and feel free to join Rocketchats, Allground whatever Gitter and ask questions but yeah to check out Iterha 2 just check out Iterha 2.dev branch and then hit cargo build and it should run for you hopefully I haven't had trouble at least so have a good day everyone thanks a lot and I think that's all we have