<?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[Stories by TALO Official on Medium]]></title>
        <description><![CDATA[Stories by TALO Official on Medium]]></description>
        <link>https://medium.com/@talo_io?source=rss-a6d73f169687------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qe6rQx_qFKLNI1w_F560kw.png</url>
            <title>Stories by TALO Official on Medium</title>
            <link>https://medium.com/@talo_io?source=rss-a6d73f169687------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 13:13:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@talo_io/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[WIN $3,000 PRIZE WITH BLOCKCHAIN HACKATHON EVENT 2018]]></title>
            <link>https://medium.com/talo-protocol/win-3-000-prize-with-blockchain-hackathon-event-2018-92c32fe2f9f7?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/92c32fe2f9f7</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[talo]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Fri, 18 May 2018 09:05:02 GMT</pubDate>
            <atom:updated>2018-05-20T09:05:13.798Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>For the occasion of the hottest wave of BLOCKCHAIN technology, PolicyPal Network is pleased to collab with Talo, Fetch, and Coderschool for the Blockchain Hackathon 2018– 24-hour competition challenge for the talented programmer students of Vietnam.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ku58caLGSkLxq1bkcbRweg.png" /></figure><p><strong>Registration URL:</strong> <a href="https://ticketbox.vn/event/policypal-network-vn-hackathon-2018-building-decentralised-insurance-platform-70864/47169">https://ticketbox.vn/event/policypal-network-vn-hackathon-2018-building-decentralised-insurance-platform-70864/47169</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*1mRifVA95NI8sLVeLl0SMQ.png" /><figcaption>Come and meet Brainy from TALO</figcaption></figure><p>🏁 Free tickets for the Blockchain Festival Conference &amp; Exhibition valued at 1,600,000 VND for all contestants.</p><p>🏁 Guest and judges list with extensive experience in Blockchain technology, including:</p><ul><li>Thanh Le — CTO &amp; Co-Founder of Jobhop &amp; TALO</li><li>Robert Vong — COO &amp; Co-founder of TALO<br><br>🏁 Prizes: <strong>US $ 3,000</strong> in cash or PAL tokens airdrop worth <strong>US $ 3,000</strong> 🔥🔥</li></ul><p>💥 Time: From 26/5/2018 to 27/5/2018.<br>📍Location: Coderschool — 12 Ton Dan, Ben Nghe, District 4, HCM</p><h4>Information about the competition and how to join ? Click <a href="https://ticketbox.vn/event/policypal-network-vn-hackathon-2018-building-decentralised-insurance-platform-70864/47169">HERE</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92c32fe2f9f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/talo-protocol/win-3-000-prize-with-blockchain-hackathon-event-2018-92c32fe2f9f7">WIN $3,000 PRIZE WITH BLOCKCHAIN HACKATHON EVENT 2018</a> was originally published in <a href="https://medium.com/talo-protocol">talo-protocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THE NEW ERA STARTS HERE: 6 Days 13 hours counting]]></title>
            <link>https://medium.com/@talo_io/the-new-era-starts-here-6-days-13-hours-counting-71308271014d?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/71308271014d</guid>
            <category><![CDATA[digital]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[vietnam]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Fri, 18 May 2018 05:11:47 GMT</pubDate>
            <atom:updated>2018-05-18T08:07:49.667Z</atom:updated>
            <content:encoded><![CDATA[<p>THE NEW ERA STARTS HERE: 6 Days 13 hours counting</p><p>Attention: STUDENTS &amp; PROFESSOR 🎓⌛️</p><p>How is blockchain is changing the world ?</p><p>How is internet revolution 5.0 different than 4.0 ?</p><p>and many more exciting topics to be discussed at Vietnam biggest blockchain festival of 2018.</p><p>Join world-class leaders and founders from all over the world to learn and explore potential career / professional opportunities with the latest BLOCKCHAIN technology revolution in beautiful GEM center of Ho Chi Minh city</p><p>LIMITED to the first 200 tickets for students &amp; professors in the TALO (JobHop) Partner Networks.</p><p>How can you SIGN UP ? Link HERE: <a href="https://bit.ly/BlockchainFestTALOScholarinvite">http://bit.ly/BlockchainFestTALOScholarinvite</a></p><p>More info: <a href="https://www.blockchainfestival.com/#huobi">https://www.blockchainfestival.com/#huobi</a></p><p>See you there !👌🏻</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUSpqR0BfNEVMcHK01baJg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71308271014d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing TALO Stickers]]></title>
            <link>https://medium.com/talo-protocol/introducing-talo-stickers-the-little-brainy-7316e027ec5d?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/7316e027ec5d</guid>
            <category><![CDATA[brainy]]></category>
            <category><![CDATA[telegram]]></category>
            <category><![CDATA[stickers]]></category>
            <category><![CDATA[talo]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Wed, 16 May 2018 16:21:40 GMT</pubDate>
            <atom:updated>2018-05-22T07:24:38.460Z</atom:updated>
            <content:encoded><![CDATA[<p>We are glad to introduce Brainy — TALO’s very own ascot.</p><p>Brainy is smart and loves challenges. Follow to learn more about how he wants to change the world of recruiting for the better.</p><p>Brainy stickers are available on Telegram for everyone to use: <a href="https://t.me/addstickers/hibrainy">https://t.me/addstickers/hibrainy</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*wC07T7G_wCyfBlqFX4Sdjg.png" /><figcaption>The Little Brainy Stickers</figcaption></figure><p>Follow us on social media:</p><p>Telegram group: <a href="https://t.me/taloico">https://t.me/taloico</a></p><p>Facebook page: <a href="https://www.facebook.com/talo.io/">https://www.facebook.com/talo.io</a></p><p>Twitter page: <a href="https://twitter.com/talo_protocol">https://twitter.com/talo_protocol</a></p><p>Blog: <a href="https://medium.com/talo-protocol">https://medium.com/talo-protocol</a></p><h4><strong>Learn more about TALO, join the whitelist at </strong><a href="https://talo.io/"><strong>talo.io</strong></a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7316e027ec5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/talo-protocol/introducing-talo-stickers-the-little-brainy-7316e027ec5d">Introducing TALO Stickers</a> was originally published in <a href="https://medium.com/talo-protocol">talo-protocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TALO at Blockchain Festival — Ho Chi Minh city]]></title>
            <link>https://medium.com/@talo_io/talo-at-blockchain-festival-ho-chi-minh-city-b0c252236eb5?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0c252236eb5</guid>
            <category><![CDATA[ho-chi-minh-city]]></category>
            <category><![CDATA[blockchain-festival]]></category>
            <category><![CDATA[vietnam]]></category>
            <category><![CDATA[talo]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Wed, 16 May 2018 03:11:55 GMT</pubDate>
            <atom:updated>2018-05-16T10:14:01.963Z</atom:updated>
            <content:encoded><![CDATA[<p>Join <a href="https://talo.io/">TALO’s </a>talk from our COO — Robert Vong at the biggest Blockchain Festival in Vietnam this year!</p><h4>TOPIC: <strong>HR Revolution — Talent sourcing and management in the Blockchain age</strong></h4><p>SUMMARY: How blockchain can improve the recruiting workflow to realize substantial efficiencies. Help make hiring easier, faster and more reliable. Talking points:</p><ol><li>Challenges with recruiting</li><li>How to distribute trust</li><li>The need for privacy</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6OMvfixQMahotTdyWis6Kg.jpeg" /></figure><p>If you want to know more about TALO, join us at <a href="https://talo.io/">https://talo.io</a>.</p><p>Remember to come and join our talk at the Blockchain Festival to know more about latest BLOCKCHAIN technology revolution in beautiful GEM center of Ho Chi Minh city!</p><p>You can register for ticket with <strong>50% discount</strong> with code <strong>TALO50. </strong><a href="https://www.blockchainfestival.com/">https://www.blockchainfestival.com/</a></p><p>See you there!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*XXUbrgymSw9bPfv_5jK9LQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0c252236eb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Festival — Ho Chi Minh city, Free tickets for Students and Professors]]></title>
            <link>https://medium.com/talo-protocol/blockchain-festival-ho-chi-minh-city-free-tickets-for-students-and-professors-4cebc7030626?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cebc7030626</guid>
            <category><![CDATA[talo]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-festival]]></category>
            <category><![CDATA[vietnam]]></category>
            <category><![CDATA[ho-chi-minh-city]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Wed, 16 May 2018 02:43:13 GMT</pubDate>
            <atom:updated>2018-05-16T02:43:13.819Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>How is blockchain is changing the world ? <br>How is internet revolution 5.0 different than 4.0 ? <br>and many more exciting topics to be discussed at Vietnam biggest blockchain festival of 2018.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*F7yOhthxqHeKMvNTXmzWwA.png" /></figure><p>Join world-class leaders and founders from all over the world to learn and explore potential career / professional opportunities with the latest BLOCKCHAIN technology revolution in beautiful GEM center of Ho Chi Minh city</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*zMjzCPoX7NQV7-NfaTT2-w.png" /></figure><p><strong>LIMITED to the first 200 tickets for students &amp; professors in the TALO (JobHop) Partner Networks.</strong></p><p><strong>REGISTER here: </strong><a href="https://l.facebook.com/l.php?u=https%3A%2F%2Fbit.ly%2FBlockchainFestTALOScholarinvite&amp;h=ATNiZ4QIOm7qhK6EySSqNevcF1QGJLWey_12pxqaiwoxxh60Jwe6s5sAJitTsQ5F3k_CTghdcOR80zoGtJDQamiMVwELYvxMb6GdA-jklZ3iO0iV0P8H5M8L-RqMjLhLeFF_rKZB8w"><strong>http://bit.ly/BlockchainFestTALOScholarinvite</strong></a></p><p>See you there !</p><p>Please note that the free tickets can only access exhibition hall (With all of the company booths and interesting events). You will have free entry into exhibition hall after register with the <a href="http://bit.ly/BlockchainFestTALOScholarinvite">link </a>above. No other actions needed.<br>For full access to main event auditorium. Use code <strong>TALO50 for 50% discount: </strong><br><a href="http://www.ticketbox.vn/event/blockchain-festival-vietnam-70644/46909">www.ticketbox.vn/event/blockchain-festival-vietnam-70644/46909</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cebc7030626" width="1" height="1" alt=""><hr><p><a href="https://medium.com/talo-protocol/blockchain-festival-ho-chi-minh-city-free-tickets-for-students-and-professors-4cebc7030626">Blockchain Festival — Ho Chi Minh city, Free tickets for Students and Professors</a> was originally published in <a href="https://medium.com/talo-protocol">talo-protocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prevent Integer Overflow in Ethereum Smart Contracts]]></title>
            <link>https://medium.com/talo-protocol/prevent-integer-overflow-in-ethereum-smart-contracts-acd45d555c37?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/acd45d555c37</guid>
            <category><![CDATA[talo-protocol]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[talo]]></category>
            <category><![CDATA[ico]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Tue, 15 May 2018 04:41:10 GMT</pubDate>
            <atom:updated>2018-07-04T08:31:32.478Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Do you know that most of the hacker attacks for stoling money from smart contracts are based on a type of bug called Integer Overflow? Today we dicuss about this kind of bug and how to simply prevent it.</blockquote><h3>Let’s get back to the fundermental</h3><p>So what is Integer Overflow? Basically it is the case you make an integer variable store the value bigger than it limit, for example a 32-bit integer can store value from -2³¹ to 2³¹-1. If you assign a number out of the range to the variable, its value will become something else and what is the value depend on how the integer is presented in the system.</p><p>e.g. we have a 8-bit unsigned integer which store value from 0 to 255. Take a look at below snippet:</p><pre>uint a = 255;<br>a = a + 1; // Now a = 0</pre><p>So why a = 0 after we plus 1? Because a ‘s binary presentation is: 11111111 when we plus 1 it is like this:</p><pre>11111111 + 00000001 = 1<strong>00000000</strong></pre><p>The result in binary is 100000000 which has 9 bits, but in the memory where your variable a stored only have 8 bits, which is the last 8 zero-bits. That’s why the variable a become 0</p><p>You can see that Integer Overflow is very simple to understand, and it not only happen for plus operator but also other operator as well.</p><h3>BatchTransfer Overflow</h3><p>One of the recent attacks on token smart contracts is about an Integer Overflow bug the BatchTransfer function. Luckily this function is not belong to the ERC-20 Standard of token so it only affects a small number of tokens.</p><p>Let’s analyze what exactly this bug is and how to simply fix it if you want to implement this function in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*Zc7mNzfiDyX3O1sYff-d3w.png" /><figcaption>BEC Token contract source code bug: <a href="https://etherscan.io/address/0xc5d105e63711398af9bbff092d4b6769c82f793d#code">https://etherscan.io/address/0xc5d105e63711398af9bbff092d4b6769c82f793d#code</a></figcaption></figure><pre>function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) {<br>    uint cnt = _receivers.length;<br>    uint256 amount = uint256(cnt) * _value;<br>    require(cnt &gt; 0 &amp;&amp; cnt &lt;= 20);<br>    require(_value &gt; 0 &amp;&amp; balances[msg.sender] &gt;= amount);<br>    balances[msg.sender] = balances[msg.sender].sub(amount);<br>    for (uint i = 0; i &lt; cnt; i++) {<br>        balances[_receivers[i]] = balances[_receivers[i]].add(_value);<br>        Transfer(msg.sender, _receivers[i], _value);<br>    }<br>    return true;<br>}</pre><p>So the bug comes is at line 257: uint256 amount = unint256(cnt) * _value . Let’s asume we are the hacker and we call this function with params:</p><pre>_receivers = [0xabc..., 0xdef...] // asume we put 2 addresses here</pre><pre>_value =   57896044618658097711785492504343953926634992332820282019728792003956564819968; // which is 8 * 16 ^ 63</pre><p>Because of the Integer Overflow, we have amount = _value * 2 = 0 which passes the check balances[msg.sender] &gt;= amount . Finally we could make the token smart contract send a large amount of token into our two addresses even we don’t have any token! We are the hackers now :)</p><h3>So how to fix this?</h3><p>Actually we can have simply logic to check for the overflow. We can use the SafeMath library which provide the safe operator functions: <a href="https://github.com/Steamtradenet/smart-contract/blob/master/contracts/SafeMath.sol">https://github.com/Steamtradenet/smart-contract/blob/master/contracts/SafeMath.sol</a></p><p>Just add this library into your smart contract and use it like this:</p><pre>using SafeMath for uint256; // use SafeMath for uint256 variables</pre><p>Then you need to remember to use the safe operator functions anytime you are not sure about the safety on your math logic. Like this:</p><pre>uint256 a = 1;<br>a = a.add(1);</pre><p>So if you want to use the batchTransfer function above, just need to remember to fix the line 257 like this:</p><pre>uint256 amount = uint256(cnt).mul(_value);</pre><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*35rIeMTRwGEieKAQ_hAk5g.png" /><figcaption>Keep calm and deploy your smart contract</figcaption></figure><p>Deploying your smart contract on blockchain is like releasing hardware, one mistake and there is no way to fix it! So becareful when you decide to deploy something, get your friends, experts and audiences to review it carefully.</p><blockquote>At TALO we always aware about this and try to take care as much as we can for the smart contracts and other things before deploying to the network. If you want to know more about us, come and join us at <a href="https://talo.io/">https://talo.io</a></blockquote><h3>Some more interesting topics:</h3><h4><a href="https://medium.com/talo-protocol/how-to-secure-sensitive-data-on-an-ethereum-smart-contract-77f21c2b49f5">How to secure Sensitive data on an Ethereum Smart contract?</a></h4><h4><a href="https://medium.com/talo-protocol/list-of-multisig-wallet-smart-contracts-on-ethereum-3824d528b95e">List of MultiSig Wallet Smart contracts on Ethereum</a></h4><h4><a href="https://medium.com/talo-protocol/token-honey-pot-scam-on-ethereum-network-when-hacker-scam-hacker-1b3118a46495">Token Honey Pot Scam on Ethereum Network — When hacker scam hacker</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acd45d555c37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/talo-protocol/prevent-integer-overflow-in-ethereum-smart-contracts-acd45d555c37">Prevent Integer Overflow in Ethereum Smart Contracts</a> was originally published in <a href="https://medium.com/talo-protocol">talo-protocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to secure Sensitive data on an Ethereum Smart contract?]]></title>
            <link>https://medium.com/talo-protocol/how-to-secure-sensitive-data-on-an-ethereum-smart-contract-77f21c2b49f5?source=rss-a6d73f169687------2</link>
            <guid isPermaLink="false">https://medium.com/p/77f21c2b49f5</guid>
            <category><![CDATA[talo-protocol]]></category>
            <category><![CDATA[talo]]></category>
            <category><![CDATA[ico]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[TALO Official]]></dc:creator>
            <pubDate>Mon, 14 May 2018 12:19:49 GMT</pubDate>
            <atom:updated>2018-07-04T08:31:54.167Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Have you ever writen a smart contract in Solidity and deployed to Ethereum network? It is very exciting that you can program and put your logic on the blockchain right? Anyway, Solidity itself still is in development and there are a lot of drawbacks we need to solve when working with Solidity and smart contracts. One of the drawback is secure our sensitive data on the smart contract.</blockquote><p>So today we are discussing about how to secure your sensitive data on the smart contract you are going to deploy. We will go through some methods and verify if we can truely secure our data on a smart contract or not.</p><h3>But wait! Why we need to hide our data?</h3><p>So you may ask this question. Can you remember what are the important properties of blockchain? Decentralized, Trustless, Permanent, Transparency,… And yes, Transparency! Why we want to hide something when we want Transparency on the blockchain?</p><p>The answer is simple, let’s imagine you deploy a smart contract for a <strong>QUIZ </strong>which store the secret answer for a question and deploy it with a reward, anyone could guess the secret word will get the reward. Of course we need to hide the answer so we can get the QUIZ game work. What transparent here is the logic: “Sending reward to whoever can guess the secret word correctly”. And that should be the Transparency we want to achieve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/158/1*Y0eIO2gN-y7QLeKXYrukSQ.png" /><figcaption>Create a quiz with a reward on the blockchain</figcaption></figure><p>So smart contract open us a very open world and help us to do anything we want, that’s why at some points you will meet the situation when you want to hide something as described above. And how we could really hide our secret word in the challenge? Let’s go throught some methods.</p><h3>Private variable?</h3><p>Yeah, programatically, we can declare a private variable in our smart contract. Just simple like this:</p><pre>string private secret;</pre><p>Setting variable to private is a way of ensuring changes will only go through some specific methods. But in term of ‘private’ for the data, it is illusory. Basically everything on the Ethereum smart contracts are on the hard drive of all nodes (all miners and participants), private variable is just to make it inconvenient to read but doesn’t mean impossible. It is insufficient to safeguard your sensitive information from a determined adversary.</p><p>More over at some point, you may want to publish your source code and people can read the secret in your smart contract easily.</p><h3>Put in the sensitive data later</h3><p>So what if we don’t put the sensitive data at the begining in the source code but implement a function to put the message in later? Below is a simple smart contract</p><pre>contract SecretMessage {<br>    string private secret;<br>    <br>    function SetSecret(string _secret) public {<br>        secret = _secret;<br>    }<br>}</pre><p>Asume that we already deploy the smart contract and we use the SetSecret function to put the message in (of course in product we need to protect this function with owned modifier to make sure only us can call this function.</p><p>So what happen when we call the function with our secret?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*ROYmNq4il3I_2RsLA-mHHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*Q1K80A1QR4wApmeaPTaVYg.png" /></figure><p>Let’s open ethereum wallet and try to call the function, put the secret word “<strong>hello” </strong>and send it:</p><p>When you click the send button, we can se the raw data to send to the smart contract:</p><pre><strong><em>568656c6c6f</em></strong><em>000…</em></pre><p>And if you notice, that is the string <strong>hello </strong>written in hexa code. Which is public for everyone!</p><pre>0x5 - length of the string<br>0x68 - h (ASCII code 104)<br>0x65 - e<br>0x6c - l<br>0x6c - l<br>0x6f - o</pre><p>This also the way a string is presented in Solidity.</p><p>You can see that when we call the function, the data we sent is public on the Ethereum network and anyone can read it. This solution is no better than putting the secret directly in the smart contract. This also the same as deploy the smart contract with the secret in the arguments of the constructor function.</p><h3>ENCRYPTING or HASING THE SECRET?!</h3><p>You can see everything we put on the blockchain is visible to everyone else, so how we can secure our sensitive data? The simple way to do: <strong>Encrypt or Hash the secret! </strong>And this seems to be the best solution so far for us.</p><p><strong>We have 2 ways:</strong><br>1) We can encrypt our data and put the secret key secured somewhere off-chain. When we want the smart contract to get the real secret to do the needed logic, we need to send the key for the smart contract. This has 2 drawbacks: The private key will be published to everyone at the time we send it to the smartcontract; Asymmetric encryption function is not supported yet in Solidity (and implement the funciton directly in the smartcontract seems impossible)</p><p>2) We can simply hash the secret key and put the hash on the blockchain. Then everytime someone answer, we just need to hash their answer and compare with the hashed secret key. Solidity already has some hash function which we can use: Keccak256 (SHA-3 by Ethereum), SHA256, RIPEMD-160 (<a href="http://solidity.readthedocs.io/en/latest/units-and-global-variables.html#mathematical-and-cryptographic-functions">http://solidity.readthedocs.io/en/latest/units-and-global-variables.html#mathematical-and-cryptographic-functions</a>)</p><p>Let’s do a demo for our QUIZ above with the hashing solution:</p><pre>contract WordguessQuiz {<br>    // This is the hashed of word &#39;hello&#39; using SHA256<br>    bytes32 private hashedSecret = 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824;<br>    <br>    // This map is used to track if user answered correctly<br>    mapping (address =&gt; bool) public answeredCorrectly;<br>    <br>    function Answer(string word) public {<br>        bytes32 hashedWord = sha256(word);<br>        if (hashedWord == hashedSecret) {<br>            answeredCorrectly[msg.sender] = true;<br>            // TODO: Send reward to this user<br>        }<br>    }<br>}</pre><p>Deploy the function and guess an account, call it with the word we guess hello and check if we answered correctly or not using the map answeredCorrectly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*fQfLyduq8AoogiBNGRQmzw.png" /><figcaption>Call the function to answer our guess with word ‘hello’</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*ELBhImEM6nb4Zjv0NSFu2w.png" /><figcaption>Check again to see that we already answered the quiz correctly</figcaption></figure><h3>Conclusion</h3><p>So the best solution right now is encrypt / hash our sensitive data on the blockchain. Of course Ethereum is still in its development and we may have a better solution in the future when we only need to put the variable private and noone can read it, this is actually one of the problem being described in the Ethereum Wiki (<a href="https://github.com/ethereum/wiki/wiki/Problems#4-code-obfuscation">https://github.com/ethereum/wiki/wiki/Problems#4-code-obfuscation</a>). Until then we need to go with the encrypt/hash solution althought it could make our decentralized solution more or less centralized.</p><p>Anyway, in my opinion, we can accept this solution for now. Cause at least we can maintain the Transparency, e.g. people can see we actually send reward to the one who answer the word correctly and no one could cheat to stole the reward (they can do some bruteforce attack to guess the word but we can have some simple solution to take care of it).</p><p>Blockchain is new and everything is still at their early state. What we could do is adapt this new technology and find more applications for it. That’s what we trying to do with TALO — a Decentralized Talent Optimization Protocol. Come and join us at <a href="https://talo.io/">https://talo.io</a> if you want to know more about us!</p><h3>Some more interesting topics:</h3><h4><a href="https://medium.com/talo-protocol/prevent-integer-overflow-in-ethereum-smart-contracts-acd45d555c37">Prevent Integer Overflow in Ethereum Smart Contracts</a></h4><h4><a href="https://medium.com/talo-protocol/list-of-multisig-wallet-smart-contracts-on-ethereum-3824d528b95e">List of MultiSig Wallet Smart contracts on Ethereum</a></h4><h4><a href="https://medium.com/talo-protocol/token-honey-pot-scam-on-ethereum-network-when-hacker-scam-hacker-1b3118a46495">Token Honey Pot Scam on Ethereum Network — When hacker scam hacker</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77f21c2b49f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/talo-protocol/how-to-secure-sensitive-data-on-an-ethereum-smart-contract-77f21c2b49f5">How to secure Sensitive data on an Ethereum Smart contract?</a> was originally published in <a href="https://medium.com/talo-protocol">talo-protocol</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>