Skip to content
CCPEDIAby Unity Nodes
VideosDaml for Beginners workshop – Smart Contracts for Robust Data Pipelines

Daml for Beginners workshop – Smart Contracts for Robust Data Pipelines

Nothing is loaded from YouTube until you press play, and then without tracking cookies.

About this video

📚Check out Daml Learning Center: bit.ly/LearnDaml 📖Join our forum and get started: bit.ly/tryDaml

On an average, 60% of effort spent by data analysts and scientists is on aggregating, reconciling, and cleaning the data from multiple sources from within and outside the enterprise. That means that data preparation and ingestion takes up more time than actual insights generation!

Looking upstream, these data islands are a result of multiple application silos within an enterprise. Considering that every business process is supported by a series of applications working together, the level of checks & balances and reconciliations between disparate databases becomes a significant portion of the business budget. A similar scenario unfolds for business processes that span enterprise boundaries in supply chain, financial services, and other industries - each enterprise must reconcile constantly with another to ensure they are looking at the correct state of the business process at any given moment.

It's time to give that traditional architecture and resulting data pipelines a boost!

In this hands on workshop, see how to use DAML smart contracts and maximize business performance. Help data scientists maximize their time on what matters most - analysis and insights to improve business performance. And free up value operations bandwidth to focus on delighting the customer.

We'll be giving away a free DAML hoodie to one lucky winner!

Who should attend: 1. Application developers and product owners 2. Data scientists and analysts 3. Enterprise and solution architects 4. CIOs and CTOs

Agenda: 1. How DAML smart contracts help 2. Live hands-on example of a real life use case 3. Getting started

Speakers: 1: Francesco Andreoli - Developer Marketing Lead 2: Manish Grover - Channel Alliances 3: Levente Barczy - Levente Barczy - Technical Sales Engineer

For background information, read this blog: daml.com/daml-driven/how-smart-contracts-can-accelerate-your-ai-analytics-roadmap

🔎 Please create a free account on project: DABL and deploy this smart contracts based chat application on your ledger. You get your own URL to share with everyone, and now have your own collaboration system for your projects!

📖 Here are two other end-to-end samples here and here that will help you get started when you are ready to host your own business app.

⏩ What better way than to create your roadmaps and important to-dos on DAML smart contracts based, project:DABL hosted, OpenWork Board! Board is a Kanban-style card tracking app.

👏 For any questions or assistance please feel free to write to us. Stay safe❗️

Transcript

10,815 words

