Jez - funfair

ETHCC 1 · 9 Mar 2018 · 31:57

Jez, a co-founder of FunFair, presents a casino gaming platform built on Ethereum smart contracts. The aim is provably fair online games where players keep their funds in their own wallets instead of depositing with the casino. A live demo plays roulette off chain through the project's own state channel technology, called fate channels, with random numbers seeded by both player and operator and disputes settled on chain. Jez compares the design with other state channel approaches and answers questions on open-sourcing, gas costs and dispute handling.

Topics

From ETHCC 1, hosted by Ethereum France.

Transcript

hello everyone I am J's one of the founders of funfair we have some other founders here and some of the dev team funfair is a platform for doing fun and fair casino gaming using the blockchain and smart contracts so we founded the company more than a year ago in 2017 myself Jeremy and oli who are over there actually this is a great time in Paris because exactly a year ago at Ed Con we demonstrated the first games using off train processing and that was in February in April we

came out as a company and showed people what we were doing and we did a token sale in June the company has expanded rapidly since then and we're now 40 people in London and we've been on the test net for the last year but we're soon to launch our live Easter on the main net in only weeks so our mission was to utilize the power of the blockchain and smart contracts to improve the gaming industry by tackling the perception the negative perception of fairness in games so we've done that with maximum transparency so everything about the the way the games run is fully

transparent and utilizes smart contracts and blockchain technology as far as possible the UK Gambling Commission UK GC just did a poll that they announced only a few days ago that showed actually a very small percentage of people actually trust that casinos and the games they play a fair so we think that we can improve that by providing the technology that guarantees a fair game for the players we also protect the players funds from abuse by the casino because in a traditional online casino the players have to make a deposit first into the casino before they can play any games and the casino has custody of all of the players funds

whereas with the technology that we've built the player doesn't have to do that the player doesn't make a deposit the player plays from their own wallet and any wins go back to their own wallet so there's no custody issues we think that this technology will make everyone happier I bring peace of mind to both the players but also the casino operators themselves the games developers who make the casino games and everyone else that we built the tech so that no one can cheat and that should improve the trust that players have in playing online casino games so fun fair is an etherium based decentralized

casino technology we cater for all of the parties in ecosystem at the same time and we do that in a transparent and efficient manner we've built our own state channel technology that we call fate channel's everyone gets to choose their own cool name for their technology there's lightning Network and plasma and counterfactual and Raiden and as our fate channel's what they allow us to do is make sure that the games are fun by playing fast but they're also fair and that's where we got our name from we can that may not be that readable this is saying that the way that the ecosystem

participates I'm right-handed so this is the casino operators and the casino operators have their own ecosystem including the players that the casino operators acquire through marketing news and also the affiliates that send players to casino operators so they operate together this is the funfair platform and we power the whole lot using the fun token to create this ecosystem we use the Fate channel technology to run the smart contracts off chain those are game transactions and then also game developers provide games that exist in the ecosystem and are paid by

the casino operators so we thought we'd give you a taste of what we're doing first by showing you a demo and then there'll be more technical discussion so here we're using the standard Chrome browser with with meta mask and you can go to this site it's been live for the last year it's a showcase Kiyo so the the front end is a lobby system that is showing the games that the casino operator has chosen to make

available the casino operators curate the games from a adapt store any games developers create games put them in this tap store and the casino operators can choose which ones are visible to the player so here we've chosen to play roulette the French European roulette which has one zero we've clicked to deposit money into the game and the you saw the meta mask pop-up happen now we're waiting for the blockchain to open the State Channel there it's done so now the games are real-time everything that you're playing is every bit as good as existing online games you're not waiting for the blockchain you're you're able to do

multiple spins of the of the roulette wheel in real time here where so everything is now happening off chain so the the actual the bet the wins the random numbers all of that is happening off chain Anna sorry we're just messing with the volume there so this is saying that every time you hit spin the game happens immediately there's no delay you're not waiting for the blockchain at all these games are all JavaScript games usually WebGL and they don't require any download or install they don't need flash or unity or anything like that okay now we've actually shown that we've cashed out I'm

going to go in more detail about how the pay channels work in a second and we'll look on the on the blockchain I'm not sure if that so no good good luck reading that so the fake channels themselves are a node based architecture they're highly scalable sideways so you can run as many nodes as you want each casino operator actually runs a node so as many casino predators we have actually licensed will each have their own set of players and the players are mostly running off chain so part of this of the estate channel system when you

