mo-fu note

研究からキックボクシングまで何でも書いていきます!

Publish transcript of "bancor: Token economy made with Ruby"

My Presentation Slide

I gave a presentation about bancor at RubyKaigi2018. I translated transcript into English and released it!

bancor: Token economy made with Ruby - RubyKaigi 2018

My presentation slide is here ↓ speakerdeck.com

Transcript

1

Hello!

2

My name is Yuta Kurotaki. I'm a software engineer at GMO Peperbo, Inc. This picture is me, I am eating rice.

3

This is the 9th group photo of Rails Girls Tokyo held at Speee. I am a coach.

4

We sponsored T-shirts at Rails Girls Tokyo 9th. The company offers a service called SUZURI.

https://suzuri.jp/

5

I am a developer of the personal support platform "SUZURI People".

https://people.suzuri.jp/

6

About SUZURI People

7

About SUZURI People

8

Ruby committer 'seki san' is also registered as a creator.

I think that we also want to use many OSS developers, Please apply for participation as a creator.

It is okay if you talk to me after the presentation!

9

About the technical community on FinTech & Crypt Currency in the Company.

10

For example, OKIMOCHI developed by Mr. Joe Miyamoto, introduced a mechanism to throw bit coins on Slack.

At Pepabo Laboratories, we are conducting R&D for sharing private data. https://speakerdeck.com/monochromegane/wsa-1-kaleidoscope

I have been developing services using the Bancor protocol.

11

Today's outline.

12

About Blockchain

13

Bitcoin design paper was proposed in 2008, and as a distributed ledger technology dealing with bit coin transaction history, "Block chain" has been abstracted.

The blockchain is a ledger of decentralized authority of Peer to peer, and it is distributed among users and managed by users. Bitcoin blockchains are traded in 10 minutes and the transactions are summarized in data called blocks.

Also, bitcoin requires work called mining, In order to simulate in real time the time of 10 minutes in the real world, it is supported by this mechanism called Proof of Work.

14

As a good point of the blockchain, It is decentralized and it is impossible to improve the data.

However, due to the problem of scalability, the response is slow, I feel the problem of UX. Also, in the development of blockchain applications, there are few practical workers and few developers.

15

There are many applications of blockchains that make use of these characteristics. There are application to health care, personal ID management, contract, etc.

For example, if it is a contract, you can move assets under certain conditions many years later, guaranteeing the promise of the future.

16

In Estonia, the e-government began in 2000, not only administrative activities, but also all services such as transportation, medical services, banking transactions, etc. are electronized.

https://e-resident.gov.ee/ https://gigazine.net/news/20180405-e-residency/

17

About Smart Contracts

18

Before I explain about Smart Contract, I will talk about BlockChain Platform called Ethereum.

It is said that it was devised when Vitalik was 19 at the age of 19. Today, various services are brought out around the world on this basis.

19

This sentence is quoted from the blog of Vitalik, the developer of Etharium.

Smart contracts are a simple form of distributed automation. And it is a mechanism that involves digital assets and multiple parties.

20

Explanation of automatic execution of contract.

21

About Token Economy

22

Before talking about token economy, I will explain ICO (Initial Coin Offering).

Currently, ICO (Initial Coin Offering) which raise funds using token implemented on Ethereum all over the world is gaining excitement. This image is the result of ICO of Thai FinTech startup called OmiseGO.

They have raised 25 million dollars.

It is the same image as IPO (Initial Public Offering) where companies raise funds, ICO will be able to raise funds even for projects such as creators individuals and local currencies.

23

In Japan there is a social media platform using block chain technology called ALIS. ALIS has done ICO, and as a result, it raises 430 million yen.

The project is being opened, regular progress reports on SNS, GitHub and Trello of the project are open to the public.

https://alis.to/ https://alismedia.jp/ https://alisproject.github.io/whitepaper/whitepaper_v1.01_en.pdf

24

Token economy is to exchange items such as local currency and coins / tickets that can be used in a specific community, for example by exchange for cash etc.

Tokens are valuable vouchers, which create unique economic zones for each token by circulation.

25

It is good that anyone can raise funds using tokens such as currencies and tickets realized on the block chain, but minor tokens can not be sold when you want to sell, when you want to buy You will not be able to buy it.

This is called liquidity risk.

Also, if some people do not participate in the market, agreement on the price of the seller and the buyer will not be made and a "Coincidence of Wants Problem " will occur and no agreement will be made.

I want to sell for $ 15! I want to buy with $ 10! If it says that the transaction is not established.

26

To solve these problems, the Bancor protocol was considered.

27

At first, I learned by looking at the entry "Bancor Protocol will be a big invention to support the token economy?"

This article was written by amachino.

medium.com

28

The Bancor protocol introduces intermediaries such as "reserve funds" and brings "token liquidity" and "automation of transaction price discovery".

29

Regarding the new method of price finding, the price (Price) of a token at a certain moment is calculated by dividing the balance (Balance) stored by the token issuer at that point by the token total issue amount (Supply) and the fixed reserve ratio (CRR ) Is the definition formula that is divided by.

In the classical exchange model, the price was determined by the real-time matching order between the two parties, but the price of the smart token is calculated automatically.

30

Here is the pricing equation derived from the condition that the relationship between price, issue volume and reserve value always holds regardless of trading quantity.

I implemented this in Ruby.

31

I made a gem named bancor.

32

Although it may not have been so long since Bancor Protocol was released, I introduced it to my own project to verify that it is actually effective.

At the beginning, there are some difficulties.

For example:

  • Learning costs such as acquiring a language called Solidity to move a Smart Contract on Ethereum
  • Prepare blockchain infrastructure
  • Web application development for human beings to buy and sell tokens
  • Join web application and block chain, manage transaction
  • Cost to move Smart Contract

33

I implemented it in Ruby so that I can verify Bancor Protocol without learning cost or operating cost.

Now you can easily introduce web applications with Ruby on Rails etc.

34

Since it is open to GitHub, those who are interested after listening to the presentation please try using it for testing!

35

This is an example of the calculations that were written in the Bancor protocol white paper.

For details, I would like you to see the white paper, but from the top in order of Activity, based on the funds collected by ICO, ETH is converted into a smart token called ABC.

36

You can actually simulate this with bancor gem.

37

I put a bancor gem in Rails and made a web service prototype to purchase creators' tickets with yen.

Let's see how the price fluctuates when buying a ticket. As you buy, you can see that the price of one ticket rises little by little.

38

Also, this time it is a demo of selling.

Every time you sell a ticket, you can see that the price of one ticket gradually declines.

39

Conclusion

40

I explained the token economy from the overview of the blockchain, and the bancor protocol. Also, I wrote a simulator about Ruby implementation.

As a protocol, Bancor protocol can be implemented in languages such as Ruby as well as blockchains.

Therefore, you can try without using Smart Contract on Ethereum.

41

Today 's presentation introduced one example of making protocols like Bancor Protocol available to Ruby's applications.

From now on, bancor gem does it without thinking too much about arithmetic of decimal point,Though it may be better if you aim for simulation through trading, Actually released as a Web service, when running in a production environment, There are things I have to do.

For block libraries, major libraries around Ethereum, Since there are many Python, Go and JavaScript, there is a feeling I want to make it more various in Ruby.

  • Implement ideas raised in the world of Ethereum in ruby ​​world
  • Implement ideas raised in Ruby's world in the world of Ethereum

If we do something like these, I think whether Ruby and Ethereum can get along better.

42

This is the end of the presentation.

Let's talk about this presentation after party or when you pass each other! Let's enjoy RubyKaigi for three days from today! Thank you very much!