Captions as YouTube publishes them, usually machine-generated, so names such as Daml and Canton can be misheard.

  1. 0:00

    great i think we can start we are enough people for today um i would like to welcome everybody to this hands-on workshop this is the second uh part that we're doing in collaboration with the frankfurt data science and the smart contract frankfurt meetup we will the first part was mostly going through theory showing what demo is capable of and uh explaining great use case by other meetup partners today we will have a little bit

  2. 0:33

    different workshop actually is exactly some more hands-on workshop i'm francesco part of the demo community team we will have manish introducing quickly demo and then we have levy going through a hands-on um build from scratch demo that we will quickly go through so i just wanna uh i just want to say this is a great opportunity for everybody to ask questions all the time this is just not a webinar the idea is that we're doing a q a session and please jump in if you have

  3. 1:12

    any questions quickly stating the agenda here um manish will go through the problem how the enterprise silos are looking today and then levy will take over uh explaining how this this example will look like in reality and build it from scratch in front of your eyes so great i will give you the word manish and go for it what we are going to be talking about today is also how do we solve that same problem within the enterprise

  4. 1:43

    um so you know any business process within the enterprise is composed of multiple applications each one of them does one step of the business process and typically what happens is these applications are in different hierarchies in different departments they use different technologies different stuff and that's why what happens is these applications often have their own uh you know vertically integrated you

  5. 2:07

    know sort of a stack you know so there's an application uh they have their own database there's another application it has its own database and and so on and then each of these applications will obviously send data between each to each other in order to you know get uh get at the same state of the business process um and we'll show you an example uh in the in the next slide actually so if you think about a credit card

  6. 2:32

    process and this is also the example that levy is going to cover during the hands-on demo but you think about you know you're applying for a credit card to a to a company say a credit card company there is a new account system where your application goes in then the application is sent to the underwriting system uh you know they typically have their own databases for example they'll look at your data they'll run some credit checks and all of that stuff and then they'll pass the data back to the

  7. 2:56

    new account system and your card is approved when the card is approved obviously that information that you as a customer what is the type of the card what is the credit limit etc is sent to many different systems so and typically you know multiple applications manage all this so there's an e-statementing system there's a fraud detection system which is looking at your transactions and making decisions there is a payment system and all that and the problem that we are seeing with

  8. 3:20

    that structure traditional structure is that obviously for ai and business intelligence folks if you have to do analytics and business intelligence on this entire business process there is a process of aggregating the data from all of these different sources making sure that the data is reconciled and you know the data from one system does not contradict with the data from the other system

  9. 3:44

    uh for example you know you might have an active card in one system and a expired credit card in another system and then somehow somebody has to look at what is the real state of the business process and clean up that data before they can feed it for analytics another big problem sorry francesco if you go back right another big problem is on latencies so when you make a payment almost all of us have seen we make a payment and your payment is not available

  10. 4:09

    online immediately it takes four hours maybe six hours maybe sometimes the next day for your payment to show up online and that's the latency in the whole business process because your payment system has to send the information to another system in order for that system to pick up and show it on the website so we've got this you know typical issue of checks and balances data reconciliation and latencies throughout the enterprise landscape

  11. 4:33

    and uh on the next slide you'll see that that is exactly the problem that a lot of us face you know so whenever you need to do analytics you have spend a lot of time aggregating reconciling information and you know statistics show that almost 40 to 60 of your data management effort is spent in this first two phases only then you get to enriching the data and then analyzing the data and running

  12. 4:56

    algorithms and improving the business performance and that is the problem that we want to show how we can solve so on the next slide um you'll see that you know we are not changing these applications we are not saying that you know you should redo all of these applications using a different technology what we are saying is that there is a new way to connect all these applications using a smart contract-based multi-party workflow which means that you're now each of

  13. 5:22

    these applications now has the same has a view of the same state of the business process at any point in time a payment comes in the payment is applied to the credit card and all of the other systems automatically get to see the same information based on privacy and confidentiality of course you know you may not want one system to see what's happening in the other system that can easily be controlled but still there is no latency in the system anymore and what happens is you can now

  14. 5:50

    take this smart contract store that you have and you can generate business intelligence and ai and all of the other other things based on this smart contract store instead of having to run the traditional etl you know aggregate all the data make sure the data is clean scrub the data and then load it load it into your you know into your data warehouse so we'll show you how how you can get rid of you know some of

  15. 6:13

    those inefficiencies and obviously like with any technology this is a roadmap you know so it's not that overnight it's going to change but um hopefully a lot of you know many of you are architects we were just speaking to an architect enterprise architect some of your blockchain developers some of you are innovating with new products and you'll see how this kind of an approach can become a part of your enterprise roadmap you know so there's a new

  16. 6:35

    approach to manage the data manage all the business processes so um this is uh this is demo so this is the demo that we'll be showing you today demo is a smart contract open source smart contract language and there are just a couple of properties i want to highlight before i hand it over to levy as you can see your applications the ones on the green are those business applications that we saw on the previous slide what will what will happen is when we create this multi-party workflow using demo

  17. 7:08

    um one of the big benefits of using demo versus any other any other technology here is that it is completely portable so you see a list of all of these blockchain platforms at the bottom you know so vmware's blockchain platform hyperledger fabrics auto basu coda and all of those um your demo application is going to run seamlessly once written it's going to run seamlessly across

  18. 7:30

    any of these blockchain platforms so you don't have to modify or modify your code and you don't have to select the blockchain platform before you know you start your project similarly the second row deals with databases so it shows you that demo also runs on databases so the example that we saw before the credit card process within a company you don't really need a blockchain within an enterprise

  19. 7:54

    you can just run your business processes on a database and then demo allows you to do that um you know without trying to deploy a blockchain whenever you have to write a smart contract based workflow the next important thing that i wanted to talk to you about is interoperability so you see that democonnect arrow between the left and the right sides what it means is that the credit card process that we just saw can be run on a database on the right

  20. 8:19

    hand side and then it'll enter you know when this company wants to connect to an external blockchain network say between a couple of different credit reporting agencies or between a different collections company or any other enterprises that it might want to connect to that is probably going to be done on a blockchain and what this uh what damel connect allows you to do is for the internal business process

  21. 8:43

    to interoperate atomically uh and consistently with the uh with the blockchain network that you're setting up outside so that's a tremendous you know very uh tremendous you know significant improvement um over the interoperability uh you know paradigm that we've been discussing because it allows your business process to seamlessly move from outside the enterprise to inside the enterprise

  22. 9:06

    and back you know so i think that's the second best uh second most important thing that i want to talk to you about um so now i think let's get into the demo um levy if you have anything to add about damil uh and then let's get into your example okay yeah just just a couple of things on this slide uh manish i think kind of one of the most important properties of damol it is it was built fit for purpose uh particularly to express multi-party

  23. 9:36

    workflows and business logic so you'll never see sort of that systems level code which is usually undifferentiating to you to your to your business you'll never see that sort of systems level code intermingled with the the business logic um and what this allows you to do is basically focus on what you think your value add is in your application um in in today's demo what we'll actually be doing is we'll be writing um demo code for the

  24. 10:07

    demo runtime so that's that's that thing in the middle and what that does is it specifies sort of the rules of the of the system uh the rules of the application process um and the neat thing is is that this will run exactly the same way uh no matter what persistence layer or the thing you know one of those choices on the bottom you you pick and it also helps you create an upward

  25. 10:32

    facing api where it says demo ledger api that's usually traditionally something like a nodejs back end to your front end it'll also automatically create that so you don't have to and you can just focus on when you're writing your application you focus on the react front end or your your java integration or anything like that and there's already an api for you that is a hundred percent coherent with the business logic that you've put together i think i think that's all i wanted to

  26. 11:03

    say on the slide i think if if you're okay to do so i will share my screen and get into the demo for sure all right so what i will uh and maybe maybe is it is it a good time to pause for questions here or should we just uh jump right in here uh yeah i mean uh yeah let's keep it open for questions uh anybody if you have any questions definitely post them in the chat or in the q a and then we'll then we'll take them as we go along so let's try to keep it interactive

  27. 11:36

    okay all right so let me get into let me go ahead and share my screen here uh and actually um all of the all of the code that i'm writing today is going to be available publicly on a public repo here and we'll we'll share these links out uh at the end there but i would suggest if if you're going to start developing with damol kind of your your first place that you should go uh how to install the thing what are all these different demo concepts go to docs.damo.com um

  28. 12:12

    and you can go ahead and you know get into the get started button for installation instructions there is a reference api there it tells you how to build applications it's a really good really good and i would say well written and mature bit of documentation to not only get you started but also to keep you in production and keep you productive for a long time uh okay so with with that out of the way

  29. 12:37

    i will jump into uh the black screen of death this is uh this is where i'll start my application um so uh as manish noted what will uh write out today is a business process where a consumer can go ahead and apply for a credit card and in the back end of that um an underwriter can approve or decline that credit card um so nothing nothing too crazy but you'll see that um you know i'm not going to

  30. 13:06

    spend a whole lot of time on the system's logic at all it's it's all going to be hopefully something that is comprehensible not just a developer but also to like a business analyst that you might be working alongside all right so to that end um i'm going to start a new project called let's say ccdemo and what this does is it evokes the demo sdk that's our software development kit which is completely free to use and it creates a new project called

  31. 13:41

    ccdemo there we go and what this does is it creates a new demo project for us in a directory called cc demo which i will now open in visual studio code that skeleton template uh that that it's referring to basically put something um put something into your project so that you don't start from a blank sheet of paper but uh which demonstrates some of the some of the sort of key features uh within demo you can go ahead and drill down into the

  32. 14:19

    demo directory ac main.demo and it's a tiny tiny uh smart contract uh and along with uh some test scripts here so what visual studio and the plugin that we wrote for demo uh gives us um and once again this is all open source and free is you know the usual syntax highlighting um code completion all of that good stuff as well as a testing framework that allows us to do um test driven development so what happens is uh you simulate a number of

  33. 15:00

    scenarios number of interactions which between different participants and then you can see exactly what happened on the right hand side uh within your ledger um including you know the the entire transaction screen what data was entered who did it etc uh but i won't i won't go over this uh just now i think it's instructive to look at and and uh if you get a chance do look at it but i will do what i will do now is actually start from a blank sheet of paper

  34. 15:31

    to create my credit card module so i create a new demo demo module so to that end i will say module credit card there and this this makes the uh the the remainder of the file the specification for my credit card module and this makes it importable it makes it packageable and and so forth okay so uh most of the time when i'm writing demo i'm creating these things called templates which define

  35. 16:06

    the the behavior and the rights and obligations associated of the behavior and the data and the rights and obligations associated with the objects or smart contracts on my ledger so i'm going to define this a credit card uh type of smart contract uh which i'm going to spell out all of the details what goes into the credit card and also who gets to who gets to do what and when so i'll simply fill in the the data details here so what goes into a credit card well

  36. 16:45

    there's an owner this is the person who's owning it there is an underwriter that is uh the person who needed to have approved the uh the loan and it's also the backer of the credit card here it's the it's the person that's actually needs to pay the institutions that you you pay with on credit um let's give it a type which for now is a bit of text but i'll change that so this is going to be like is it the rewards program is it the flights are you going for points is it the one that lets you into

  37. 17:19

    the airline lounge etc and then there is the credit limit on it which is going to be a decimal um let's give it uh the name on the credit card which is a bit of text uh there is also going to be the expiry which is a date and i will go back into what some of these types mean in a in a little bit so so uh uh don't worry there's just a couple more fields here there's gonna be the credit card uh number uh which is going to be an integer so this is literally the

  38. 17:59

    16 digit code with which goes on the front and if i'm just going to check my notes i believe oh one more thing the currency what currency is this thing issued in and it looks like i have everything except the balance okay so and this is actually all i need to specify a uh template all i need to specify the behavior of a smart contract it's very minimal so we'll we'll enrich it we'll get to how to add a lot more logic to it

  39. 18:42

    but let me um let me just pause here and show you what each of the different sections mean so um as you can see you know lines 5 through 13 are the names of fields which are which are going to go into the contract and the thing after the colon is some sort of type so you have party text decimal date integer all sorts of uh all sorts of other good things and in fact um so text decimal date and int are are kind of obvious um party party is a little bit less obvious

  40. 19:20

    um but um and and i'll describe those what they mean in a minute uh but the important thing about the the sort of the more vanilla types is that you can create your own uh in case you want sort of uh much richer uh data so we've had we have examples where an individual smart contract represents you know hundreds of potential fields um one of the use cases that we work on has to do with specifying interest rate swaps and we include the entire you know flow schedule on a single um on

  41. 19:52

    a single contract and that's potentially hundreds of fields but i don't spell out a hundred fields over here i i create sort of more abstract data types that represent what i want in this case what i'm going to do is i'm going to create a rewards type which is either going to be point uh it's going to be cash back or it's going to focus on the perks and i'm going to say that it's deriving those two classes and all that means is that this

  42. 20:30

    type this rewards type can be either points it can either be cash back it can either be perks and uh equality and serialization that's the show part uh should be derived in the most natural way so i don't i'm not i'm not going to need to define those two functions here so i don't need to define the quality and serialization at all uh so and what i will do is i will set the um the reward type over here

  43. 21:00

    to use my own type so pretty much you know once you define your own data type it becomes a first class type within uh within the system and you know uh demo actually has a very rich uh type system where you can create variants you can you can nest these things into each other you can define all sorts of logic on top of that now one type i didn't get into much is the uh is the party type and this is kind of the sort of secret sauce of daniel in a way

  44. 21:33

    you can think about it as abstracting away all of the details of the participant who is actually able to act on my ledger so in kind of a typical typical blockchain fashion this would encapsulate all of the uh the cryptography that would go in to make sure that the person who's acting is actually the person that they're that they're acting as but it's but it's completely abstracted away from me you'll never see cryptography within

  45. 22:05

    uh within damn because we rely on the underlying persistence layer to um so to to take care of that um and what this what this allows me to do is it allows me to spend to say um who needs to be disclosed what contract at what time uh it allows me to say who can do things at certain times and it also specifies who must do things at certain times and the way i do that the way i express those concepts

  46. 22:36

    in in about in one part it's going to be this the signatory keyword um and when i say that the underwriter and the owner are a signatory this has um some very important application implications within uh within my application so firstly it indicates that in order for a credit card object to exist both the underwriter and the owner must have consented at some point in the past there's no way to create a credit card without the consent of the underwriter and without the consent of the owner that's that's one implication the other

  47. 23:16

    implication is that um you assume that the underwriter and the owner once they've signed up to their credit card they understand all of the implications uh that go into all of the future implications that go into being part of this uh of this contract um okay and naturally naturally when the um since the underwriter and the owner are signatories on this thing um it they can't and and they're assumed to be uh distinct actors and i can actually ensure that i'm sure

  48. 23:56

    that the underwriter is not the owner um it must be that they have to grant their consent at separate times this is intended to be a you know multi-party system and you assume that there's no way that two parties you can uh ensure that two parties can um sign off on the same thing at the same time so what i have to do is i have to create a way uh for both the underwriter and the owner to sign off on the credit card uh

  49. 24:28

    beforehand afriori um the way i will do that and usually what this requires you to do is think about in the real world like all right how do i how is it that my signature and the bank's signature the underwriter's signature ends up on the credit card and it's usually because you put in an application and then they approve it so that's the process that that we're going to model out next so what i will do is i will create a credit card application

  50. 25:03

    contract um which has some of the some of the fields filled in from before so there's an owner that's going to be you here's the underwriter this is the party who you're asking this is the type of card that you want and you're not going to set a limit that's going to be set by the underwriter here is your name so that they can do a credit check on you um let's see you don't determine the number of the credit card that's going to be determined by the bank

  51. 25:36

    and you tell them what your um what currency you want the credit card uh in and we're going to say here the only signatory actually is just the owner why is why are they the only signatory is because they're the ones who are um they're the ones who are backing their own credit card application they're the ones that are verifying that the name that they put in is accurate they're the one who are going to oblige all of the future consequences

  52. 26:08

    of this contract also what are the future consequences of this contract and i'm going to spell that out right now kind of the flip side of the signatory keyword as a controller keyword you can think of signatories as being obliged to do something like you have to do something the opposite of that is that you can do something so i'm going to say that the underwriter in response to your credit card application they're

  53. 26:39

    able to um issue the credit card so a quick question levy after you're done um if you can briefly touch upon the authorization model i think the question that came up is you know how do you ensure prop party properties like the cryptographic key and how do you you know why don't you check it in your code every time okay um so we'll just yeah just cover the authorization model a little bit i'll touch on that i'll i'll spell out this this choice here yeah and i think i'll

  54. 27:13

    i'll go over that okay so um so i'm gonna spell out this choice here like i'm giving now the right to the underwriter to be built to actually issue the credit card in response to the application and what they will do is they will specify uh the limit which is uh the decimal from above uh they will specify the expiry uh this this this is basically all of the the fields that all of the data that the the bank is um setting when they when they issue

  55. 27:47

    that credit card um the balance is going to be zero and they will specify the number and what this will do is this will create the credit card application with a zero balance you don't want to start with a balance on your credit card and all of the fields uh this little two dots here means that i'm using all of the the fields which are in scope for me to create uh the the credit card so basically i'm copying over all of

  56. 28:26

    the data and thus you know this is uh this is what the meaning of the issue credit card choice is it basically says uh tear up the application so i get with i implicitly get rid of the application here and i create a credit card with a zero balance uh with with the same fields as above and by the way this archival and the creation all happen atomically so if for whatever reason the archival fails um or the creation fails then the the other

  57. 29:08

    event in this stream does not happen so on the authorization uh model uh so you know we're i'm saying a lot of things about who can do things who must do things who can see things etc but like how does it how does that physically work right and the answer to that is that it's going to work completely differently depending on the persistence layer that you've picked so it'll physically work differently but logically it will work exactly the same way so once let's say

  58. 29:40

    let's say if you're using uh postgres as your underlying persistence layer then while you know the the encryption scheme you might use is as simple as a username and password um if you're you're running the thing let's say on vmware blockchain then there is an entire uh you know public uh secret uh encryption scheme that is uh that is happening in the back room but all the but the demo model in a way doesn't care about it it assumes already that the participants

  59. 30:13

    which are using the system have identified themselves correctly to to the network so um they assume that when they issue a command from from let's say their front end that uh they passed along usually they usually pass along some sort of a token like a jwt or or let's say a public key and that that public key correctly uh identifies the uh um the the literal agent uh as uh as a valid or invalid participant so we rely on we rely on the underlying persistence layer um

  60. 30:55

    for it for that for that for the identity but once the identity of the agent has been established then the the demo models uh take over in a way um all of those all of the ledgers that that manish showed on that slide uh they make their own assumptions about how identity is verified we do not add or remove anything from that we simply we simply make use of the fact that an identity has been

  61. 31:25

    uh established um and you'll see you'll see actually when we deploy this thing onto our own cloud hosted solution that the way we identify um is we basically on that one it's like off zero where you pass along a jwt anytime you try to do something on the on the ledger but that's but that's just but that's just an example the underlying persistence layer will ensure that differently uh all we care about when we're writing

  62. 31:56

    sort of the business logic is who can do what at what time and who gets to see things i didn't mention that but the only way anybody has access to any of the contracts is if there's some sort of a stakeholder on it and we define stakeholdership you know kind of very precisely uh it means you're either a signatory or a controller uh there's a third option called an observer i won't get into that

  63. 32:22

    now but the it's very obvious just by looking at a template who's going to be able to see it you can kind of think about the that type of disclosure um as row level permissions on a database so you can think of like okay who gets to see this credit card well i see that only the underwriter and the owner are signatories so this particular the credit card is going to be this close to the underwriter and the owner a different contract with a different owner is going to be only disclosed to that owner it's not going to be

  64. 32:59

    disclosed to anybody else same thing on the credit card application the only two stakeholders on this thing are the owner and the underwriter so there are the only two people who is going to be able to see it so just wanted to say levy uh for the audience i think this also means that uh privacy can be configured at a much granular level within your organization um so a smart contract

  65. 33:24

    being operated on doesn't mean that everybody in the chain of that you know uh smart contract can get to see it you can define it at um at at every level who can get to see it yep yep particularly within an enterprise that means you might have different uh permissions uh for the individual people versus the desks that they report to or the or the departments that they work in uh you know supervisors versus not supervisors senior people versus non-senior people so you can make those really granular

  66. 33:56

    disclosure and but but it's more than disclosure it's also who gets to act like for instance in this credit application um choice and these things are called choices by the way only the underwriter is able to issue the credit card then um a demo transaction is considered val invalid uh if well let's say it's in the wrong format or something like that or you didn't specify an argument it's also considered invalid if the person didn't have the right to do what they

  67. 34:28

    wanted to do so in this case let's say the underwriter the the owner tries to issue themselves a credit card or a third party tries to tries to interact with this contract um and then there's a sort of third guarantee that we also make is that a contract is never going to be archived twice so there's also sequencing logic that uh that that we ensure so that um you know uh yeah it it it protects us against double spends and things like

  68. 34:59

    that so then we'll we'll check for that um okay so i think i'll also pause there now for questions so i talked about the significance of the signatory and the controller keywords and like i said it's kind of those uh those elements are kind of the secret sauce of daniel so i want to pause there and make sure that everybody understands that before i move on to the next thing so any any questions so far on those

  69. 35:31

    uh on those in particular is there any any uh questions or should i just move on manish or so far so far basically we've allowed the owner which is basically the prospective customer to create a credit card application yep yeah that's right and uh and then we've given the ability for the underwriter to approve and issue the credit card that's that's what we've done so far right pretty much pretty much so that's all that's all we've done uh i

  70. 36:10

    will enrich this ever so slightly i'm going to put in the opportunity for the uh for the underwriter to also decline your application so that uh along with along with a reason so i will say you know um you can decline the application this will result in a third type of contract that i haven't spelled out a spelled outlet called a decline application and and you know hopefully they give you a reason why they declined it and

  71. 36:49

    they can give you a maybe another card to try for next time and i will say create the declined application which i haven't haven't spelled out yet there we go what i will do is i will say okay what is this declined application it's something which is basically under assigned by the credit card company saying like this is why you didn't get your this is why you didn't get your application so the uh we have the owner we have the underwriters before

  72. 37:36

    going to have the suggested suggested cc type there's the original credit card type that you went for here's your name and the currency that you wanted and this thing is in this case is only signed off by the actually let's make the owner and the underwriter sign off on it and what i'm going to let you do is as the owner you can reapply for this reapply basically so you can say request

  73. 38:24

    a new card which will generate the a credit card application from this so from your failure from your from your declined credit card application you can uh basically create a new fresh application potentially with a new card and all i'll do is i'll say create the credit card application with the cc type equal to the suggested pc type all right so what field am i missing the application here is incorrect i

  74. 39:14

    think in the online number 50 yes you're right you're right and i forgot to put the reason in here that you need to be able to see decline application all right that's better so i've added this possibility now for the underwriter to decline your application they need to give a reason and they need to suggest to you a different type of card um you know you didn't specify for the perks one but maybe you

  75. 39:46

    specify for the cashback one or actually probably the other way around because you need to pay for the perks usually um so two quick observations uh levy here so one is of course looking at the business process that we had you know the new accounts application the underwriter and so on um we're not saying that those applications need to go away we're just taking the core logic which should be common across

  76. 40:10

    these entities and putting it into demo and then this will still be invoked from the existing front ends that the enterprise might have right yeah yeah you show that the second thing i want to do you know the you use the observer keyword uh in the first contract uh on top observer underwriter right uh no no no there's no there's no observers i i mentioned it that that's a possibility but uh but i did not include it question i see a question from emmanuel that is asking where is

  77. 40:42

    the request new card defined are we defining there right here oh yeah there you are so you can go from your declined application you can request your new card and that's going to create a new credit card application from your from from that rejection okay yeah and i think these uh i think emmanuel might be uh talking about request new card it doesn't have to be predefined emmanuel because request new card is a is a choice or an

  78. 41:16

    ability or a capability or a right of the owner and that can just be defined at runtime and it can be any name so request not a not a rook it's not at runtime very super important yeah right no no you can define it you can make it whatever you want it doesn't need to be predefined that's right that's that's a good point all of the um all of the like there's not that many keywords in demo actually you've got

  79. 41:40

    a template with where signatory controller can uh but request new card decline issue credit card the names of the fields all of that is is is up to you and um we follow the convention usually that you know the names of templates ought to be nouns they're they're going to be they're going to represent objects or or contracts in your ledger the choices ought to be verbs so these are things that you're doing on the ledger

  80. 42:09

    um yeah so so yeah all of the all of the stuff in light blue is either going to be something like integer which is a native uh type uh or a um or something i define like the case of rewards that is we we defined what a reward is uh up up there so um any anything else is uh really up to you to to spell out in the way you like and that's i think that's kind of the cool thing is that where so like request new card um it's there's nothing else to do to create uh

  81. 42:49

    the the credit card application you just say create the credit card application um with one change at the the credit card type should be the the suggestion rather than uh what's what's there before um and and hopefully i find it legible but hopefully hopefully you find it uh uh legible that there's nothing in here about cryptography serializing the thing uh integration or anything like that and the neat thing is is that this also supplies an api uh to your front end or to your to your

  82. 43:22

    own integrations and um if there's no objections i'll i'll get into that part now okay so one thing is once i've built my demo model and i'm and there's a whole testing framework around this so probably the next thing i would do is test it out and create scenarios and and test those out but just for the in the interest of time um what i will do is uh is basically show you how to create the front end for this so this supplies the business logic now we need to write a front-end that says okay you

  83. 43:55

    know where do the buttons go to uh to request a new card and all of that good stuff so demo actually gives us first of all the sdk gives you a compiler so that's good so when i say download build um it creates a what we call a dar file which is a which is a bit of byte code that represents a business logic okay and that byte code is going to run in the runtime um very analogous to uh java and running on

  84. 44:28

    jvm uh is that you compile down the bytecode and then uh your you know that thing runs in a runs in a run time um so that and that's that's what this dar file does but what i can do from that is i can code generate uh into a directory called demo.js oh forgot to include so now i'm going to code generate javascript js into a directory called demo.js based on the dar file that i just created so note that

  85. 45:07

    the dar file got created in here so what i will say is i'll generate javascript based on that dart line there we go and if if it all goes well it creates a number of javascript types now so here it is there it is back in in visual studio code all of that javascript um you don't need to uh be able to read these these uh these template declarations what's important here is that um automatically based on the the two modules i have main and credit card um

  86. 45:55

    uh the the sdk generated i think this is the right one here we go uh generated a number of types for me based on my demo module so you've got you know you've got declined application uh request new card all of the verbs and nouns that i saw from before are are declared now as uh as demo types and what this allows me to do and and i pre-cook this i'm not going to do this on the on the spot for you here

  87. 46:25

    but what this allows me to do is i wrote a react front end using those uh those libraries here so uh here you can tell it's react because it's super verbose but you can see that there's some html looking things in here but what i have done is i have imported from those code generated libraries the uh the names of the types that that i've been using so what this allows me to do is it allows me to do particularly these three lines which says connect to the ledger

  88. 47:11

    and fetch me all the credit card credit card application and declined application contracts that i'm entitled to once i've been authenticated and then all i do actually within my within the html is that i just i just loop through uh loop through all of the different contracts and and show you their uh show you their uh um uh it's their contents uh another thing i do is there's a button in here where uh on a declined application i can decline

  89. 47:49

    the con or i can request a new contract and this just request card function is a little bit interesting because look at what we're doing here we're simply saying exercise that choice uh there's no parameters for it but basically exercise the request new card choice on the contract that uh whose role we're clicking on the point is this ledger uh object is is something that we supply it's it's part of the

  90. 48:24

    uh react um library that we provide for you so that you don't have to serialize and deserialize javascript you don't have to write an api layer to interact with your persistence layer that's done for you and to that end what i will now do and this code generation by the way is available in different languages so javascript scala and uh and java proper so and you can you can use those objects uh to to within your application

  91. 48:57

    just one quick note for for the audience obviously the front end the react app is talking to the ledger through rest apis and there therefore they are able to exercise this function that we are defined requesting new card and obviously fetching the contracts from the ledger as well all of that is uh automatically exposed as rest apis by the demo runtime um so you don't have to actually code those apis by hand so that's nice yeah and and very importantly you can

  92. 49:27

    interact with the ledger just via pure rs uh but what the what these react libraries do on top is that it abstracts the the uh the rest and the websocket api uh so that you're manipulating what looks like native uh typescript and javascript uh rather than having to you know create post calls and all of that stuff so it even it even helps you there so that you don't have to hand roll your your arrest calls

  93. 49:57

    um okay so so with that so i wrote my business logic i wrote a front end for it so let's actually deploy this thing into production and the way uh i've done that is we've already compiled dar file the next step i would have to do is i would have to compile the react into a simple uh static static repository but that takes a minute so and i've already done it so i'll just go ahead and deploy it so i'm going to choose to deploy it on

  94. 50:30

    our cloud hosted platform um which is uh takes care a lot like spinning up a ledger for me so it's very handy kind of for testing and also for and actually and actually for for a lot of applications you can go right into production using using project dabble you can see i've got multiple projects happening uh multiple projects are going on at once um including i've already deployed a ledger for myself what i will do is i'll start one from scratch

  95. 51:13

    so i'm deploying a ledger called demo and then what that will do is it actually spins up a container somewhere in the cloud um posting all of the that entire stack that we were looking at uh as a last slide before we went into the into the live coding so this takes care of the persistence for you and it also takes care of the the front end for you one uh one quick question levy that came up um before we get into this um how how does how do the signatories

  96. 51:47

    become controllers i think that's a question as a developer how do we understand how the signatories become controllers okay uh good question in fact it sort of happens the other way you can think of controllers you can uh let me go back to the demo code and and thank you for asking that questions and gives me gives me two or three minutes uh before my ledger starts up um in fact it sort of happens the other way uh let me see so here on the credit card application

  97. 52:22

    uh only the owner is a signatory but when the underwriter he's he's a controller note he doesn't he doesn't have any obligations on the credit card application but he has a right on it so what happens is controllers can become signatories right that's this is this is what this is expressing is how does the underwriter go from having a right on something to being a signatory something on something and that is always the order because uh you should

  98. 52:55

    never become obligable in something without your consent you should never be obligable in a contract unless you did something to get into that contract um either by creating the contract or exercising some sort of choice exercising agency uh to be to get into that contract so in fact it actually kind of goes the other way you go from being a controller to being a signatory you can also grant rights to people who have undersigned on things for instance on the declined application

  99. 53:29

    both the owner and the underwriter are already signatories um and we grant the owner some rights but actually um but actually we could have taken out the owner as a signatory here and by requesting a new card he would have become or or she would have become a signatory in the credit card application so it always goes in that direction you have the right to do something before you are obliged to do something

  100. 54:02

    okay yeah thank you yep all right so my ledger has been spun up um and all i need to do right now is i need to upload the the dar file that i've created and it's it's the pre-cooked one because i didn't compile the uh the zip file for the thing that we just did but the code is identical so i upload the the rules of the game and i'm going to go ahead and upload the the front end for it and we saw the front end more or less and like i said

  101. 54:38

    uh all of this is available in a you know public github repo so you can go ahead and look at it yourself so i will deploy the the dar um and once that's done i will deploy the front end for it and this is actually start uh demo gives me um the feature that uh it it actually you know claims this uh subdomain sub domain for me which is now actually in production here um and i will go ahead and there's just

  102. 55:13

    one party on this ledger uh for now but uh i'm going to invite all of you to participate if you like and so i'll post this sub domain in the chat it's basically idea to live production in 40 minutes in indeed so let me let me chat this out to all of the participants uh panelists and attendees so go to that and that confident here we go go to this website and i will also you also need another crucial bit of data which is

  103. 55:58

    the uh my ledger party um i am the underwriter on this network so if you want a credit card you need to ask that that participant there and that's then that's me so what i will do as i will follow my advice here i will go to i will go to uh the website here that i indicated and this is a new domain that it that it claimed i will log in as double you may have to create a sign up or or something like that if if you want to log in

  104. 56:52

    oh manish you don't have to send me or you don't have to send me your your uh um your id actually id okay yeah i was able to log in and i'm seeing um yeah can i apply for a credit card here yes yes yes you can so uh go ahead and it's asking for an underwriter do you need the party id yeah the underwriter is the ledger party i provided uh manish okay got it so the one ending in eight

  105. 57:29

    zero four three zero so put that as your underwriter so go ahead apply for the credit card and this is the cheesy uh html i you saw before so put exactly that underwriter there this is levy here this is me i want the cashback one in dollars i'll say okay and this creates a new credit i want to make this bigger it creates a new uh credit card application for me that i see the status of uh just imagine if you could actually see your applications and banks uh

  106. 58:08

    as as they were being processed um and what this shows me are you submitting okay good so and i'm going to go back right now into project dabble um here we go and if if all goes well yeah there's two credit card applications i think one from venetian one from myself i'm going to issue both these jokers uh a credit card uh so uh let's see that's gonna be the the last four digits of the of the of the credit card ten thousand and i'll say submit by the

  107. 58:50

    way all of these uis for the uh for the uh backend are automatically generated from the from the demo that's been uploaded so you can sort of administer your ledger yourself this way without having to write a front temp for it and did i say issue oh yeah i see what i did and it should expire around a year or something with a 10 000 limit there we go there we go so that should have issued a credit card to myself which is right here so there's an

  108. 59:33

    approved credit card oops and i will decline venetia's one because why not and i suggest that he try for the cash back one instead there we go so now you can see all of the the objects that i'm i'm seeing as the administrator for for this ledger um okay so you get the you got the idea um what demo uh hub or or project dabble allows me to do is quickly upload my back end my front end

  109. 1:00:10

    um and it'll automatically do take care of the rest really it's that's all you need to put something into production very quickly um once again there's a there's a free version of it as well so you can you can play around with it yourself um and i think that's all i wanted to cover guys is there anything else that you think i missed the francesco indonesia um nope i think this was really helpful um and obviously just uh just to reiterate

  110. 1:00:40

    the code that we just saw a couple of things right obviously it's focused on the business logic so you didn't see levy do anything hardcore technical like look at identifiers you know if this party is authorized then do that else decline all of that stuff is not required in demo so it makes it obviously very simple to model your workflow and you saw that you know very quickly you can move from a quick concept in your mind to a quick demo model deployed live and you're ready to demo your app

  111. 1:01:11

    and this same app will obviously run on any of the demo supported blockchains and databases that you saw on the slide that we showed you so you can take the same thing deploy it on fabric sawtooth coda besu and it'll run exactly the same way the only thing that will change obviously is you know how you configure the parties and you and you create those uh create those users on the ledger i think that's all

  112. 1:01:36

    um yeah yeah i think there was a couple of question on the deployment one but they were basically answered online and uh actually uh levy there's one more question from ravi about scalability in damil how about scalability internal can you talk to that a little bit yeah sure so um a lot of that depends on the the ledger choice but actually a lot of it also doesn't depend on it the most of the components within

  113. 1:02:06

    the stack that we're looking at are horizontally scalable um this even includes the in the case of in the postgres for instance uh all of the the what we call the ledger api which is you know kind of the bridge between the demo runtime and your front end or your application uh that bridge is 100 uh uh horizontally scalable uh except on a single party uh read single party commit line because that that needs to actually

  114. 1:02:39

    be sequenced but um it that turns out to almost never be a bottleneck for this so every every uh aspect of the application is uh is a hundred percent uh uh scalable um and just to sort of uh give you an example um the the sort of applications we've we've put into production for instance at the asx we haven't put that into production but we will put into production uh is uh you know you're you're looking at

  115. 1:03:10

    tens of you know potentially potentially tens of thousands of transaction uh per second um and you know horizontally scalable uh lots of different participants uh uh doing the trading etc so the i don't for for most applications there's not gonna be a problem with uh with being able to scale this thing yeah and also uh there is a video francesco i think we might want to send this link as well in the follow-up uh i think there was a recent

  116. 1:03:40

    presentation by shawl our cto on demo scalability and how the infrastructure scales you know so i think that would be a nice link and video to send to everyone yes totally there's another question um from club this is about could you walk us through the process of updating the demo file and deploying again um so how does that work and the second part of the question is um are these data stores decentralized so i think we might want to do that second part first levy so

  117. 1:04:12

    data stores depending on the persistence layer it'll depend on that right pretty much pretty much even even on the even for postgres you can choose to basically shard it across multiple multiple nodes if necessary but for the let's say like a like a blockchain proper like vmware blockchain yeah all of the all of the data stores would be decentralized and um in that one in particular also corda and and some others um you only get the

  118. 1:04:44

    you only get access to the data like physical access to the data for contracts on which you're a stakeholder so there's um you know that's that's not true for postgres obviously because it's all in one place but for uh sort of uh the the proper blockchain implementations or the blockchain propers they're um yeah the the private stores are segregated on the upgrade upgrade yeah yeah okay yeah so um

  119. 1:05:18

    actually actually maybe uh there there's a there's a good sort of document on this uh in the uh in the documentation i i'm i don't want to walk you through because it's it's uh um we can cover that on a separate webinar actually that might be great yeah that might be worth a a webinar on to itself but the but the idea is no technical migration it everything happens on ledger uh version one to version two of the

  120. 1:05:51

    demo um of of your demo model will coexist for a time on the ledger and then there is a a sort of a an upgrade contract which um which transforms version one into version two and depending on the permissions on your contracts the upgrade contracts might be a hundred percent delegated to one person or you might need to get uh sign-offs again from the um from from the the original signatories it's actually it's actually up to you and it depends on the business case

  121. 1:06:28

    the upshot is the upgrades are business upgrades they're not technical upgrades in other words if if if you change the terms and conditions on your signatories you want them to make sure they're cool with the new version before you you voiced the the second set of semantics on them so and and you in other words you do it with a workflow yeah i think that those are the questions um yeah any other question guys if not we can just

  122. 1:07:02

    include with some remarks yeah that was great thank you so much yes super interesting let me just go through so i just have a quick um a quick last slide but uh if you guys are still not uh in the forum and uh you know any question can be really asked there i can jump in quickly so we have this forum and it's basically on discuss the demo.com and uh any question that you have we have multiple per day and it's quite interesting because all our engineers are up to any question here

  123. 1:07:41

    and we're also sharing some good news that is happening in the demo world that's one thing and also for the tutorial especially for the people that are beginning you can check it out here the tutorials and guides but it's quite important that i would like to share here is basically when you don't want to download sdk install dependency you can just run all those uh scenarios online

  124. 1:08:03

    so those are pre-built scenario and you can click on the getting started for example there are multiple scenarios here but basically everything is done in your browser so everything that that levy check uh did it today especially for starting out um yeah it's i totally suggest you you guys are checking this out and if you have any question or it's not working just screenshot it and in the form i will make sure to answer it just one thing francesco there was a

  125. 1:08:33

    there was a um one of the modules was the upgrade so oh to the gentleman who asked the uh who asked the question about the upgrade there is there is a precooked example for you for for for that as well it works well yeah we can definitely like also share this link afterwards it's quite easy and uh there are actually three scenarios in the upgrading one quite cool yeah and levy

  126. 1:08:59

    mentioned already we have also the the github repo that you guys can check it out and uh yeah i don't have any anything bigger i know to say apart uh thank you very much and uh i think uh we decided at the beginning we could do this ten minutes uh um some kind of uh yeah after after zoom in this one so that if any one of you have any question we could just uh make a think everybody as uh as a as a panelist i don't know how it works

  127. 1:09:29

    finish something like that yeah no i think we can stop the recording and then we can we can do that so thank you very much everyone for attending and those of you who have questions can stay on and then we can take them thank you very much thank you guys