actually open a channel when you open a channel you'll see in a moment we'll demonstrate that the random number generator is seeded by both the player and the operator and the fate channel service then serves real-time rounded numbers for the game just in time the state channels that we've developed are what's called general-purpose state channels in that they're not just doing payment they're actually doing everything they're running the entire game of chain in smart contracts they're what we call cheering complete state channels and that anything that you can do more or less anything you can do in the smart contracts you can do off chain the

reason why we do it off chain is to make it run fast and it's fast to make it fun it's also very gas efficient to do it this way we have full transparency and proved ability for the games and that goes for the random numbers themselves which are provably fair because of a commit reveal scheme that we're using but also the games themselves are in pre published smart contracts which means that they can be audited and verified by but to prove that they are fair and that players can actually look at the smart contracts and and see that in real time each node supports hundreds of simultaneous players which is

potentially thousands of transactions per second this state channel technology is what we call an engineering solution in that we've built it to work today there's no funky math or new math we're not waiting for anything we're not waiting for Casper or sharding it runs today and it delivers a very efficient scaling solution so here I'm going to talk through what's happening this is a dual screen we're on the left its diagrammatically showing what's happening in the state channels and on the right is a slot machine running so first it's going to whiz through it and show you what happens in real time the player has chosen the game the player and the operator have selected the game

together the the deposit has been made the the game is now are waiting for the confirmation on the blockchain various transactions happen actually we're going to play it slower in a second yeah that's it running in real time which you obviously can't follow and in a second we're going to show you it slowed down okay so now we've paused the game we'll show you that the player and the operator decide on the game they seed their random numbers together so both the player and the casino provide entropy that seeds the initial random number generator they confirm that this

has happened the player and the casino operator will also bring funds into the real-time escrow in the fake channel and they confirm that that happened okay so now we're about to spin the game we're going to click so when the player hits spin now the Fate Channel provides real-time rendered numbers that come for both the player and the casino operator and they're combined together to produce the random number that the game is using to decide on the on the position of the reels or

in the case of a roulette table that the position the ball lands on its on so in order to make sure that it's robust and fair it needs to be able to detect cheating but it also needs to be able to resolve the cheating by resolving the dispute and the way that we do that is by pushing back to the chain a dispute so that the smart contract on chain can execute and be the final judge and jury and I said here also executioner because the cheater will lose their deposit so it's expensive to cheat obviously it's reputationally damaging for the cheater as well so with this with this solution

no one can cheat the player country the casino can't cheat and it's all done off chain using the on chain as the judge and jury so you're probably wondering how our fate channel solution is different than other state channels and so just to highlight a few differences the Iranian is a payment channel and there are there are other payment channel solutions I think spanked Cheney's using one I can't remember who from and in the fake Channel case it's not just payments happening of chain is everything so the entire smart contract code is built with a state machine and is able to run fully off chain also the state channel FH channels commit these

rounded numbers and serve them in real time and that's done at the opening of the state channel so it's integral in the channel opening the seeding of the random number generator obviously we compute and settle payments in real time those are bets that the players made wins from the casino it also separates out the payment to the game developer for their revenue share and the payment to the affiliate as well as the casino operator so does all of that in the state channel so that everyone gets fairly paid that should get paid we're also considering doing a burn of a transaction fee that the system charges and burns to be like a consumable ticket

but we're investigating the possibilities for that we haven't committed to do it yet and one of the key differences of a state channel vs. are the ones is that we believe that state channels for now need to be short-lived so in our as they last just for the duration of the game session they don't live there for months like some of the other state channels but we're not sure actually that that people want to leave funds in channels for long periods of time at least not for now maybe one day and it's so in our case the funds are locked for minutes or hours not days months or years we're using a single hop architecture which is that the player is

communicating directly with the node which is the casino operator at this time we are not sure that multi-hop architecture will be suitable because it relies on a density of users before it's effective so for instance if you wanted to send a payment from two people that don't know each other with a multi hop everyone in between in the routing also needs to have left funds in their channels for it to operate so we don't think that's going to happen until there's a hide entity so we don't think that multi-hop transfers are going to be effective at this time we use fast end-to-end dispute resolution because we believe that players don't want to wait

days or weeks for their dispute to be resolved we think it should be resolved in hours also we're very impressed with counter factual and the work that they're doing we want to highlight some of the differences with fate channels as smart contracts are published in advance their pre published partly because the games have to be audited and have to be proven to be fair and they have to be possibly audited by regulators possibly audited by technical auditors and so on so we believe that the smart contracts have to be on chain before they're used similarly in counterfactual the contracts don't actually exist on chain until there's a dispute which forces one of the parties

to actually post the contract on chain at the time of the dispute which can get expensive for instance funfairs smart contracts are actually real smart contracts that have game code in them they have significant game logic and they're millions of gasps and if the player was playing a game and had a dispute with the casino and had to publish the contract I've lost my video feed if the player had to publish the smart contract on chain at the time of the dispute that would be a cost incurred to the player just to do the dispute and millions of gasps is quite expensive so we think that in our case at least pre publishing

