Producing block apps the easiest way to build blockchain applications what can you do with block apps you can create your own private customized blockchain Ledger's you can communicate with public block chains reading data from them and pushing transactions to them you can connect to existing systems and devices like existing payment systems and mobile phones and devices even as small as a Raspberry Pi you can build new businesses with blockchain based products and services and make it easy for existing businesses to connect to the blockchain we've been calling ourselves the operating system for block chains .
So here's our team I'm Karen James Lubin our chief data scientist I'm also a PhD candidate at UC Berkeley and mathematical physics the rest of us are a mix of successful entrepreneurs and mathematicians and physicists
So just how easy is block outs imagine a new consulting company with three partners Jim Victor and I company needs a contract that fixes revenue splits between the partners maybe we've just met each other we don't trust each other all that well and everything has to be on paper anyway it also needs a payment system that will automatically send money to the partners based on our deal and we need a secure audit trail so partners can see that they've been paid and auditors can check that no money was lost so how can we do this on the blockchain with block apps
So let's go ahead and build out that contract and let's see if I can do it in about five minutes so I've set up our command line tool block already and scaffolded an the empty project so how much the config file kind of looks like a normal web app but we've got this contracts folder so this is our standard blockchain application structure contracts contain just what I'm going to build so let me make a new one let's call it simple payout so contracts are declared with the word contract giving us all addresses at which will receive our payment will be an it function and a dip it down to function also we'll need a little hash tabledeclare with the word mapping it's public ownership so that's the ownership percentage so when we in it all hard-code the addresses Victor will be nine A's it will be 90s benign cease and then let's assign the ownership percentages let's give Victor 25% Jim 25% I'll take 50 as I'm making the contract okay and in the dividend function but wind up doing is first get the total balance so this refers to the contract now we're just going to pay it all out we're just going to pay Victor's percentage we got to divide by a hundred because I've based the unit's out of a hundred there okay do the same thing for Jim and I okay looks good
so let's compile this thing and then let's upload the contract okay so let's run
it it's now that we've uploaded the contract let's go ahead and run it let's go ahead and login as developer type our password
okay let's initialize the contract with some ether there it is we see the addresses that we hard-code it and the contract balance is five ethan well let's go and check and see if there's anything at those addresses right now so this is our query API okay nothing so now let's do the payout see the contract balance one two zero let's reload this up
there's a state there I looks like Victor got about 25% looks good to me so you can cut out all your negotiations you don't need your lawyers and your accountants are happy thank you from funb