<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[GoCryptobot - Medium]]></title>
        <description><![CDATA[World&#39;s First Mobile Blockchain Game for iOS and android - Medium]]></description>
        <link>https://medium.com/gocryptobot?source=rss----2524618a44ef---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>GoCryptobot - Medium</title>
            <link>https://medium.com/gocryptobot?source=rss----2524618a44ef---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:17:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/gocryptobot" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Blockchain Games and GoCryptobot]]></title>
            <link>https://medium.com/gocryptobot/blockchain-game-market-and-gocryptobot-83ebaccf263e?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/83ebaccf263e</guid>
            <category><![CDATA[cryptogames]]></category>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-game]]></category>
            <dc:creator><![CDATA[Kiyun Kim]]></dc:creator>
            <pubDate>Tue, 19 Jun 2018 10:08:53 GMT</pubDate>
            <atom:updated>2018-06-20T07:34:21.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*i0SuTjjshLWz80AQJgLykw.png" /></figure><p>CryptoKitties, a killer app released last December, was a quite big hit that almost paralyzed the entire Ethereum network. After CryptoKitties, numbers of blockchain games have been poured into the market, but their effect has been minimal considering the large number of new games being launched. A small market size coupled with immature technology could be one of the reasons for the slow growth, but I strongly believe that failing to properly utilize blockchain technology has played a bigger role.</p><p>Most blockchain games have simply replaced the game currency with ETH or ERC20 tokens, and game items with ERC 721 tokens. In order to play these games, users have to use ERC20 tokens or buy ERC721 tokens. In other words, this means that most blockchain games are serviced as a purchase-to-play model, while in today’s game market environment, free-to-play models are mainstream. Therefore, purchase-to-play models have a harder time to acquire a big user-base and to make profit compared to free-to-play models.</p><h3><strong>Blockchain games nowadays</strong></h3><p>So what are the measures that blockchain game developers have chosen today in order to tackle the barriers of the purchase-to-play model? Sadly, most of them are making profits by designing speculative and/or gambling game mechanisms that will not be sustainable in the long run. Though each game may differ in detail, we could say that most blockchain games are classified into the following categories:</p><ol><li>Speculative, collective games</li><li>Betting games where players win the opponent’s tokens</li><li>Hot potato games where prices rise every time an item is sold and the last one to buy it is the ultimate loser</li><li>Pyramid scheme games where early users earn most of money and newcomers lose it all</li></ol><p>There is no doubt that these games have some legal issues, and if your game is in an area that could be legally accountable, you might not want to release the game on the App Store or Google Play as both Apple and Google are quite strict with regulatory responsibilities. This is one of the main reasons why all blockchain games we find out there are only serviced on the web.</p><p>Looking at the current situation one might rightfully question whether blockchains have a positive effect on the gaming industry or if blockchains are even necessary when it comes to games at all. And to be honest, blockchain will never give a positive impact if game developers do not implement the technology in a more responsible way.</p><h3><strong>GoCryptobot project</strong></h3><p>This is the reason why we, at Kodebox, started the GoCryptobot’s project. We wanted GoCryptobot to be different from the games that are in the grey areas of our current legal system. So we formulated the following 4 core principles before jumping on the development:</p><ol><li>No speculative/gambling game (hot potatoes, pyramid schemes prohibited)</li><li>Actual game play, not like collective games with low playable features</li><li>To publish as a mobile app</li><li>Blockchain technology to be selectively adopted</li></ol><p>GoCryptobot is similar to any runner game that you may have played before. You have to run the character as far as possible to clear the stages, upgrade the character with the coins acquired during the runner mode, and battle with other users at the PvP mode. It sounds very familiar if you are a gamer. The uniqueness of GoCryptobot is that it has integrated blockchain technologies into the game.</p><p>GCC (GoCryptobot Coin), which is used to trade items and to participate in PvP, is an ERC20 token. Since GoCryptobot is a mobile game made with the Unity engine, an Ethereum wallet had to be embedded within the app to support deposit and withdrawal features.</p><p>Items that are traded at the in-game P2P market are ERC721 tokens. Unlike existing blockchain games that require players to buy characters to play, players are given with a free character at the beginning which is converted to an ERC721 token only after it has been played and leveled up by the user.</p><p>The PvP mode has a probabilistic element that somehow defines the winner of the match. To make the random item generation transparent, the program is executed by a smart contract. Users can check that there was no arbitrary modification involved in the probabilities through the Ethereum network.</p><p>GoCryptobot is the first (and remains the only) mobile blockchain game in the world to be available on both the App Store and Google Play Store. This means that we have taken into consideration serveral other details that most of blockchain game developers overlook.</p><p>For example, Google and Apple both require that mobile applications use the in-app payment system of the platform. This is the reason why GCC (ERC20) which can be charged with the wallet, can also be purchased via the in-app purchase system.</p><p>This feature leads to another very important issue as many countries require by law: the refund policy. If you are a developer and you are considering to have a refund policy in your game, you will be more careful about using highly fluctuable cryptocurrencies. In order to avoid exchange rate risks during the refund process, we have decided to peg our ERC20 token (GCC) to the US dollar.</p><h3><strong>Conclusion</strong></h3><p>One thing is incorporating ERC20 and ERC721 tokens in your game; providing a quality gaming experience and abiding by the law is another story. Many games advertise themselves as having adopted bleeding edge blockchain tech with incentive systems that magically benefit both the developers and the users. Unfortunately you and I know that most of these projects just have interest in issuing coins and making profit out of them, but not in adding value to the gaming experience by properly adopting blockchain. Even the incentive system that they constantly promote prove to have weaknesses at a simple glance. Blockchain is a useful technology, but it is way more expensive than what servers can do today. So if you want to use an expensive technology, you have to understand that blockchain has to be implemented only where it is really needed.</p><p>Translated from the <a href="https://medium.com/gocryptobot/%EB%B8%94%EB%A1%9D%EC%B2%B4%EC%9D%B8-%EA%B2%8C%EC%9E%84-%EC%8B%9C%EC%9E%A5%EA%B3%BC-%EA%B3%A0%ED%81%AC%EB%A6%BD%ED%86%A0%EB%B4%87-66cf9b59e6b8">original Korean version</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83ebaccf263e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/blockchain-game-market-and-gocryptobot-83ebaccf263e">Blockchain Games and GoCryptobot</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How GCC Turns into Ether — Exchange Code Analysis]]></title>
            <link>https://medium.com/gocryptobot/how-gcc-turns-into-ether-exchange-code-analysis-eef249d71486?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/eef249d71486</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[gcc]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Fri, 01 Jun 2018 05:18:17 GMT</pubDate>
            <atom:updated>2018-06-01T05:19:29.387Z</atom:updated>
            <content:encoded><![CDATA[<p>In GoCryptobot, one can earn GCC(an ERC20 token) by participating in the PvP or selling his/her parts on the Market. Users can either purchase new parts with GCC or save it up for future purposes. However, you can also convert your GCC into Ethereum. How does this process work?</p><p>You can read more about GCC and ERC20 tokens <a href="https://medium.com/@koreanboy1120/learning-about-erc20-standard-through-gocryptobots-gcc-token-9d04e6f7218e">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9zbEugSGDOW9fu8pwK-eg.jpeg" /><figcaption>GoCryptobot in-game wallet</figcaption></figure><h4>Withdraw GCC First</h4><p>The circulation of GCC within the game client happens within the game server’s database. However, when charging or withdrawing GCC, the blockchain is utilized. This is because if every action used the blockchain, then there is a fee for every little transaction made. For more details about this, please read this <a href="https://medium.com/gocryptobot/developing-a-small-scale-ethereum-exchange-for-service-purposes-3f82eb8ecb50">article</a>.</p><p>Users can transfer GCC from their in-game wallet to their own wallet’s address. When the withdraw button is pressed and the target address is inserted, the game server sends GCC to the users address by using the <em>transfer()</em> function within the GoCryptobotCoin contract.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19837a561170080ac36fc95bcaac3081/href">https://medium.com/media/19837a561170080ac36fc95bcaac3081/href</a></iframe><p>Users can see that their GCC balance has increased through the <em>balanceOf() </em>function.</p><p>The exchange address to convert GCC into Ether is:</p><p><a href="http://gocryptobot.io/exchange.html">http://gocryptobot.io/exchange.html</a></p><p>In the exchange, the rate for conversion between GCC and Ether is written down. 1GCC is pegged at 1USD, and the user can see how much Ether can be exchanged for the amount of GCC inserted at that point in time. Since Ether’s price changes every second, we need logic that checks Ethereum’s municipal rate and store its value every day.</p><pre>function setExchangeRate(uint256 rate) external onlyOwnerOrOperator {<br>  ExchangeRateChange(exchangeRate, rate);<br>  exchangeRate = rate;<br>}</pre><p>The contract above is called everyday in order to check Ethereum’s rates and decide the new exchange rate.</p><p><strong>What Happens Once You Press the Exchange Button</strong></p><p>If you know how ERC20 tokens work, then you probably somewhat expected the logic below.</p><ul><li>Call the <em>approve</em>() function so that the exchange can take the user’s token.</li><li>The exchange checks if the token is an allowed one by calling <em>allowance</em>().</li><li>Send the allowed token to the exchange by calling <em>transferFrom</em>().</li><li>Send Ether to the user’s address.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*wSVBqluFGqtSwJ3f" /><figcaption>Flow before applying ERC827</figcaption></figure><p>GoCryptobot’s exchange is a web application, and the user creates the contract that calls the transaction, which is all done by utilizing <a href="https://metamask.io/">Metamask</a>. Once the user clicks on the exchange button, the exchange uses Metamask in order to get access to the user account which contains the GoCryptobotCoin contract. Within this contract, a transaction is created which calls <em>approve</em>(). Then, by using GCCExchangeCore contract’s <em>withdraw</em>() function, it takes the allowed GCC and creates a transaction that gives Ether. In order for GCC to become allowed and for the exchange to convert GCC into Ether, there has to be a total of two transaction calls. However, GCC has an additional implementation of ERC827 in order to combine the two transaction calls into a single transaction call.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a55f29a8044c6ef598441ff0e97a04d9/href">https://medium.com/media/a55f29a8044c6ef598441ff0e97a04d9/href</a></iframe><p>ERC827 expands ERC20’s functionalities and is an interface that allows <em>transfer</em>() and <em>approve</em>() to be internal transactions. The GoCryptobotCoinERC827 contract of GCC contains the functionality of doing an internal transaction at the end of <em>transfer</em>, <em>approve </em>functions, which is a functionality of ERC827.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab43677117259f9b529b70e6d6ef8019/href">https://medium.com/media/ab43677117259f9b529b70e6d6ef8019/href</a></iframe><p>If you were to call <em>withdraw</em>(), which is implemented using Javascript, it internally calls the <em>approve()</em> function of the GCC contract, passing the callback function that calls the <em>withdraw()</em> function of the GoCryptobotExchange contract as the final argument, all according to ERC827’s specification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*aZzVeLUxr-E_W3Km" /><figcaption>Flow after applying ERC827</figcaption></figure><p>Thus, if you were to call the <em>withdraw</em>() code above, then the GCC contract’s <em>approve</em>() and GoCryptobotExchange contract’s <em>withdraw</em>() are called in that order respectively.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49d5c8a945a17735688ef24a94f0c297/href">https://medium.com/media/49d5c8a945a17735688ef24a94f0c297/href</a></iframe><p>GoCryptobotExchange contract’s <em>withdraw()</em> function(called by the web server) internally calls the token’s <em>allowance() </em>function to determine the allowance, and call <em>transferFrom() </em>to deduct the the amount of GCC with the processing fee added onto it.</p><pre>coin.allowance()</pre><p>Coin stores the address of GoCrytobotCoinERC827 via <em>setCointContract(), </em>which was already called previously. If the address is stored in a similar manner as above, then the applicable address’ contract can be called.</p><p>We have discussed how GCC gets converted into Ether. Since everything runs on the blockchain, the user can trust the developers, and the developers and gain the user’s trust more easily than before. (If a user claims they did not receive the money, the devs can prove successful transaction with etherscan.) Although these new functionalities are great, many users still face difficulty in using the Metamask, or other private wallets out there, and thus, have trouble using the exchange. Thus, I think developers should think about improving accessibility for the average user.</p><p>** Warning</p><p>If there is not enough Ether to withdraw, there will be an error which results in a withdraw request failure. This ultimately leads to the user wasting his/her gas. Always check if you have enough Ether in the exchange or not.</p><p>You can download GoCryptobot through the links below:</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a></p><p><strong>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><p>(To read the Korean version of this article, click <a href="https://medium.com/gocryptobot/gcc%EA%B0%80-%EC%9D%B4%EB%8D%94%EB%A1%9C-%EB%B3%80%ED%99%94%EB%8A%94-%EA%B3%BC%EC%A0%95-%EA%B5%90%ED%99%98%EC%86%8C-%EC%BD%94%EB%93%9C-%EB%B6%84%EC%84%9D-165d7f5b3a50">here</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eef249d71486" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/how-gcc-turns-into-ether-exchange-code-analysis-eef249d71486">How GCC Turns into Ether — Exchange Code Analysis</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning About ERC20 Standard Through GoCryptobot’s GCC Token]]></title>
            <link>https://medium.com/gocryptobot/learning-about-erc20-standard-through-gocryptobots-gcc-token-9d04e6f7218e?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/9d04e6f7218e</guid>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[token]]></category>
            <category><![CDATA[erc20]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Fri, 01 Jun 2018 03:39:12 GMT</pubDate>
            <atom:updated>2018-06-01T05:19:10.043Z</atom:updated>
            <content:encoded><![CDATA[<p>GCC is an ERC20 Token used within GoCryptobot for buying parts or participating in the PvP. As a blockchain game, users can send their GCC to an external Ethereum wallet. Furthermore, they can exchange their GCC for Ether.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*IugNPIkR8TEIRJyo" /></figure><p><strong>What is ERC20 Token?</strong></p><p>You can make a variety of apps on the Ethereum network. For example, just like <a href="https://medium.com/gocryptobot/how-does-gocryptobots-pvp-run-on-the-blockchain-pvp-source-code-analysis-1fb27dec3801">GoCryptobot’s PvP</a>, it is also possible to create an app that takes the user’s part information from the blockchain, calculates and returns the score, and even issues a currency like the Bitcoin. At this point, the currency issued on the Ethereum side is called a token. In order to use tokens as currency, users must be allowed to check the quantity of their tokens and send these tokens to other people. The tokens created for the ERC20 interface adopted by Ethereum as the standard are called ERC20 tokens. It must be implemented in accordance with ERC20 so that it can be compatible with Etherscan and Ethereum wallets, etc. GoCryptobot’s GCC is an ERC20 token that meets these criteria.</p><p>Firstly, ERC20 token’s standard interface is defined as follows:</p><pre>contract ERC20Interface {<br>    <strong>function</strong> <em>totalSupply</em>() <strong>public</strong> constant returns (uint);<br>    <strong>function</strong> <em>balanceOf</em>(address tokenOwner) <strong>public</strong> constant returns (uint balance);<br>    <strong>function</strong> <em>allowance</em>(address tokenOwner, address spender) <strong>public</strong> constant returns (uint remaining);<br>    <strong>function</strong> <em>transfer</em>(address to, uint tokens) <strong>public</strong> returns (bool success);<br>    <strong>function</strong> <em>approve</em>(address spender, uint tokens) <strong>public</strong> returns (bool success);<br>    <strong>function</strong> <em>transferFrom</em>(address from, address to, uint tokens) <strong>public</strong> returns (bool success);<br>    event <em>Transfer</em>(address indexed from, address indexed to, uint tokens);<br>    event <em>Approval</em>(address indexed tokenOwner, address indexed spender, uint tokens);<br>}</pre><p>There are methods for performing token functions, such as viewing balance and transferring. You can easily guess the method’s functionality just by looking at the method’s name and its respective parameters.</p><ul><li><em>totalSupply()</em> : returns the total issued amount of tokens</li><li><em>balanceOf(address tokenOwner)</em> : returns the balance of tokenOwner</li><li><em>allowance(address tokenOwner, address spender)</em> : returns the number of tokens spender can take from the account of tokenOwner.</li><li><em>transfer(address to, uint tokens)</em> : sends <em>tokens</em> amount of tokens to address, <em>to</em>.</li><li><em>approve(address spender, uint tokens)</em> : grands the spender the right to take <em>tokens</em> amount of tokens from the account.</li><li><em>transferFrom(address from, address to, uint tokens)</em> : sends <em>tokens</em> amount of tokens from <em>from</em> to <em>to</em>.</li><li><em>event Transfer(address indexed from, address indexed to, uint tokens)</em> : event that occurs after <em>transferFrom</em> and <em>transfer</em></li><li><em>event Approval(address indexed tokenOwner, address indexed spender, uint tokens)</em> : event that happens after <em>approve.</em></li></ul><p>There are two token transfer methods in ERC20. The first method is to use <em>transfer()</em>. With <em>transfer(), </em>you can instantly transfer the desired number of tokens to another user, and the receiving user can immediately see that the token has been added to his or her account.</p><p>In the case of <em>transfer()</em>, it is not a problem to send tokens to a user. However, there is a problem when that token is transferred in return for calling a smart contract. For instance, GoCryptobot’s exchange receives GCC from the user and exchanges it for Ether. If the user directly transfers GCC to the address of the exchange, the exchange will know how much GCC every user has sent and how much Ether to return to each respective user.</p><p>Using the <em>approve()</em> and <em>transferFrom()</em> functions specified in ERC20, you can solve the problems mentioned above. First, a user who wants to send tokens should use the <em>approve()</em> function to allow the spender to take any number of tokens as many times as the spender wants. Then the spender can use the <em>transferFrom()</em> function to get the amount of money he/she wants from the allowed amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*3RhVzOKZ2n_YM1HX" /></figure><p>Now, the exchange at GoCryptobot user can add the GCC amount to be exchanged into <em>allowed</em> pile, and the exchange will use <em>transferFrom()</em> function in order to exchange the amount of money that is in <em>allowed.</em></p><p>The GoCryptobot exchange will be described in more detail in the next blog.</p><h4>Let’s Take a Closer Look through the GCC Implementation</h4><p>GCC consists of the following contracts. Each contract is modularized in a way that sequentially inherits other tracks in order. In other words, the contract called <em>GoCryptobotCoinCore</em> contains all the other contracts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*GDYY01x9s0M2RvGl" /></figure><p>GCC has implemented ERC827 in a somewhat unusual way. ERC827 is an extended interface of ERC20 and includes the function to accept data with the parameters of <em>approve()</em> and <em>transferFrom()</em> and perform a contract call at the end of the function. With this feature, <em>approve() </em>and <em>transferFrom()</em> functions can be called sequentially in a transaction. I will explain ERC827 in detail in my next article when discussing GoCryptobot’s exchange.</p><p>Most codes related to ERC20 are derived from <a href="https://github.com/OpenZeppelin/openzeppelin-solidity">OpenZeppelin</a>’s code.</p><pre>contract GoCryptobotCoinERC20<br>contract GoCryptobotCoinERC827 is GoCryptobotCoinERC20<br>contract GOCryptobotCoinCore is GoCryptobotCoinERC827</pre><h4>GoCryptobotCoinERC20: A Contract that has All of ERC20 Interface Implemented</h4><p>Just by looking at the contract’s name, you can tell that this contract is an ERC20 interface implementation.</p><pre>string public constant name = &quot;GoCryptobotCoin&quot;;<br>string public constant symbol = &quot;GCC&quot;;<br>uint8 public constant decimals = 3;</pre><p>This contains name, symbol, and decimals, which explains the token’s contract. Decimals represent the decimal point. Since decimals is 3 here, 1 Token equals 0.001GCC within the contract. Ether and other tokens generally have decimals of 18 digits. In order to prevent the token from disappearing due to floating-point errors, the blockchain expresses the decimal point by storing the token quantity as an integer only and specifying the decimals.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7de980e6e387fa1adbbd3ca8b1f0a96/href">https://medium.com/media/a7de980e6e387fa1adbbd3ca8b1f0a96/href</a></iframe><p>ERC20 has a function that takes the sum of the tokens and the user’s balance according to its specification.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcacb45c2fc52e22b7441a2b63f51ee6/href">https://medium.com/media/bcacb45c2fc52e22b7441a2b63f51ee6/href</a></iframe><p>The <em>transfer</em> function that transfers tokens to another user returns a success or failure value. If the <em>address</em> input is wrong or a larger amount of tokens than that of the balance is attempted to be sent, it will result in the failure of the <em>require </em>function.</p><pre>require is used to check the user&#39;s input.If the require parameter is false, the remaining gas is returned and the transaction fails.</pre><p>The <em>transfer</em> function can be implemented simply by subtracting <em>_value</em> from <em>msg.sender</em>’s balance and then adding it to <em>_to. </em>At the end of the function, the log is recorded by leaving the <em>Transfer</em> event.</p><pre>library SafeMath {<br>  function sub(uint256 a, uint256 b) internal pure returns (uint256) {<br>  assert(b &lt;= a);<br>  return a - b;<br>  }<br>}</pre><pre>balances[msg.sender] = balances[msg.sender].sub(_value);</pre><p>We are using the <em>sub()</em> function of the SafeMath library to reduce the <em>balance</em>. If the <em>balances</em> of <em>msg.sender </em>are less than <em>_value</em>, the <em>assert()</em> within the <em>sub()</em> function will revert the previous state and the transactions will fail, so the balance can be safely deducted.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76097bc901b1c2a2c21c1de127b53586/href">https://medium.com/media/76097bc901b1c2a2c21c1de127b53586/href</a></iframe><p>The <em>transferFrom()</em> and <em>approve()</em> functions mentioned earlier are also implemented as above.</p><p>The ERC20 standard specifies that <em>approve()</em> should be re-transmitted to change the allowed tokens through <em>approve()</em>. However, if <em>approve()</em> is re-transmitted, there is a possibility of an attack. Assume a situation in which a transaction that <em>approve()</em> 30GCC is released and then changed to 20GCC. In the moment you approve 30GCC, the spender can call the <em>transferFrom() </em>function to move 30GCC to the spender’s balance. The user does not know about this situation and calls <em>approve()</em> to change to 20GCC. Then the spender can use a total of 50GCC. In order to prevent this situation, ERC20 standard recommends that changing the allowed value to 0 before calling approve to change the GCC amount. When it comes to GCC, <em>increaseApproval()</em> and <em>decreaseApproval()</em> functions are implemented to provide safe editing of the allowed amount.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f49554a91ece37c19a3fe840f51ef3f/href">https://medium.com/media/3f49554a91ece37c19a3fe840f51ef3f/href</a></iframe><p>By using these two functions, one can stop potential attacks described above.</p><p>GCC has implemented the ERC20 interface splendidly, and has enhanced its security by using <em>increaseApproval()</em> and <em>decreaseApproval()</em>. It even includes ERC827, which further propels its usability.</p><p>The contents thus far could be summarized as follows:</p><ul><li>ERC20 has an approve / <em>transferFrom</em> function to send tokens to the Smart Contract.</li><li>GCC uses <em>approve </em>when sending tokens to exchange contracts and it also has an extended functionality of ERC827.</li></ul><p>ERC20 token sounds like something grandiose, but if you dig into it, implementation is quite simple and you can even create your own token by simply changing the token’s name of already implemented code. I believe that the effort that went into creating Ethereum’s ERC20 standard will have a positive impact in the DAPP ecosystem since anyone can easily create compatible currencies.</p><p>You can download GoCryptobot through the links below:</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a></p><p><strong>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><p>(For the Korean version of this article, click <a href="https://medium.com/gocryptobot/gocryptobot-gcc%ED%86%A0%ED%81%B0%EC%9C%BC%EB%A1%9C-%EB%B0%B0%EC%9A%B0%EB%8A%94-erc20-%ED%91%9C%EC%A4%80-9fc75f8505ac">here</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d04e6f7218e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/learning-about-erc20-standard-through-gocryptobots-gcc-token-9d04e6f7218e">Learning About ERC20 Standard Through GoCryptobot’s GCC Token</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Does GoCryptobot’s PvP Run on the Blockchain? — PvP Source Code Analysis]]></title>
            <link>https://medium.com/gocryptobot/how-does-gocryptobots-pvp-run-on-the-blockchain-pvp-source-code-analysis-1fb27dec3801?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/1fb27dec3801</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[pvp]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Wed, 23 May 2018 06:54:44 GMT</pubDate>
            <atom:updated>2018-06-25T03:49:34.496Z</atom:updated>
            <content:encoded><![CDATA[<p>The first mobile blockchain game, GoCryptobot(<a href="https://gocryptobot.io/">https://gocryptobot.io</a>) was released. The game items are created and exchanged on a blockchain, and thus, the user will have 100% ownership upon purchasing an item. Furthermore, the items can be sold through the market at any time. The blockchain applications are not only limited to the Market, as users can play the PvP mode, where users compete with each other’s parts, and the results of the PvP can be transparently verified.</p><p>This article aims to analyze GoCryptobot’s PvP system’s source code. I wanted to explain how PvP is processed, including the score calculation algorithm, so that users can better enjoy the PvP contents. Furthermore, I hope to be of aid to those who are starting to study the blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qSReBE2qrw4018XMuvgQg.jpeg" /></figure><h3><strong>PvP Source Code</strong></h3><p>GoCryptobot’s PvP source code is revealed in the GitHub link below. The source code is around 300 lines, and I plan to explain these lines in detail.</p><p><a href="https://github.com/gocryptobot/gocryptobot-pvp-contract">Gocryptobot GitHub Repository</a></p><h3><strong>PvP Runs Transparently on the Blockchain Platform</strong></h3><p>The PvP involves 128 players being divided into 4 teams. Each player’s robot parts contribute to the team’s win depending on the part’s stats. The winning team receives prize money.</p><p>PvP has a total of 4 rounds in a single match. Each round calculates scores depending on a certain body part, level, skill level, and the color. At this point, the contract chooses one of the two random colors as the Lucky Color. If the player’s part matches the Lucky Color, then he/she receives bonus points. The team that scores the highest collectively will be the ultimate winners. If there happens to be an equal score among teams, the contract will randomly choose a team as the winner.</p><p>If you want to learn more about the the PvP, then check out this <a href="https://medium.com/gocryptobot/go-cryptobot-strategy-guide-the-road-to-cryptoking-1c02911f54e">link</a>.</p><p>The contracts being used in PvP are all divided into different files, and are modularized so that each contract inherits from the previous contract. Thus, the <strong>GoCryptobotCore </strong>is the final contract, and all data and functions are included within it.</p><pre>contract <strong>GoCryptobotAccessControl</strong><br>contract <strong>GoCryptobotRandom</strong> is GoCryptobotAccessControl<br>contract <strong>GoCryptobotScore</strong> is GoCryptobotRandom<br>contract <strong>GoCryptobotRounds</strong> is GoCryptobotScore<br>contract <strong>GoCryptobotCore</strong> is GoCryptobotRounds</pre><h3><strong>GoCryptobotAccessControl: Managing the Owner that has Complete Authority</strong></h3><p>The Smart Contract cannot be edited once deployed, and thus, when problems arise, it is commonplace to implement a pattern that stops the contract itself. With this contract, the <em>Owner</em> can use the <em>pause()</em> function to pause the contract, and <em>unpause()</em> to reboot the contract.</p><p><em>GoCryptobotAccessControl</em> only allows the owner to be able to call <em>pause()</em> and <em>unpause()</em>, and this is the modifier that defines this:</p><pre>bool public paused;</pre><pre>modifier onlyOwner() {<br>  require(msg.sender == owner); _;<br>}<br>modifier onlyOperator() {<br>  require(msg.sender == operator); _;<br>}<br>modifier onlyOwnerOrOperator() {<br>  require(msg.sender == owner || msg.sender == operator); _;<br>}<br>modifier whenPaused() {require(paused); _;}<br>modifier whenNotPaused() {require(!paused); _;}</pre><pre>function pause() public onlyOwnerOrOperator whenNotPaused {<br>  paused = true;<br>}</pre><pre>function unpause() public onlyOwner whenPaused {<br>  paused = false;<br>}</pre><p>The <em>pause()</em> function can only be called by the Owner and Operator as defined by the <em>onlyOwnerOrOperator</em> modifier.</p><p>There also exists a function that can change the Owner and the Operator.</p><pre>address public owner;<br>address public operator;</pre><pre>function transferOwnership(address newOwner) public onlyOwner {<br>  require(newOwner != address(0));<br>  owner = newOwner;<br>}</pre><pre>function transferOperator(address newOperator) public onlyOwner {<br>  require(newOperator != address(0));<br>  operator = newOperator;<br>}</pre><h3><strong>GoCryptobotRandom: For a Transparent PvP Experience</strong></h3><p>When it comes to Ethereum, no matter which node runs the code, the exact same result must be returned. This is how each and every transaction can be verified, and thus, random functions cannot exist. So how can we create a random function for our game, if there is a random factor in the game itself, while also needing to use the Ethereum blockchain?</p><p>This contract uses the Commitment Scheme to provide a random seed from the block hash, which can be used in the PvP.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0710c186b9f4d815b2a2af322abc9a3e/href">https://medium.com/media/0710c186b9f4d815b2a2af322abc9a3e/href</a></iframe><p>Once the match starts, the game server that operates the PvP will call the contract function twice.</p><p>First, it will call the <em>commitment()</em> function, and at this point, once the transaction that called commitment has been mined in the Ethereum Network, the number will be stored in the <em>commitmentNumber</em> variable.</p><pre>commitmentNumber = block.number;</pre><p>The <em>block.number</em> is solidity’s special variable that brings the current block’s number.</p><p>Once the commitment function has been mined, the Operator will call the <em>run()</em> function that is within the <em>GoCryptoBotRounds</em> contract. Once the <em>_initRandom()</em> function within the <em>run() </em>function is called, the block that corresponds with the commitmentNumber will have its hash value used to set the random seed, <strong><em>randomBytes</em></strong>.</p><pre>randomBytes = block.blockhash(commitmentNumber);</pre><p>Here, the <em>block.blockhash</em> is a special function that provides the current block hash.</p><p>The <em>_random256() </em>function uses the <strong>keccak256 </strong>hash function to hash <em>randomBytes</em> so that a random number can be created.</p><h3><strong>GoCryptobotScore: An Attempt to Lower Gas Fees</strong></h3><p>This contract calculates the user’s PvP score. The unique part is how it stores and brings the user’s information. The reason this system was made this way is to reduce Ethereum’s gas usage.</p><p>In order to reduce gas usage, we first reduced the amount of data. To do this, we divided a single array into many offsets to store and use data.</p><p>Broadly speaking, the user data contains whether the Theme Effect is active, and whether all 4 parts are included. Each part’s data includes information about its 3 skills and its parts level and color.</p><p>If we were to visualize this data structure, it’s as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/0*JMmHz_TBdUdVGuKz." /><figcaption>Skill, Part, Player data format</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e8f6f8c59e47141a99c4b930aad853b/href">https://medium.com/media/3e8f6f8c59e47141a99c4b930aad853b/href</a></iframe><p>Furthermore, since the offset is used to bring data, and thus, a getter function is required.</p><pre><em>*internal modifier can only be accessed from within the contract.<br>*private is similar to internet, but it cannot be accessed from an inherited contract.</em></pre><p><strong>The way PvP calculates the score</strong> is as follows:</p><ul><li>There are 4 types of colors, and each round offers a possibility of 2 colors. When the <em>run()</em> contract is called, a color is chosen out of the 2. The chosen color is the major color and the other is the minor color.</li><li>If Theme Effect is inactive — if the part has the major color, then the part’s skill level’s sum times 3 is rewarded as the score. If the part has the minor color, then it will be times 1.</li><li>If Theme Effect is active — if the part has the major color, then the part’s skill level’s sum times 4 is rewarded as the score. If the part has the minor color, then it will be times 2.</li><li>Finally, the part’s level is added to the score, which results in the final score.</li></ul><p>The actual function that calculates the PvP score is as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5bc1c1407b2f2c81ba2bae66605ed8e/href">https://medium.com/media/d5bc1c1407b2f2c81ba2bae66605ed8e/href</a></iframe><h3><strong>GoCryptobotRound: Legitimate PvP Match Process</strong></h3><p>Once <em>GoCryptobotRandom</em>’s commitment transaction is mined, then it is time to actually continue the PvP process.</p><p>The PvP Operator will run the <em>run()</em> function, and its functionalities are as follows:</p><ul><li>Reset the random seed</li><li>Randomly choose the Lucky Color(minor, major)</li><li>Add the score</li><li>Choose the winning team, and call the Completion Event.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/881ef11b931749e7f44a35f86cab45d2/href">https://medium.com/media/881ef11b931749e7f44a35f86cab45d2/href</a></iframe><p>As mentioned earlier, once <em>_initRandom</em>() is called, the block’s hash stored in the <em>commitmentNumber</em> within the <em>GoCryptobotRandom</em> contract can be used as a random seed.</p><p>Even in the function <em>_shuffle()</em>, which chooses each round’s major and minor colors, you can see that a lot of effort went into reducing the gas usage.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5385fac2b81b7939dc40b2789a1ee584/href">https://medium.com/media/5385fac2b81b7939dc40b2789a1ee584/href</a></iframe><p>Random byte values can be continuously made by repeating the Keccak hash; however, in order to reduce gas usage, we hash it only once and get a random numbers in bytes.</p><pre>random = uint8(randomBytes[i % 32]) % (deckLength - i);</pre><p><em>_shuffle</em>’s deck parater is an array that has a total of 8 numbers, each being either 0 or 1. By going through random swap 8 times, the Lucky Color array is mixed. The 4 numbers in the frontal index is used in each round’s major color.</p><p><em>_shuffle</em> is used to choose the major and minor colors. Then each team’s total points and the winning team are decided.</p><pre>uint[4] memory totalScores;</pre><p>You can see that within the <em>run()</em> function, the keyword “memory” is added when declaring a variable. In Ethereum, variables such as arrays and structs are stored in the storage by default. The variables stored in the storage are not deleted even when the call is over. This also eats up a lot of gas. In contrast, variables that are stored in memory are deleted upon the end of the function, and in comparison, uses less gas. Thus, variables such as <em>totalScores</em> that are used temporarily should be stored in the memory for efficiency.</p><pre>AllFinished(totalScores[0], totalScores[1], totalScores[2], totalScores[3]);</pre><pre>WinnerTeam(candidates, candidates[0]);</pre><pre>RoundFinished(eventType, eventMajorColor, eventMinorColor, scores[0], scores[1], scores[2], scores[3]);</pre><p>Once score calculation is finished, <strong><em>AllFinished</em></strong>, <strong><em>WinnerTeam</em></strong>, and <strong><em>RoundFinished</em></strong> events are called, and the Operator gives the rewards to the appropriate users depending on the contract’s result’s event logs.</p><h3><strong>Time to Participate in PvP!</strong></h3><p>We have analyzed GoCryptobot PvP’s source code. The logic is very simple as in getting the user’s information and calculating a certain score out of it and returning the results. However, the contract’s source code is pretty complicated.</p><p>It was possible to make a transparent and verifiable PvP game through complex code shown above. Since you now know how the scores are being calculated, I hope the PvP became a bit more enjoyable overall.</p><p>GoCryptobot can be downloaded for each respective OS through the links below:</p><ul><li><strong>App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a></li><li><strong>Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></li></ul><p>(For the Korean version of this article, click <a href="https://medium.com/gocryptobot/gocryptobot%EC%9D%98-pvp%EB%8A%94-%EB%B8%94%EB%A1%9D%EC%B2%B4%EC%9D%B8-%EC%9C%84%EC%97%90%EC%84%9C-%EC%96%B4%EB%96%BB%EA%B2%8C-%EB%8F%8C%EC%95%84%EA%B0%80%EA%B3%A0-%EC%9E%88%EC%9D%84%EA%B9%8C-pvp-%EC%86%8C%EC%8A%A4%EC%BD%94%EB%93%9C-%EB%B6%84%EC%84%9D-2156ad8ba064">here</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fb27dec3801" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/how-does-gocryptobots-pvp-run-on-the-blockchain-pvp-source-code-analysis-1fb27dec3801">How Does GoCryptobot’s PvP Run on the Blockchain? — PvP Source Code Analysis</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing a Blockchain Game, a New Field of Its Own]]></title>
            <link>https://medium.com/gocryptobot/developing-a-blockchain-game-a-new-field-of-its-own-519fae795746?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/519fae795746</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Mon, 21 May 2018 08:47:31 GMT</pubDate>
            <atom:updated>2018-05-28T00:49:08.737Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been about a week since GoCryptobot, a blockchain game that I developed at Kodebox, has been released. Even at this moment, Ether is being traded for GCC through the Smart Contract within the game, and the PvP, an event where up to 128 players can participate in, is being held up to 6 times per day. Since there are only a few mainstream blockchain games out there, especially for the mobile platform, we faced a variety of new, difficult cases never documented before. In this article, I plan on discussing these problems and solutions in detail, and the points of caution I suggest you to consider when making a blockchain game. I hope this can be helpful for blockchain game development teams out there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lyY4M6KuvXPMenjM." /></figure><h3><strong>1. We Never Know When a Transaction Will Be Mined: Don’t Make Match/Game Schedules Too Tight</strong></h3><p>In GoCryptobot, there are 6 PvP matches everyday. Before every match, users must register for the PvP and when the match starts, a Smart Contract that calls the transactions will be called. Ethereum’s PoW protocol requires around 15 more blocks in order to guarantee finality. At first, we thought that 10 minutes would be enough for this process. However, there were many cases where the transactions did not mine in time, and the PvP match did not successfully terminate at the 10 minute mark.</p><p>We decided that the 10 minute window was too small to guarantee every PvP match, and thus, extended the time to 20 minutes.</p><h3><strong>2. When Urgent, Raise the Gas Price and Retransmit</strong></h3><p>If the mining just isn’t happening due to low gas price setting, then you should increase the gas price and create another transaction.</p><p>When creating another transaction with a higher gas fee, the transaction’s nonce value has to be identical to the transaction sent previously, or else it would be like a sending a completely new transaction and have no priority. This is because transactions are mined based on the nonce values in the Ethereum network. The transactions with the lower gas fee will be ignored if there is another transaction that has been mined with the same nonce value.</p><p><em>web3.eth.sendTransaction()</em></p><p><em>myContract.methods.myMethod()</em></p><p>In Web3, the nonce value can be set with the above functions.</p><h3><strong>3. Ethereum Accounts Should Be Separated Depending on Purpose</strong></h3><p>Mining rates depend on the amount of gas. There are transactions that need to be mined quickly or slowly depending on the situation. As mentioned above, Ethereum transactions are processed in a first-come-first-serve basis, and using a single account to process multiple transactions will render you unable to change gas fees to speed up the mining rates. Even if you raise the gas fee to speed up a certain transaction, it will have to wait for the previous transaction to finish. If that previous transaction has a low gas fee, then it will be a bottleneck for the following transactions.</p><p>Thus, depending on usage and purpose, Ethereum accounts should be used separately.</p><h3><strong>4. Let’s Be Attentive to Gas Fees</strong></h3><p>Gas fees are constantly fluctuating, and thus, if you want guaranteed results in the blockchain, then you must implement a system that automatically changes the gas fees depending on the situation.</p><p>By doing this, you can use gas fees that range between 10~30 Gwei, and edit gas fees when appropriate.</p><h3><strong>5. Unpredictable Error in the Web3 Library</strong></h3><p>When creating a transaction from the Web3 library, there were errors that occured. There was an error when a transaction was not mined within 50 blocks; however, it was confirmed that this transaction was actually mined later in the Ethereum network.</p><p><em>“Error: Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!”</em></p><p>The function that transfers GCC into Ether has an exchange logic that is enveloped by the DB transaction. If there is an Error like above, then our system is set to rollback. However, if the mining has actually been complete, the server DB has been rolled back, and the Ethereum has actually been transferred to another user, which actually sounds like absolute catastrophe.</p><p>In order to solve this problem, we decided to make a function that detects when Web3 has an error, and notifies the developer.</p><h3><strong>Conclusion</strong></h3><p>This concludes my experience of developing the mobile blockchain game, GoCryptobot. The contents may sound cliche; however, there are large amounts of money involved when creating a system such as this, and since blockchains are not forgiving when it comes to editing already transmitted data, I hope this article can help you to reinforce your own blockchain app that is either in or finished development.</p><p>GoCryptobot can be downloaded through the links below:</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a></p><p><strong>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><p>(For the Korean version of this article, click <a href="https://medium.com/gocryptobot/%EC%95%84%EC%A7%81%EC%9D%80-%EB%AF%B8%EA%B0%9C%EC%B2%99%EC%A7%80%EC%9D%B8-%EB%B8%94%EB%A1%9D%EC%B2%B4%EC%9D%B8-%EA%B2%8C%EC%9E%84%EC%9D%84-%EA%B0%9C%EB%B0%9C%ED%95%98%EB%A9%B4%EC%84%9C-63951f6ef7f">here</a>.)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=519fae795746" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/developing-a-blockchain-game-a-new-field-of-its-own-519fae795746">Developing a Blockchain Game, a New Field of Its Own</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Crypto-games Give Developers a Headache]]></title>
            <link>https://medium.com/gocryptobot/why-crypto-games-give-developers-a-headache-da43e136de5d?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/da43e136de5d</guid>
            <category><![CDATA[gocryptobo]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Fri, 18 May 2018 05:28:31 GMT</pubDate>
            <atom:updated>2018-05-28T00:49:52.576Z</atom:updated>
            <content:encoded><![CDATA[<p>If you decide to make a Crypto-game, then you will have to think of solutions for different types of problems. This article will discuss what kind of problems my team and I had to face and solve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*KsQXuC_NloAk-w4eKIoi0w.jpeg" /></figure><p><strong>Where Does the Transaction Take Place?</strong></p><p>If the game you are making is a blockchain game that utilizes Ethereum, transactions are the first things you should consider. Will the game client itself send contract calls, or will the server be responsible for that? Depending on your decision, the game’s characteristics will become very different. Sending a transaction through the game client is a more decentralized method. However, this method causes issues related to time and fees. Conversely, if the server sends the transaction, it’s more efficient, yet less decentralized.</p><p>If you’ve decided to send the transaction from the game client, then please read the article below. It is about using the Nethereum library to use Ethereum’s functionalities.</p><p><a href="https://medium.com/gocryptobot/interlocking-unity-and-an-ethereum-node-using-nethereum-d4a793bba2a9">Integrating Unity and an Ethereum Node Using Nethereum</a></p><p>If you’ve decided to send the transaction from the game client, then you will face the following problem: “How is it possible to safely perform transactions safely when a node is not a full node?”</p><p>Ethereum has something called a full node, which verifies transactions and blocks before relaying, making the network more secure. This is possible because it contains the entire transaction history, and every user is aware of the full node. Even web3, which is considered a basic connector of Ethereum, presumes that each individual operates a full node.</p><p>However, it is impossible for all the users to operate a full node. Thus, we need a method for users that are not a full node to safely make transactions. The article below is about that topic.</p><p><a href="https://medium.com/gocryptobot/creating-a-useable-dapp-from-ethereum-without-a-wallet-full-node-a71095ee8168">Creating a Usable DApp from Ethereum Without a Full Node Wallet</a></p><p><strong>Making an Exchange</strong></p><p>Although it may depend on the type of game being developed, a game where the client connects to Ethereum directly is very limited in terms of functionality. This is because of transaction fees, coupled with time consumption. Each action will cost from a few cents to a couple of dollars, and making a game with that kind of transaction fee is impossible. Therefore, a compromise must be made, and making the game server into a “small scale exchange” is a solution for this problem.</p><p>The article below explains what exactly is a “small scale exchange” and why it is necessary for these types of scenarios.</p><p><a href="https://medium.com/gocryptobot/developing-a-small-scale-ethereum-exchange-for-service-purposes-3f82eb8ecb50">Developing a Small Scale Ethereum Exchange for Service Purposes</a></p><p>After creating a “small scale exchange”, various accounts must be managed. Managing numerous accounts’ private keys is no simple task. In this situation, a solution would be to use Bitcoin’s HD Wallet, which allows multiple accounts to be safely managed through one private key. The article below discusses this in more detail.</p><p><a href="https://medium.com/gocryptobot/tips-on-managing-multiple-accounts-when-developing-an-ethereum-based-small-scale-exchange-e1146250172">Tips on Managing Multiple Accounts When Developing an Ethereum Based Small Scale Exchange</a></p><p><strong>Publishing</strong></p><p>After going through all of these dilemmas and problems, GoCryptobot came to fruition. You can download it at the App Store or Google Play in the links below:</p><ul><li><a href="https://itunes.apple.com/app/id1357491624">GoCryptobot on the App Store</a></li><li><a href="https://play.google.com/store/apps/details?id=com.kodebox.gocryptobot">GoCryptobot - Apps on Google Play</a></li></ul><p>(For the Korean version of this article, click <a href="https://medium.com/gocryptobot/%ED%81%AC%EB%A6%BD%ED%86%A0-%EA%B2%8C%EC%9E%84%EC%9D%84-%EB%A7%8C%EB%93%A4-%EB%95%8C-%EA%B3%A0%EB%A0%A4%ED%95%A0-%EA%B2%83-acc379c9bf3a">here</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da43e136de5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/why-crypto-games-give-developers-a-headache-da43e136de5d">Why Crypto-games Give Developers a Headache</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Usable DApp from Ethereum Without a Full Node Wallet]]></title>
            <link>https://medium.com/gocryptobot/creating-a-useable-dapp-from-ethereum-without-a-wallet-full-node-a71095ee8168?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/a71095ee8168</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[wallet]]></category>
            <category><![CDATA[dapps]]></category>
            <category><![CDATA[cryptokitties]]></category>
            <category><![CDATA[gocryptobot]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Wed, 16 May 2018 13:46:35 GMT</pubDate>
            <atom:updated>2018-05-28T00:50:28.630Z</atom:updated>
            <content:encoded><![CDATA[<p>In order to use a DApp that works in Ethereum, you need a wallet software. Through the wallet software, you can manage your account and call the Smart Contract’s function. In a public blockchain such as Ethereum and Bitcoin, you cannot trust any other user but yourself. Thus, users of a DApp must have the entire history of the blockchain and be able to personally verify the Smart Contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlcTpFJnBY-HE2b6VqLtmA.jpeg" /></figure><p>However, these type of models are not used for normal users’ DApp. To require a download of that exceeds 100GB just to use DApp’s services is overkill. Even the most demanding movies or games currently do not exceed 100GB. Requiring 100GB of data just to use a simple DApp is unquestionably inefficient.</p><p><strong>CryptoKitties and MetaMask</strong></p><p>This is why DApps such as CryptoKitties recommend the usage of <a href="https://metamask.io/">MetaMask</a>. It is a lightweight wallet that can be installed as a web browser’s plugin. However, this wallet is not really a proper Ethereum wallet. MetaMask does not hold the block’s history. It trusts other Ethereum nodes that exists externally. What MetaMask itself does is to manage the private key locally, and sign the transaction and send it to a trustworthy Ethereum node.</p><p>Just as the example discussed above, CryptoKitties utilizes the MetaMask, and shows us that a DApp for the typical user does not need to hold onto the entire history. All it needs is a private key management system and a functionality that allows it to sign and send the transactions that it calls.</p><p><strong>Hardships in the Development Environment</strong></p><p>However, if you were to look up methods on how to make a DApp for Ethereum, most introduce ways that depend on the user’s wallet. Even Web3’s library’s basic functions(send transaction, using Smart Contract) can be only used in situations where the wallet manages the private key.</p><p>DApp developers prefer a situation where the developer operates the full node wallet, and the users hold onto their private key only and connect to the developer’s wallet. However, Ethereum wallets Geth and Parity do not offer this kind of functionality. When it comes to Geth or Parity, the program itself handles the private key.</p><p>This does not, however, mean that there is no other way. In the web3 or JSON RPC standard, there exists a function called <em>sendRawTransaction</em>. This function is an API that accepts a signed transaction and processes it. With this function, the user can send transactions without having to reveal his/her private key while using a wallet, such as Geth or Parity.</p><p><strong>If Working With JavaScript</strong></p><p>There is a library called <a href="https://github.com/ConsenSys/eth-lightwallet">eth-lightwallet</a> created by Consensys. With this library, it is possible to personally manage the private keys through a web browser. Furthermore, it is possible to use those private keys for creating signed transactions.</p><p>With transactions created this way can be sent to the full node using <em>web3.eth.sendRawTransaction</em>. This method allows users to use DApp without having to download large amounts of data.</p><p><strong>If Working with C#</strong></p><p>Nethereum is the C# version of web3 library. The unique part of this is that it uses <em>sendRawTransaction</em> by default<em>. </em>When using the <em>Account </em>class and either <em>sendTransaction </em>or the Smart Contract’s function is called, it automatically uses <em>sendRawTransaction</em>. If <em>ManagedAccount </em>is used, it is possible to access the connecting account’s wallet, just like web3’s default behavior.</p><p><strong>How About Security?</strong></p><p>This method where the DApp’s user does not operate the full node has weaker security than if the user does operate the full node. This is because the user cannot tell whether the full node that he/she is connected to is giving false information or not. However, I believe this is not a very big problem. Even the most successful DApp, CryptoKitties, supports MetaMask as their recommended Ethereum wallet. There is always a bit of a tradeoff for comfort.</p><p><strong>Conclusion</strong></p><p>Every Dapp tutorials assume that all data was stored in the user’s full node wallet. However, with <em>sendRawTransaction</em>, the user does not have to carry such a heavy wallet, and still make an exceptionally functional DApp. (For the Korean version of this article, click <a href="https://medium.com/gocryptobot/ethereum%EC%97%90%EC%84%9C-%EC%A7%80%EA%B0%91-full-node-%EC%97%86%EC%9D%B4-%EC%93%B8-%EC%88%98-%EC%9E%88%EB%8A%94-dapp%EB%A7%8C%EB%93%A4%EA%B8%B0-8d66c88705c">here</a>).</p><p>Last but not the least! Now it’s time to enjoy GoCryptobot. <br>Download from here :)</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a><strong><br>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a71095ee8168" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/creating-a-useable-dapp-from-ethereum-without-a-wallet-full-node-a71095ee8168">Creating a Usable DApp from Ethereum Without a Full Node Wallet</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Unity and an Ethereum Node Using Nethereum]]></title>
            <link>https://medium.com/gocryptobot/interlocking-unity-and-an-ethereum-node-using-nethereum-d4a793bba2a9?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/d4a793bba2a9</guid>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[nethereum]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Wed, 16 May 2018 11:40:24 GMT</pubDate>
            <atom:updated>2018-05-28T00:50:16.522Z</atom:updated>
            <content:encoded><![CDATA[<p>Intro to Nethereum</p><p><a href="https://nethereum.readthedocs.io/en/latest/">Nethereum</a> is a library that facilitates the use of JSON RPC offered in an Ethereum Client, such as Geth or Parity, in C#. This can also be considered a C# version of the Web3 library, offered in JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*hH66P6auPXyVNP3d244YDA.png" /></figure><p><strong>Nethe</strong>r<strong>eum’s Unity Support</strong></p><p>If you visit the <a href="https://nethereum.com/">Nethereum library’s web page</a>, it indicates that it supports Unity. With this library, one can use Ethereum in a mobile game developed on the Unity platform. It is even possible to take advantage of Ethereum’s Smart Contract. If you are planning on making a game that is more complex than Crypto Kitties, then I suggest you use Unity with the Nethereum library.</p><p>Sounds great, but using Nethereum in Unity is not a seamless process. This is because Unity uses a low version of .Net. Thus, it is not possible to use many enticing API offered by Nethereum. You must use the API offered separately for Unity only. Furthermore, there are problems in the documentation itself. The documents only provide information about environments not related to Unity. Thus, trying to use Nethereum in Unity after reading the documentation is a huge pain for the developer. The functions specified in the official documentation cannot be used in Unity.</p><p>Going forward, I shall discuss my own experiences in using Nethereum in conjunction with Unity.</p><p><strong>Downloading Library for Unity</strong></p><p><a href="https://github.com/Nethereum/Nethereum/releases">https://github.com/Nethereum/Nethereum/releases</a></p><p>You must download Nethereum.Unity.zip from GitHub’s release page. If you get the library through other methods, such as nuget, then it will not work with Unity.</p><p><strong>How to Use</strong></p><p>Usually, when using the library for the first time, you would check out the official documentation. Then you would probably follow the tutorial offered in that documentation. However, in Nethereum, there is no official documentation on how to use it in Unity. Although there is nothing official, there is a blog that gives us a simple explanation on how to use this library.</p><p><a href="https://medium.com/@juanfranblanco/nethereum-2-0-0-rc5-unity3d-integration-eb7664664813">Nethereum 2.0.0 rc5 — Unity3d integration</a></p><p><a href="https://medium.com/@juanfranblanco/nethereum-2-0-0-rc5-unity3d-integration-eb7664664813">I am happy to report that the new release of Nethereum includes support for Unity3d, also you can play the demo game…medium.com</a></p><p><strong>Functions Offered by the Library</strong></p><h4>Nethereum that is distributed for Unity purposes have the following functionalities:</h4><ol><li>Web3’s APIs</li><li>There are functions in the <em>Nethereum.JsonRpc.UnityClient</em> namespace that correspond 1:1 with web3’s API. For instance, one can acquire the Account’s balance, send a Transaction, call the Contract, etc.</li><li>Create a private key, and sign.</li><li>Allows the creation of an Ethereum account or signing of arbitrary data by using the functions of <em>EthECKey</em> that is under the <em>Nethereum.Signer</em> namespace.</li><li>Sign offline.</li><li>By using <em>TransactionSignedUnityRequest</em>, one can sign the transaction within the game before sending. With this functionality, the user’s private key does not need to be send to the Ethereum node, and can be managed in the game itself. (For more information, please check this <a href="https://medium.com/@koreanboy1120/creating-a-useable-dapp-from-ethereum-without-a-wallet-full-node-a71095ee8168">link</a>.)</li></ol><p><strong>Conclusion</strong></p><p>Nethereum provides many useful functionalities. However, there is insufficient information and documentation for the Unity game engine. I hope this short article will be helpful in making your own game that is interlocked with Ethereum. (For the Korean version of this article, click <a href="https://medium.com/gocryptobot/unity%EC%97%90%EC%84%9C-nethereum%EC%9C%BC%EB%A1%9C-ethereum-%EB%85%B8%EB%93%9C%EC%99%80-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0-1469a8b1d476">here</a>.)</p><p>Last but not the least! Now it’s time to enjoy GoCryptobot. <br>Download from here :)</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a><strong><br>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4a793bba2a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/interlocking-unity-and-an-ethereum-node-using-nethereum-d4a793bba2a9">Integrating Unity and an Ethereum Node Using Nethereum</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips on Managing Multiple Accounts When Developing an Ethereum Based Small Scale Exchange]]></title>
            <link>https://medium.com/gocryptobot/tips-on-managing-multiple-accounts-when-developing-an-ethereum-based-small-scale-exchange-e1146250172?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/e1146250172</guid>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Wed, 16 May 2018 05:16:00 GMT</pubDate>
            <atom:updated>2018-05-28T00:51:11.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88lIWlAdDGJV0dvoap1HhA.png" /></figure><p>Continued from the <a href="https://medium.com/gocryptobot/developing-a-small-scale-ethereum-exchange-for-service-purposes-3f82eb8ecb50">previous article</a>, let’s discuss what is needed to create a small scale exchange. In order to receive Ethereum from the exchange, each user must be assigned an address for deposit. The simplest implementation is as follows: every time a new user is registered, create a random private key and store it, and use that private key to assign addresses for users.</p><p>This results in the amount of private keys equaling the number of users in the database. ETH that has been deposited this way are sometimes sent to our exchange address all at once.</p><p>However, there is a disadvantage with this design, which is the fact that the server that confirms the deposits of ETH also manages the private key. When dealing with Ethereum, the private key is extremely pivotal information. Once revealed, one can lose all of his/her ETH in possession. Storing and managing this kind of information on a server that is connected to a network is extremely dangerous.</p><h4>Cold Wallet</h4><p>A Cold Wallet is an Ethereum wallet that is not connected to the internet. If one needs to send Ethereum, he/she can create a transaction file at the Cold Wallet, and then run the transaction through another wallet that is connected to the internet.</p><p>One can also use the Cold Wallet when receiving ETH. The code that checks for ETH deposits checks with only the public key. Once a day, a transaction, which sends received ETH to an administrative address from the Cold Wallet, is produced. After that, the transaction is run.</p><p>However, creating a new account causes problems. An account should be created when a user wants at any moment. However, it is not possible to create new accounts every time from the Cold Wallet. Since the Cold Wallet is not connected to the internet, someone has to personally go create an account manually. This means the throughput will be notoriously slow.</p><p>On the side of Bitcoin, the HD Wallet can be used in order to solve this problem.</p><h4>HD Wallet</h4><p>HD Wallet involves creating private keys from a single private key. Bitcoin recommends that each user should create multiple accounts for security purposes. Thus, by using an HD Wallet, multiple accounts can be easily managed.</p><p>An HD Wallet has the following properties. An infinite amount of child keys can be made from a single parent private key. An infinite amount of child public keys can be made from a parent public key. At this point, the child’s private key created from the parent private key, and the child’s public key made from the parent’s public key each make a pair.</p><p>Now let’s return to the problem that arises when assigning a new Ethereum address to a new user. If an HD Wallet is used, every time a new Ethereum address is assigned, only the public key that will become a root just has to be held on to. With that root public key, new public keys can be created. The root public key will be stored in the Cold Wallet. transactions that involve sending money from the Cold Wallet can be done by creating necessary private keys from the root private key.</p><p><strong>Code</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63d6621d1eabcce91f1276227e60f71b/href">https://medium.com/media/63d6621d1eabcce91f1276227e60f71b/href</a></iframe><p>The code above uses a Javascript library called ethereumjs-wallet. It creates the 17th address from the root extended key.</p><p><strong>Conclusion</strong></p><p>So far, we have discussed the usefulness of the Cold Wallet. In addition, we’ve explored how the Cold Wallet would come to manage the private keys, and how public keys can be created without the private keys. (For the Korean version of this article, click <a href="https://medium.com/gocryptobot/%EC%9D%B4%EB%8D%94%EB%A6%AC%EC%9B%80%EC%9D%98-%EC%9E%91%EC%9D%80-%EA%B1%B0%EB%9E%98%EC%86%8C%EB%A5%BC-%EB%A7%8C%EB%93%A4-%EB%95%8C-%EC%97%AC%EB%9F%AC-%EA%B3%84%EC%A0%95-%EA%B4%80%EB%A6%AC%ED%95%98%EB%8A%94-%ED%8C%81-737ea72dfe65">here</a>).</p><p>Last but not the least! Now it’s time to enjoy GoCryptobot. <br>Download from here :)</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a><strong><br>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1146250172" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/tips-on-managing-multiple-accounts-when-developing-an-ethereum-based-small-scale-exchange-e1146250172">Tips on Managing Multiple Accounts When Developing an Ethereum Based Small Scale Exchange</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing a Small Scale Ethereum Exchange for Service Purposes]]></title>
            <link>https://medium.com/gocryptobot/developing-a-small-scale-ethereum-exchange-for-service-purposes-3f82eb8ecb50?source=rss----2524618a44ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f82eb8ecb50</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[gocryptobot]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Seung Woo Kim]]></dc:creator>
            <pubDate>Tue, 15 May 2018 10:52:00 GMT</pubDate>
            <atom:updated>2018-05-28T00:51:24.182Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Why Would You Need a Small Scale Exchange?</strong></p><p>There are two methods to provide service that utilize Ethereum as its backbone. The first method is to store all the logic and data within the Smart Contract, which result in a completely decentralized application. However, this method has limitations related to Ethereum’s transaction fee and process speed. It takes minutes to process a single action, and spending a couple of dollars every transaction does not sound pleasing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ld4910NAmglBpnfR-O_PQ.jpeg" /></figure><p>In order to overcome these limitations, it is possible to create and benefit from a small scale exchange oriented towards services. More specifically, this means to make a currency that can be used within the service, while also being tradeable with Ethereum. If 1 Ethereum is deposited into the game, the game gives the user 1 Gold. Conversely, The user can use 1 Gold in order to gain 1 Ethereum. Going by this type of transaction system, there will be no transaction fees occurring, except when exchanging Gold for Ethereum. Furthermore, Gold is contained within the normal database, and thus, the transaction is rapidly processed as well.</p><p>Surely this is not a complete solution to our previous problem. The best scenario would be to quickly process transactions within the Ethereum network. That would be the only way to guarantee blockchain’s advantages of being a decentralized system while also protecting digital ownership. These advantages are dimmed when a personal small scale exchange is created.</p><p>However, the developers of Ethereum are aware of the rising limitations due to slow transaction process times and are attempting various methods to overcome these issues. Before these methods actually come to fruition, developers would have to create a small scale exchange in order to bypass the slow transactions. The difficulties that come with developing an exchange is the part where the system receives a transaction, and the part where the system manages the Ethereum. In this article, let’s discuss the part about receiving a transaction.</p><p><strong>Methods to Receive a Transaction</strong></p><p>If you receive Ethereum from many users, there are several methods. The first method is for each user to hand over his/her ID to the contract and send Ethereum. If this method is used, it is possible to leave the event that the contract needs, and thus, can be simply implemented. However, a disadvantage is that the user must be well aware of how to use an Ethereum wallet.</p><p>Another method would be to give a unique Ethereum deposit address to each user. If Ethereum is deposited into a certain Ethereum address, then it is processed as receiving money from the user that corresponds to that Ethereum address. Simply put, it is as if the owner of that address transferred from money to his own wallet. This method facilitates the sending process for users, and usually much more familiar. However, from the receiving standpoint, it is difficult to manage the Ethereum because they come through different addresses.</p><p>Many people still face difficulties in using an Ethereum wallet. In addition, normal exchanges usually assign unique Ethereum addresses for every user when sending Ethereum, making this process a lot more familiar to most people.</p><p><strong>Writing Code that Watches Ethereum</strong></p><p>It is a simple task to check that Ethereum was transferred to a certain address. After reading all the transaction information in one block, match whether the transaction’s “to” indicates that certain address or not. One block usually forms in about 10–20 seconds, and one block contains around 200–300 transactions at most. It is easy to check all the transaction data that has been produced.</p><p>Let’s take a more detailed look. <a href="https://github.com/ethereum/web3.js/">Web3 Library</a>’s <a href="https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgetblock">getBlock</a> function takes blockNumber as a parameter and returns the block’s information. If one uses this function, it brings the entire block’s transactions’ hashes’ list. Then, each transactions specific information is brought by using <a href="https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgettransaction">getTransaction</a> function. Within the information brought by getTransaction, there is data about who is receiving the Ethereum, by how much quantity. These two information will suffice.</p><p>With this method, it is possible to watch when and how much Ethereum is entering through a specific address.</p><p><strong>Points of Caution</strong></p><p>Just because a block has been mined for Ethereum or Bitcoin, it does not that block is confirmed. Usually, after the block has been mined, it is safer to wait for a few more blocks to be produced afterwards. Thus, when getting a block’s transaction data, it is much safer to read the block that is much behind the most current block. It is possible to get the most current block’s number through web3’s <a href="https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethblocknumber">getBlockNumber</a>. However, there is another point to be cautious of when dealing with deposits. If the user deposits Ethereum through the Smart Contract, it is difficult to track down. Ethereum’s RPC protocol does not have an API that gives information about the transaction when that transaction calls the Smart Contract. Transaction information that is pulled via web3 only contains information about the function’s name and parameters. Consequently, users must be warned to not use the Smart Contract. Even famous exchanges do not deposit using the Smart Contract because of reasons discussed above.</p><p>This concludes the discussion of when a small scale exchange is needed when dealing with Ethereum. Furthermore, we also explored the ways of receiving Ethereum using those small scale exchanges.</p><p>Link: <a href="https://medium.com/gocryptobot/%EC%84%9C%EB%B9%84%EC%8A%A4%EB%A5%BC-%EC%9C%84%ED%95%9C-%EC%9E%91%EC%9D%80-%EC%9D%B4%EB%8D%94%EB%A6%AC%EC%9B%80-%EA%B1%B0%EB%9E%98%EC%86%8C-%EB%A7%8C%EB%93%A4%EA%B8%B0-cea4803a7f63">Korean Version</a></p><p>Last but not the least! Now it’s time to enjoy GoCryptobot. <br>Download from here :)</p><p><strong>- App Store: </strong><a href="https://apple.co/2KbMipn"><strong>https://apple.co/2KbMipn</strong></a><strong><br>- Google Play: </strong><a href="https://bit.ly/2K5tYhx"><strong>https://bit.ly/2K5tYhx</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f82eb8ecb50" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gocryptobot/developing-a-small-scale-ethereum-exchange-for-service-purposes-3f82eb8ecb50">Developing a Small Scale Ethereum Exchange for Service Purposes</a> was originally published in <a href="https://medium.com/gocryptobot">GoCryptobot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>