the smart contracts on chain is more transparent and also significantly less cost for when you need to do a dispute one last thing is that a counterfactual allows context switching of apps while the channel is still open and we're not currently doing that because we are researching the security issues involved in that because we not only have untrusted players and casinos we have untrusted game developers producing games and we don't want to have the risk of game developers stealing funds from the channel from each other so for now we're keeping the channel open only during the game session and then closing at the end of the game session but we will look into that so in terms of games

development a typical game is in two parts it's the DAP which is the graphics user interface and it's also audio and content and the fun visual side of the game and then the the smart contract is the back end it does the processing of the game logic and it decides if the player should have one make sure they get paid and so on so all games are built in two parts because fairness is more than just what's in the smart contract we have a whitelisting system where game developers create games and then they submit them to us initially and we'll examine them for fairness and fairness is not only the code but it's also how

they look and how they depict the game and how they show the cards or how they how they show the wheel or the ball ending on the on the roulette wheel and so on so fairness is is end to end it's not just about smart contracts and someone has to look at the games and decide that they're fair and bless them make them whitelisted but eventually we're going to defer that to a whitelisting authority that could actually be the community or could actually be an outside whitelisting authority so in terms of scaling and capacity this is potentially infinitely scalable because it's node based and there could be lots of nodes as mentioned each casino operator runs

their own node and node looks like an aetherium node so it's running Geth or parity and it's also running our fake channel service different nodes hosts different players so each casino operator is responsible for acquiring their own players and they can all coexist separately on on each node the hard limits are actually the blockchain block size and how much gas there is in a block and a rough approximation is 100 players a minute could start a game session but obviously game sessions could last hours so potentially that's hundreds or thousands of games in each session so we launched

fun fair to the casino gaming industry a few weeks ago at a very big because you know gaming exhibition in London called ice we've already submitted to the UK gambling commission for a developer license we actually are not going to be a casino myself so we don't need an operating license we're going to be publishing the API and sample game source code for how to build games for this platform within weeks you can see the system today is fully functional on the test nets on Kovan and Rob's turn and so on go to showcase dot fun photo IO and you can play more than 10 games today using some of them are

running on the blockchain uh some of them are not we plan to go live with the first casinos on the main net we in weeks time and we said in q2 where we're hoping it's going to be single-digit weeks away so thank you very much I'm happy to take questions and I can also leave running a preview of some games that we haven't shown on the showcase yet while we're answering questions so thank you [Applause] so the the first two are an Egyptian

slot machine and a medieval slot machine we haven't named them yet and operatin there we go started okay who wants to ask questions hi I'm just wondering what's your business model like how do you make money off of this interval up a little bit okay so a bit of volume on there or so we are taking a model similar to tech companies in that where we are all about disrupting an industry and so we're actually not looking for any revenue for the short term so we

believe that adoption is the key and disrupting the entire industry means taking a long view so we actually are not charging any revenue so all of the revenue the casino operator and the affiliates and the game developers make one pair is not currently charging any revenue we got very lucky there next question I have a question regarding the random number generator so as per the description feed channels are the smart contracts which are generating the random numbers and they have a seed which was given when the contact was

maybe deployed so theoretically because the outcome is fixed I could actually predict the sequence of random numbers that's gonna show and now you can't so the way they work is we use a commit reveal scheme so when the player sits down to the table and starts to play a game and it opens the state channel or a fake channel the entropy from both the player and the house are merged together and hashed we use a technique or hash chains where we hash the number and then hash it again and hash it again hash it thousands of times we put the seed the first hash on the blockchain but in real time the fate channel serves the hashes in reverse order so that they

wouldn't be known and you can't the security is there in the hashes because you can't reverse hashes it's impossible so both sides are operating these hash chains and as the game is played the real number the real-time random numbers are served to the games as they need them just in time so no one can foresee the outcome of the random numbers and yet they're provably fair and they are proven when the game session ends we can then reveal the initial seed that was put on the chain and you can hash forwards and see the entire sequence which is provably fair every single random number generated was in the same sequence but you don't have that information until the end so everything is kept in ink on the private chain

right sorry say game so all the game is happening on the private chain there's no private chain everything is happening but you have some notes and yeah so we're actually executing the smart contract of chain so there's only one copy of the game logic itself and that's in the smart contract that is published on the chain it said that both the player and the house are executing that smart contract off chain fast and they only go on chain when there's a disputes which is hopefully rare yes really really awesome I was wondering how do you make the UI fair right so that's why we mentioned

