Building smart contracts for UK games development
Sam Davies, Lead Technologist at Digital Catapult, reviews some of the technical details of the system Digital Catapult built as part of the UK Games Fund smart contracts project. Read on to find out more about our work with UK Games Fund and smart contracts.
The recent work for our UK Games Fund smart contracts prototype was built with two main purposes in mind: To create a testbed environment so that the UK Games Fund Tranzfuser could trial out developing a game using Smart Contracts and create a framework environment for future development. We also wanted to boost our in house capability in creating and designing smart contracts so we can look at other applications such as IoT.
The initial prototype had a relatively simple goal; to enable teams to register and identify equity, ownership and some business rules to create a game. At this early stage we were not interested in any value flow throughout the system (e.g. through payments to members) or in allowing for changes to be made. Both these parts are currently in development for our next release.
Digital Catapult used the Ethereum blockchain for this prototype. Giving the benefits of a relatively stable release (Homestead), a language for designing and implementing smart contracts (Solidity), along with support for platform integration. There are images available on the major cloud platforms, though in this instance we chose to host our own network. We set up a private/permissioned network using Ethereum; we control who is allowed to join as a node and who is allowed to transact on the network. As this is an unproven prototype we wanted to retain full control and so this offered those benefits. We were also able to set the mining complexity making it easier and quicker to mine blocks; we were able to use free tier AWS machines for mining helping keep costs low. Using Ethereum transaction costs meant we didn’t have to spend any ether as Gas Price; important to us when we’re making multiple dummy transactions.
The smart contracts developed were relatively straight forward. Once a user has an Ethereum address on our blockchain, they could join a team. Upon joining a team, the members could decide upon their game name, the distribution of Tals which define how much equity they have and their voting rights, along with rules the team must adhere to. A user could also change ownership of their Tals (e.g. re-sell them or give them away) and any un-issued Tals could be issued at a later date.
To help prevent misuse of the system we took advantage of the contract inheritance which is feature of Solidity. This allows us to bring in functions from one contract to another. The UK Games Fund had been set up as a dispute resolution service in this system; if there were any disagreements all team members agreed (via a smart contract) that the UK Games Fund would act as an arbitrator. As such, we were able to give the UK Games Fund control over the issuance and ownership transfer of Tals; if a Tal had been transferred erroneously or maliciously the UK Games Fund had the power to undo that transaction. It was decided that Tals are non-fungible assets and so this approach allowed for control.
If you’d like any more info on the system, we built or access please do get in touch (email email@example.com). In building this initial prototype we learnt a lot and are so using that to build an enhanced version.