the whitelisting process because the UI is very important for fairness and that's why it's not just about smart contract fairness it's also about everything to do with the game so that's why we're doing whitelisting so that although games developers could create their own games we don't allow them to be put in the lobby unless they've been whitelisted first and obviously an authority which initially is us but eventually could be the industry will actually decide the the whitelisting of games thank you very much for your talk jazz it was very interesting but I'd like to know how people to buy fun tokens are they going to be available directly in the game or are they going to be having to deal with an exchange

before being able to get onto the so initially people will probably buy them from exchanges and some of the exchanges it's already available on many exchanges but we foresee decentralized exchanges and relays are being very popular so although you won't buy them directly from the game it could easily point you at one of the decentralized exchanges if you need to acquire the fun tokens thanks for the talk does funfair support multiplayer games or is this just single-player with the

player and then the casino so initially we focused on player versus casino or head-to-head games and the fate Channel right now is a is a two-party fake channel we will be enlarging that into multiplayer in the future we're focusing on the single-player games right now but there are many kinds of casino games that are multiplayer like progressive slots or bingo or lotteries and so on so yes we will definitely be supporting multiplayer games in the future so the row of the node then just being the house can you say game is the role of the node then that's running just being like the house that's right yeah that right now the node is is the house okay

but there can be as many casino operators running as many nodes as we want sure thank you so it's an open market and it's fully decentralized so each node is completely separate and standalone cool thank you hey thanks for the presentation I was wondering since you told that the fate channels are supposed to be short-lived I assumed that the settlement of the funds made on chain how does it not to rely too heavily on the on the main on the net on the blockchain in this way do you want me to take back Jeremy and go introduce you to Jeremy our CTO who's going to talk in

more detail on that thank you I've owned I'm fundamentally I mean it does right I mean at the moment we we have two transactions in the channel one to open it and want to close it and that's pretty much the minimum that we think we can do they're pretty lightweight transactions now we're still working on the optimization of the gas car so clearly as just said there was a fixed limit of people that could start a transaction in a given block and that's the same as an end so we we've chosen to have short channels for now because we think they're simpler and they're easier to get right jazz is continually bugging me to make them a little bit longer and we'll look at that in the future but for now it's definitely bound at the end of

the session by the by the performance of the chain at that point otherwise you can't get your tokens back but the the only delay that the user ever notices is the opening of the channel when they sit down at the table the actual when they click cash out they don't have to wait for it it's just going to happen anyway so there's only really one transaction that they're on the Block Joe they're the wedding for and in the current model the the user opens the channel and the house closes it so the gas cost is split equally between the two parties yes nice question yeah excuse me where are we over there so I want to trust two small questions essentially I tried to find the source code is it open right now to check how the fates islands work I would so we

haven't opened it while we've been in development but we are about to open it so the answer is that we need it to be open source to be provably fair open open so yes you will be able to see the source code of the fake channels absolutely but there are multiple reasons why we didn't open it during development but the main one is security you know many of the scams and hacks that have happened in our community have been because of open source code and people being able to fake wallets or applications and steal people's money so we want to only open them when they're ready okay I'm mostly interested in the fate tunnels themselves not the rest I just want to see how the fates under

this work because I also work in States and it's like I want for item no cool I mean I will write I've written a few bits and pieces by will write a full write-up of it if in the next weeks when we finalized they yeah I think I do actual on a write about what we're actually doing and we are still tweaking the last few sort of parameters but there will be a full write-up of it in due course just be patient great great things and one last question you said that it's pretty expensive to open a channel and that you envision them to be opened and closed pretty often isn't that a bit it's not all that expensive to open them I don't know we don't think we said that you know if we're optimizing that as much as we can it will be pretty lightweight it's more

expensive than single token chance and transfer because it transfers to tokens but it hopefully not much more it should be pretty lightly is it the system which automatically creates the dispute or its a user who needs to create a claim yeah I mean that's it's a complicated thing it's actually being the most most difficult part of the puzzle to solve is the dispute resolution basically and again of this will be written up as well and it should be economically pointless for

anyone to actually try and cheat the system and that's them all that we're getting because right now what's happening if the user doesn't matter noticed that he has been cheated well I mean we are building the client software which will check that right so I mean because the the the game logic is being advanced simultaneously both on the client and on the server they can check that the each party comes up with the same result and if the two are different then we take it to the change so it's a fully automated process in that respect yeah yeah it's important yeah okay it's important to

note that we're the tech provider we provide this to the casino operators but the casino operators the players the game developers the affiliates they're all untrusted parties so we're building the tech to let this be a fair ecosystem thank you very much everyone Thanks you

Related talks