<?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 Darius on Medium]]></title>
        <description><![CDATA[Stories by Darius on Medium]]></description>
        <link>https://medium.com/@dariusdev?source=rss-6e8ea834f227------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oNuGmY1FD0pv260sIg52mw.jpeg</url>
            <title>Stories by Darius on Medium</title>
            <link>https://medium.com/@dariusdev?source=rss-6e8ea834f227------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 19:52:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dariusdev/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[How to do basic Token research to check it is scam or not]]></title>
            <link>https://medium.com/@dariusdev/how-to-do-basic-token-research-to-check-it-is-scam-or-not-7c2816bb4208?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c2816bb4208</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[scam]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[research]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Sat, 26 Mar 2022 10:02:30 GMT</pubDate>
            <atom:updated>2022-03-29T08:37:14.294Z</atom:updated>
            <content:encoded><![CDATA[<p>In various places you can find similar messages:</p><p>“DO YOUR OWN RESEARCH” without any instructions on how to do it and what to look for.</p><p>I want to make a checklist to help me decide if a coin is worth looking, or it contains not healthy SCAM signals.</p><p>I will cover only Ethereum Blockchain but same flow with alternative tools could be found in other blockchains.</p><h3>1. Check code is verified on Etherscan eg:</h3><p>https://etherscan.io/address/0x875f716ae6d8cb584776718cb6c6ecc63781312c#code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bl6Wp6ooDTqblAaBGsn_Yg.png" /></figure><p>If code is not verified it is 99% SCAM. Code owners do not reveal code because it has problems, or bugs, or doing what is not declared official.</p><h3>2. Check Etherscan comments section eg:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTVXKPjkdNwnI7Lxy2oJYA.png" /></figure><p>If someone is blaming: it is 99% SCAM. If you also are victim of this activity do not hesitate to leave a comment there also.</p><h3>3. Google token address to find token owners and home page.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3xQeCO6VRvi47C7TVAdaw.png" /></figure><p>If in results cant find clear homepage or “white paper” or clear token purpose: it is 99% SCAM</p><h3>4. Check DappRadar blacklisting lists.</h3><p>The token lists could be found at <a href="https://github.com/dappradar/tokens-blacklist">https://github.com/dappradar/tokens-blacklist</a> <br>If token address is in the list: it is SCAM.</p><h3>5. Check Token details in token explorer like https://www.coingecko.com/</h3><p>If Token is <strong>not</strong> found there or there is sensitive notifications like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVGfXvytlDSStTBusjBrNg.png" /></figure><p>99% that token is SCAM. All normal tokens is sharing their details with tokens explorers.</p><h3>6. Check token trading options in Exchanges</h3><p>If token is traded only in 1 or 2 decentralised exchanges it is 99% SCAM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jO7mVXt5uU9Q3uN5ttK38g.png" /></figure><h3>7. Check token liquidity stability in their balance pools</h3><p>It is very easy to check in unisvap v2 pools or alternatives. Eg: <a href="https://v2.info.uniswap.org/token/0x219de4ae6672a88149cf2fd71c3e5fc4752f3b1a">https://v2.info.uniswap.org/token/0x219de4ae6672a88149cf2fd71c3e5fc4752f3b1a</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9l5lZ19IXJHhUySTq1D12w.png" /></figure><p>If Liquidity is less than 100k or in drastically degradation direction: 99% it is SCAM. Check volume, transactions counts — in image this token is dead at all.</p><h3>8. Check 3rd party analysis tools</h3><p>Few token analysis tools:<br><a href="https://tokensniffer.com/token/0x3a6e7ac13311e3500fc1c678a62a8472bd213a9d">https://tokensniffer.com/token/0x3a6e7ac13311e3500fc1c678a62a8472bd213a9d</a> — Smell Test (automated audit)0/100 — is bad sign</p><p><a href="https://honeypot.is/ethereum?address=0x3a6e7ac13311e3500fc1c678a62a8472bd213a9d">https://honeypot.is/ethereum?address=0x3a6e7ac13311e3500fc1c678a62a8472bd213a9d</a> if it is honey pot it is SCAM</p><p><a href="https://www.dextools.io/app/ether/pair-explorer/0xd04652b8c22c0b2ccefeb0ed9d3486cda07d721b">https://www.dextools.io/app/ether/pair-explorer/0xd04652b8c22c0b2ccefeb0ed9d3486cda07d721b</a> few sections could easily help identify situation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQiy5v64lS763qn8SkFPMA.png" /></figure><p>If you have more tools or comments please share in the comment your findings :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c2816bb4208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning in .Net]]></title>
            <link>https://medium.com/@dariusdev/machine-learning-in-net-2ce4dcb0eaea?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ce4dcb0eaea</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[net-core]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Fri, 18 Oct 2019 06:53:27 GMT</pubDate>
            <atom:updated>2019-10-21T09:00:26.128Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning in .Net</h3><p>Guidelines:</p><p>Main machine Learning language is Python</p><p>C# has alternative called <a href="http://ml.net/">ML.net</a>: <a href="https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet">https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet</a></p><p>Most popular machine learning platform: <a href="https://www.tensorflow.org/">https://www.tensorflow.org/</a></p><p>Basics how machine learning works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*zPX9DB0voFEyfoaM6cTyjQ.png" /></figure><p>Main steps how model is generated:</p><ul><li>Get data like Boston House Prices</li><li>Generate Data properties correlation matrix with some online generator. To get Properties which makes impact for decision most. Values is from 1(positive most impact) to -1 (most negative impact)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*iZY1S4rRD6xQZ50gwqOkHg.png" /></figure><ul><li>Define data structure class</li><li>Create Machine Learning context with seed (80- means 80 times model tries to learn)</li><li>Load Data</li><li>Load(append) columns which are correlating</li><li>Choose Training algorithm</li><li>Train model and save generated model to .zip File</li></ul><p>How to test — evaluate model:</p><ul><li>Loads the test dataset.</li><li>Creates the regression evaluator.</li><li>Evaluates the model and creates metrics.</li><li>Displays the metrics.</li></ul><p>How to execute prediction:</p><ul><li>Creates a single line of test data.</li><li>Predicts fare amount based on test data.</li><li>Combines test data and predictions for reporting.</li><li>Displays the predicted results with percentage of accuracy.</li></ul><p>More resources:</p><ul><li><a href="https://towardsdatascience.com/machine-learning-project-predicting-boston-house-prices-with-regression-b4e47493633d">Machine Learning Project: Predicting Boston House Prices With Regression</a></li><li><a href="https://www.tech-quantum.com/learn-coding-neural-network-cahsrp-predict-boston-housing-prices/">Learn Coding Neural Network in C#: Predict Boston Housing Prices | Tech-Quantum</a></li><li><a href="https://docs.microsoft.com/en-us/dotnet/machine-learning/tutorials/predict-prices">Tutorial: Predict prices using regression - ML.NET</a></li><li><a href="https://github.com/tautvydasversockas/BostonHousing_ML.NET">tautvydasversockas/BostonHousing_ML.NET</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ce4dcb0eaea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pools architecture]]></title>
            <link>https://medium.com/@dariusdev/pools-architecture-a41a9761418c?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/a41a9761418c</guid>
            <category><![CDATA[aigang]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[insurance]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Thu, 06 Dec 2018 11:42:15 GMT</pubDate>
            <atom:updated>2018-12-06T11:42:15.063Z</atom:updated>
            <content:encoded><![CDATA[<p>Pools is a tool which allows contributors to participate into insurance product reserves. Full idea:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*9OQsAPAt06P6P6U8PQi4VA.png" /><figcaption>Process</figcaption></figure><p>Domain Language:</p><ul><li><strong>Pool</strong> — the collected amount of AIX tokens dedicated for the product.</li><li><strong>Contribution</strong> — your receipt approving participation in the pool.</li><li><strong>Reward</strong> — an amount of AIX tokens returned to the contributor.</li></ul><p>The pool will be a limited amount and limited time bucket where Contributors can put their tokens. After one of the limits will be reached all collected tokens will be sent to the insurance product and act as a reserve. After the end of the insurance product (last policy will expire) all reserves will return to the pool and will be distributed to contributors.</p><p>In first version reward calculation formula will be very simple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*d8QkDQYFmUNh3eLVmE6Uug.png" /><figcaption>Reward calculation</figcaption></figure><h3>Smart contracts structure:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*EpGtzcc0yDTvhxNzmMIntg.png" /></figure><p>The main contract will be <strong>Pools</strong>. This contract will act as a storage and will store pools list and each contribution. It will be fully transparent and auditable structure. <strong>PrizeCalculator</strong> contract will store Reward calculation formula.</p><p>All code is public and can be found at our <br>GitHub repository: <br><a href="https://github.com/AigangNetwork/aigang-platform-contracts-pools">https://github.com/AigangNetwork/aigang-platform-contracts-pools</a><br>full documentation: <a href="https://aigang.readthedocs.io/en/latest/platform/pools/architecture.html">https://aigang.readthedocs.io/en/latest/platform/pools/architecture.html</a></p><p>Currently Pools integration with Insurance product we will left as a manual process. We want to be safe in all calculations and processes before automating this process.</p><p>Our platform API will work on top of this contracts structure and provide the ability to integrate this functionality with 3rd party software.</p><p>Web platform will work on top of this API and this feature currently is clickable in the test platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*y8HmFCAID5E2lprTvIE4tQ.png" /></figure><p><a href="https://testplatform.aigang.network/pools/all">https://testplatform.aigang.network/pools/all</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a41a9761418c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Battery insurance product]]></title>
            <link>https://medium.com/@dariusdev/battery-insurance-product-f19cab2f35a3?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/f19cab2f35a3</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[aigang]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Mon, 09 Jul 2018 10:02:26 GMT</pubDate>
            <atom:updated>2018-07-09T10:02:26.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BB57grw4vnvkPXvESH0k2Q.png" /></figure><p>Our first insurance product on the platform will be Android battery insurance. How this product will work in contracts layer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGvL677unYuJMVHbBUM5yg.png" /><figcaption>The insurance product contracts</figcaption></figure><p>Main contract will be <strong>Product</strong> contract which holds all insurance product properties, balance and, list of policies and reference to the Premium calculator contract. <strong>Policies</strong> contain all audit-able details about policy evaluation dates, premium, payout size, device details on policy writing date and all details about the payout. <strong>Premium Calculator</strong> contract will hold a risk model with calculation formulas, base premium, and fees.</p><p>From the UI User will be able to select this product from the list:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBXcOG5hVnH1B4YOf-i7AQ.png" /><figcaption>Insurance products list</figcaption></figure><p>After product is selected and terms and conditions are met custom product wizard will popup with instructions what user should do and how to pair the device with the system:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*Q5B6opc1xD9x26qXV1LyZg.png" /><figcaption>Pairing</figcaption></figure><p>After system knows user Device id we will be able to calculate the premium:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v2zcf9Q5g2YV6_kSP32cfA.png" /></figure><p>Platform API will connect device data API and takes data required for insurance risk calculations. Sends that data to public Ethereum contract, receives a premium, claim amount, and with that data forms draft policy.</p><p>On the next step, the user can review policy and if it is acceptable make a payment which will activate policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TtXW_1nAROTJE7M47f8PLw.png" /><figcaption>Policy Activation</figcaption></figure><p>When payment is created and transaction succeeds our Transaction listener submits the policy to <strong>Product </strong>Contract and activates it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*ffJGCsV8s9fiwYkVKx5CMw.png" /><figcaption>Transactions Listener</figcaption></figure><p>Our <strong>Transaction listener</strong> service will work as background worker and helps to display transactions statuses in the user profile. It will help to make extra actions after transactions reach the final state.</p><p><strong>Claim</strong> process will be very similar.</p><p>User comes to the active policies list, select policy and tries to claim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*LFO6pK63bKnr8NDaUirsvA.png" /><figcaption>Policies list</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHeQsqlqTv2Z4K9uc8rrRg.png" /><figcaption>Claim process</figcaption></figure><p>In the battery insurance policy platform backend will call to Mobile data collector API for latest battery state, then validate received data in Premium calculator contract and if the battery is broken — update policy status. If battery wear level falls in levels, defined in the risk model, the payout process will start, else nothing will happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*OR-Ge7M5Pm5ZMwwKSvLO4w.png" /><figcaption>Claim resolver</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f19cab2f35a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prediction Market architecture Part 2]]></title>
            <link>https://medium.com/@dariusdev/prediction-market-architecture-part-2-a89bf76d59df?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/a89bf76d59df</guid>
            <category><![CDATA[aigang]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Wed, 27 Jun 2018 09:18:29 GMT</pubDate>
            <atom:updated>2018-06-27T09:21:28.838Z</atom:updated>
            <content:encoded><![CDATA[<p>Back-end and Front-end solution</p><p>In our Prediction Markets first part, we described solidity contracts structure. The full article can be found here: <a href="https://medium.com/aigang-network/prediction-market-architecture-part-1-40756bc358bb">https://medium.com/aigang-network/prediction-market-architecture-part-1-40756bc358bb</a></p><p>In this part, I want to show all mechanics which will run under the hood of nice UI.</p><p>First of all, about used Domain language:</p><p><strong>Prediction</strong> — is a statement about a future event. In prediction market are stored a lot of predictions with user forecasts.</p><p><strong>Forecast</strong> — is a user selected outcome in prediction with tokens amount.</p><p><strong>Outcomes</strong> — a list of outcomes available in prediction for users to choose.</p><p><strong>Oracle</strong> — contract or API which will know prediction result at the end time.</p><p>Basic functionality for users who wants to forecast:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwtexVPOJncny8CJ1lQyfQ.png" /><figcaption>Prediction list and details</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X09We8wqlHr7oNH-jHJ2IA.png" /><figcaption>Forecast action</figcaption></figure><p>In this flow, a casual mechanic is happening. User sign into system, comes to prediction list, selects prediction, reads all details, choose what outcome he selects and submit selected amount for his forecast. Then our system tracks user transaction and updates statistics. As a returning user will get current prediction summary with some statistics.</p><p>Our newly introduced <strong>Aigang.TransactionListener</strong> service will work like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*-oyb1lczvDkMbz8lC1gf7Q.png" /></figure><ul><li>Listens to our database where user transactions will be stored</li><li>Monitors Ethereum blockchain to check transaction status</li><li>When status becomes successful service will take some actions by transaction type:<br>If the transaction was <strong>ForecastAdd: </strong>updates user forecast and update prediction stats.<br>Other transactions types will handle differently.</li></ul><p>Users will be able to see all forecasts with statuses which they predicted and take some actions on them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1nbvGQvAuvC1WQx29fYAw.png" /><figcaption>User withdraw flow</figcaption></figure><p>On <strong>new prediction </strong>Creation process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAX4bs77yDnzqh-UFQWX1A.png" /><figcaption>New prediction creation</figcaption></figure><p>User decides prediction question, decides initial prediction prize, configures end and start dates, Oracle type with rules how to read result and predefine prediction outputs. We are planning to have few oracle types: Ethereum contracts stored value oracle, public API stored value. In the future, we will be able to have oracles which can take data from other blockchains.</p><p>After prediction is submitted and an initial balance is transferred in first PM version manual review will start, and if a prediction is configured correctly prediction will be submitted to blockchain and starts to accept forecasts. Later when we standardise oracle input configurations this procedure will be eliminated and predictions will be stored automatically.</p><p>Most important service will be <strong>Aigang.PredictionResolver:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G7AshmJZ4QQpe4iHBHgisA.png" /><figcaption>Prediction resolver</figcaption></figure><p>Prediction resolver will listen to predictions database and at the end time request oracle for the result. After result will be known and set in our prediction market profit distribution for participants and member scores calculation will follow.</p><p>To serve prediction markets, User profile will be extended with user used wallets and transactions in all platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PAXx8ELyM772SpoL4XmPgA.png" /><figcaption>Wallets and Transactions history</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a89bf76d59df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prediction Market architecture part 1]]></title>
            <link>https://medium.com/@dariusdev/prediction-market-architecture-part-1-40756bc358bb?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/40756bc358bb</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[aigang]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 10:09:04 GMT</pubDate>
            <atom:updated>2018-06-25T15:31:25.124Z</atom:updated>
            <content:encoded><![CDATA[<p>Smart contracts</p><p>Aigang goal is to adopt prediction markets to Insurance space and make them useful for better-balanced insurance products.</p><p>Each organized prediction output should help an owner to make the decision based on crowd opinion. These collected opinions should help to shape new insurance products.</p><p>How our prediction market contracts will look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*oxsT1Le-ySV2mha3JaFOPg.png" /><figcaption>Prediction market Contracts</figcaption></figure><p>Entry point to market will be <strong>Market Contract</strong> which will hold all audit-able information:<br>- All Predictions list<br>- All participants wallets in which predictions they participated<br>- Allow a user to organize predictions<br>- Allow users to submit prediction forecast <br>- Prediction resolving function when this prediction solution is available<br>- Winning prediction output payouts function where users or organizer will distribute rewards.</p><p><strong>Prediction</strong> entity holds all participants forecasts and addresses to <strong>ResultStorage,</strong> <strong>PrizeCalculator</strong>. The prediction will have states:<br>- <strong>Published</strong>, all users are allowed to participate <br>- <strong>Resolved</strong>, when an answer is stored in ResultStorage and all winners are available to get rewards<br>- <strong>Paused</strong>, is set when for some reason prediction forecasts can not continue<br>- <strong>Canceled</strong>, the prediction is suspended and participants are allowed to withdraw they forecast amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*fJimJSS0m2Wj3Uii9U1AYQ.png" /><figcaption>Prediction status flow</figcaption></figure><p><strong>PrizeCalculator </strong>stores formula how much participant can withdraw when his selected output wins. At first version we use simples prize distribution formula:</p><p>Your contributed tokens (_forecastTokens) *<br>_predictionTotalTokens /<br> _winOutputTotalTokens = prize</p><p>Example:</p><p><em>A prediction has 2 different outcomes (Outcome 1, Outcome 2) and initial 2000 tokens prize:</em></p><p><em>User A placed 100 tokens on Outcome 1<br>User B placed 300 tokens on Outcome 1<br>User C placed 100 tokens on Outcome 2<br>Total contributed tokens: 2500</em></p><p><em>After the prediction resolves, the Oracle decides the winning outcome is Outcome 1. <br>Users can now withdraw the following token amount from their forecasts:</em></p><p><em>User A -&gt; 100 * 2500 / (100 + 300) = 625 Tokens<br>User B -&gt; 300 * 2500 / (100 + 300) = 1875 Tokens<br>User C -&gt; 0 tokens</em></p><p>Outside of blockchain each participant will receive Scores which will participate in statistics.</p><p><strong>ResultStorage</strong> store all predictions resolutions. The contract will be connected with our oracle service which will solve predictions. At this moment 3rd party services like <a href="http://www.oraclize.it/">http://www.oraclize.it/</a> are not stable, have limited support, expensive and execution flow is not traceable. When we allow users to create predictions by themselves this part becomes extremely complex and we think that this functionality is a key feature. Having own oracle service will be much flexible solution and in the future, this solution can act as a proxy to better 3rd party oracles.</p><p>Prediction Market smart Contracts: <a href="https://github.com/AigangNetwork/aigang-platform-contracts-predictions">https://github.com/AigangNetwork/aigang-platform-contracts-predictions</a></p><p>More details about prediction markets are described in our WhitePaper: <a href="https://aigang.network/whitepaper">https://aigang.network/whitepaper</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40756bc358bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Token exchange Rate in Ethereum contracts]]></title>
            <link>https://medium.com/@dariusdev/token-exchange-rate-in-ethereum-contracts-baab2c8aed62?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/baab2c8aed62</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[bancor]]></category>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[aigang]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Mon, 23 Apr 2018 10:59:58 GMT</pubDate>
            <atom:updated>2018-04-27T05:42:16.186Z</atom:updated>
            <content:encoded><![CDATA[<p>There is possibility to get your coin rate(if coin is listed in Bancor market) with other coins using Bancor contracts.</p><p>What do you need:</p><pre>Token address (eg AIX):<br>https://etherscan.io/address/0x1063ce524265d5a3A624f4914acd573dD89ce988</pre><pre>Token BancorConverter (eg AIX):<br>https://etherscan.io/address/0xFf8D1014DA6382F4C07461FBd5f3Bed733B229f1</pre><pre>Token address BNT:<br>https://etherscan.io/address/0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C</pre><pre>Token BancorConver BNT:<br>https://etherscan.io/address/0xc6725ae749677f21e4d8f85f41cfb6de49b9db29</pre><pre>Result token (eg ETH):<br>https://etherscan.io/address/0xc0829421C1d260BD3cB3E0F06cfE2D52db2cE315</pre><p>Steps how to get ETH — AIX rate:</p><ol><li>Go to BNT token BancorConverter: <a href="https://etherscan.io/address/0xc6725ae749677f21e4d8f85f41cfb6de49b9db29">https://etherscan.io/address/0xc6725ae749677f21e4d8f85f41cfb6de49b9db29</a>#readContract</li><li>Use function <strong><em>getReturn(ETH, BNT, Amount)</em></strong><em> </em>eg:<br>getReturn(0xc0829421C1d260BD3cB3E0F06cfE2D52db2cE315,<br>0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C, <br>1000000000000000000)<br>Result 1 ETH — BNT rate in Weis: <strong>158765637284441465997</strong></li><li>Go to AIX token BancorConverter:<br>https://etherscan.io/address/0xFf8D1014DA6382F4C07461FBd5f3Bed733B229f1#readContract</li><li>Use function <strong><em>getReturn(BNT,AIX,Amount)</em></strong><em> </em>eg:<br>getReturn(0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C,<br>0x1063ce524265d5a3A624f4914acd573dD89ce988, <br><strong>158765637284441465997</strong>)<br>Result 1 BNT — AIX rate in Weis: <strong>2138574171565450199253 = 2138.5741 AIX</strong></li></ol><p>Final result is 1 ETH = 2138.5741 AIX and rate 1 AIX = 0.0004676</p><p>If you want to to find AIX-ETH rate steps will be:</p><ol><li>Go to AIX token BancorConverter</li><li>Use function <strong><em>getReturn(AIX, BNT, Amount)</em></strong></li><li>Go to BNT token BancorConverter</li><li>Use function <strong><em>getReturn(BNT, ETH, Amount)</em></strong></li></ol><p>Note: this rate is a little bit different than Bancor market is showing but, if you apply configured exchanging fees the rate will be more precise and maybe match the exact one.</p><p>Using this technique you don’t need to use any third party oracle and you will get price in decentralised way.</p><blockquote>More about Aigang — <a href="http://bit.ly/AigangWebsite"><em>http://bit.ly/AigangWebsite</em></a><em><br></em>Aigang on Github — <a href="https://bit.ly/2JkxgNF">https://bit.ly/2JkxgNF</a> <a href="http://bit.ly/AigangSlack"><br></a>Aigang on Telegram — <a href="http://bit.ly/AigangTelegram">http://bit.ly/AigangTelegram<br></a>Get Aigang Latest Updates — <a href="http://bit.ly/AigangUpdates"><em>http://bit.ly/AigangUpdates</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baab2c8aed62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decentralized insurance architecture]]></title>
            <link>https://medium.com/@dariusdev/decentralized-insurance-architecture-d358bff2d3a3?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/d358bff2d3a3</guid>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Thu, 12 Oct 2017 08:22:50 GMT</pubDate>
            <atom:updated>2017-10-12T08:22:50.718Z</atom:updated>
            <content:encoded><![CDATA[<p>Companies working with “Internet Of Things” have a lot of data made available for their products insurance. In collaboration with them we can offer decentralized insurance platform on blockchain technology. This platform could work like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWZzhpVkzfTcUn_xgC6mWg.png" /></figure><p>Where prediction market will work like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*OESJhKOnw7z1faoDI48S5g.png" /></figure><p>And core contracts architecture will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*NMW5e6xz4_r5wDvzDnoH_A.png" /></figure><ul><li><strong>Contracts addresses manager </strong>— store all platform contracts addresses and allows us to manage and update contracts.</li><li><strong>Patreon system</strong> — allows us to collect monthly payments for insurance product</li><li><strong>Product states manager</strong> — allows control over product states, example : open for investment, open for public or finished</li><li><strong>Permissions manager</strong> — controls relations between contracts</li><li><strong>Configuration Manager </strong>— allows to store platform configuration</li><li><strong>Events manager</strong> — handles all platform events and allows transparent audit of platform.</li></ul><p>We invite you to join our community and leave your feedback. What do you think about Aigang architecture?</p><h4>Check out our testing ground — Aigang!</h4><blockquote>More about Aigang — <a href="http://bit.ly/AigangWebsite"><em>http://bit.ly/AigangWebsite</em></a><em><br></em>Aigang Whitepaper — <a href="http://bit.ly/2hwAtkt"><em>http://bit.ly/2hwAtkt</em></a><a href="http://bit.ly/AigangSlack"><br></a>Aigang on Telegram — <a href="http://bit.ly/AigangTelegram">http://bit.ly/AigangTelegram<br></a>Get Aigang Latest Updates — <a href="http://bit.ly/AigangUpdates"><em>http://bit.ly/AigangUpdates</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d358bff2d3a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to read Ethereum contract storage]]></title>
            <link>https://medium.com/@dariusdev/how-to-read-ethereum-contract-storage-44252c8af925?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/44252c8af925</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Thu, 14 Sep 2017 17:00:30 GMT</pubDate>
            <atom:updated>2017-09-27T09:29:48.154Z</atom:updated>
            <content:encoded><![CDATA[<p>Everybody is talking that data in contracts are public, but not everybody knows how to read it.</p><p>All contracts deployed to ethereum VM has dedicated storage where stores state. Here is an example how to read this storage with the <em>web3.js </em>library using <em>eth.getStorageAt()</em> method.</p><p>Contract example which we examine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*abjfd6Mq39EZGEhB9OhLzA.png" /></figure><p>This contract is deployed in<strong> ropsten test net</strong>: at <em>0xf1f5896ace3a78c347eb7eab503450bc93bd0c3b</em></p><p>All parameters in the storage are indexed from the beginning. One index takes 256 bytes ant it fits 64 symbols. In this example, we have 10 parameters and we can iterate them:</p><pre>let contractAddress = &#39;0xf1f5896ace3a78c347eb7eab503450bc93bd0c3b&#39;<br>for (index = 0; index &lt; 10; index++){<br> console.log(`[${index}]` + <br>   web3.eth.getStorageAt(contractAddress, index))<br>}</pre><pre>result:<br>[0] 0x000000000000000000000000000000000000000000000000000000000000000f<br>[1] 0x00000000000000000000000059b92d9a0000000000000000000000000000429f<br>[2] 0x0000000000000000000000000000000074657374310000000000000000000000<br>[3] 0x7465737431323336000000000000000000000000000000000000000000000000<br>[4] 0x6c65747320737472696e6720736f6d657468696e67000000000000000000002a<br>[5] 0x0000000000000000000000000000000000000000000000000000000000000000<br>[6] 0x0000000000000000000000000000000000000000000000000000000000000000<br>[7] 0x0000000000000000000000000000000000000000000000000000000000000002<br>[8] 0x0000000000000000000000000000000000000000000000000000000000000002<br>[9] 0x0000000000000000000000000000000000000000000000000000000000000000</pre><p>Let`s have a deeper look into each parameter</p><h4>Index 0 — storeduint1</h4><pre>let contractAddress = &#39;0xf1f5896ace3a78c347eb7eab503450bc93bd0c3b&#39;<br>let index = 0</pre><pre>console.log(web3.eth.getStorageAt(contractAddress, index))<br>console.log(&#39;DEC:&#39; + web3.toDecimal(web3.eth.getStorageAt(contractAddress, index)))</pre><pre>result:<br>0x000000000000000000000000000000000000000000000000000000000000000f<br>DEC:15</pre><h4>constuint</h4><p>Constants are not stored in a storage. Available only in code.</p><h4>Index 1 — investmentsLimit, investmentsDeadlineTimeStamp</h4><pre>let index = 1<br>console.log(web3.eth.getStorageAt(contractAddress, index))</pre><pre>result:<br> 0x00000000000000000000000059b92d9a0000000000000000000000000000429f<br>DEC:  1505308058   and  17055</pre><p>In index 1 is merged 2 properties to optimize storage usage.</p><h4>index 2 — string1</h4><pre>index = 2<br>console.log(web3.eth.getStorageAt(contractAddress, index))<br>console.log(&#39;ASCII: &#39; +<br> web3.toAscii(web3.eth.getStorageAt(contractAddress, index)))</pre><pre>result: <br>0x0000000000000000000000000000000074657374310000000000000000000000<br>ASCII: test1</pre><h4>index 3 — string2</h4><pre>index = 3<br>console.log(web3.eth.getStorageAt(contractAddress, index))<br>console.log(&#39;ASCII: &#39; +<br> web3.toAscii(web3.eth.getStorageAt(contractAddress, index)))</pre><pre>result:<br>0x7465737431323336000000000000000000000000000000000000000000000000<br>ASCII: test1236</pre><h4>index 4— string3</h4><pre>index = 4<br>console.log(web3.eth.getStorageAt(contractAddress, index))<br>console.log(&#39;ASCII: &#39; +<br> web3.toAscii(web3.eth.getStorageAt(contractAddress, index)))</pre><pre>result:<br>0x6c65747320737472696e6720736f6d657468696e67000000000000000000002a<br>ASCII: lets string something         * (42)</pre><p>End symbol <em>2a (dec 42)</em> is length of the stored string. (more details <a href="http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage">http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage</a>)</p><h4>index 5 — uints1</h4><pre>index = 5<br>console.log(web3.eth.getStorageAt(contractAddress, index))</pre><pre>result:<br>0x0000000000000000000000000000000000000000000000000000000000000000</pre><pre>PROBLEM!!!!</pre><p>Mappings have a different indexation and should be read in other way. To read mapping value you should know the <strong>key </strong>value. Otherwise, read mapping value is impossible.</p><pre>index = &#39;0000000000000000000000000000000000000000000000000000000000000005&#39;<br>key =  &#39;00000000000000000000000xbccc714d56bc0da0fd33d96d2a87b680dd6d0df6&#39;</pre><pre>let newKey =  web3.sha3(key + index, {&quot;encoding&quot;:&quot;hex&quot;})</pre><pre>console.log(web3.eth.getStorageAt(contractAddress, newKey))<br>console.log(&#39;DEC: &#39; + web3.toDecimal(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre>result:<br>0x0000000000000000000000000000000000000000000000000000000000000058<br>DEC: 88</pre><h4>index6 — structs1</h4><pre>index = &quot;0000000000000000000000000000000000000000000000000000000000000006&quot;<br>key =  &quot;00000000000000000000000xbccc714d56bc0da0fd33d96d2a87b680dd6d0df6&quot;</pre><pre>let newKey =  web3.sha3(key + index, {&quot;encoding&quot;:&quot;hex&quot;})<br>console.log(web3.eth.getStorageAt(contractAddress, newKey))<br>console.log(&#39;ASCII: &#39; +<br> web3.toAscii(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre>result:<br>0x6465766963654272616e64000000000000000000000000000000000000000016<br>ASCII: deviceBrand</pre><p>To read second struct value you need to increase <em>newKey </em>value by 1</p><pre>function increaseHexByOne(hex) {<br> let x = new BigNumber(hex)<br> let sum = x.add(1)<br> let result = &#39;0x&#39; + sum.toString(16)<br> return result<br>}</pre><pre>index = &quot;0000000000000000000000000000000000000000000000000000000000000006&quot;<br>key =  &quot;00000000000000000000000xbccc714d56bc0da0fd33d96d2a87b680dd6d0df6&quot;</pre><pre>let newKey =  increaseHexByOne(<br>  web3.sha3(key + index, {&quot;encoding&quot;:&quot;hex&quot;}))</pre><pre>console.log(web3.eth.getStorageAt(contractAddress,newKey))<br>console.log(&#39;ASCII: &#39; +<br> web3.toAscii(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre>result:<br>0x6465766963655965617200000000000000000000000000000000000000000014<br>ASCII: deviceYear</pre><p>If you want third struct value increase <em>newKey </em>once more.</p><h4>index 7— uintarray</h4><pre>index = &quot;7&quot;<br>console.log(web3.eth.getStorageAt(contractAddress, index))</pre><pre>result:<br>  0x0000000000000000000000000000000000000000000000000000000000000002</pre><p>This array has 2 items</p><pre>index = &quot;0000000000000000000000000000000000000000000000000000000000000007&quot;<br>let newKey = web3.sha3(index, {&quot;encoding&quot;:&quot;hex&quot;})</pre><pre>console.log(web3.eth.getStorageAt(contractAddress, newKey))<br>console.log(&#39;DEC: &#39; +<br>  web3.toDecimal(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre>result:<br>0x0000000000000000000000000000000000000000000000000000000000001f40<br>DEC: 8000<br></pre><pre>newKey = increaseHexByOne(web3.sha3(index, {&quot;encoding&quot;:&quot;hex&quot;}))</pre><pre>console.log(web3.eth.getStorageAt(contractAddress, newKey))<br>console.log(&#39;DEC: &#39; +<br>  web3.toDecimal(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre>result:<br>0x0000000000000000000000000000000000000000000000000000000000002328<br>DEC: 9000</pre><h4>index 8— deviceDataArray</h4><pre>index = &quot;0000000000000000000000000000000000000000000000000000000000000008&quot;</pre><pre>let newKey = web3.sha3(index, {&quot;encoding&quot;:&quot;hex&quot;})</pre><pre>console.log(web3.eth.getStorageAt(contractAddress, newKey))<br>console.log(&#39;ASCII: &#39; +<br> web3.toAscii(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre><strong>result:</strong><br>0x6465766963654272616e64000000000000000000000000000000000000000016<br>ASCII: deviceBrand<br></pre><pre>index = &quot;0000000000000000000000000000000000000000000000000000000000000008&quot;</pre><pre>let newKey = increaseHexByOne(web3.sha3(index, {&quot;encoding&quot;:&quot;hex&quot;}))</pre><pre>console.log(web3.eth.getStorageAt(contractAddress, newKey))<br>console.log(&#39;ASCII: &#39; +<br>web3.toAscii(web3.eth.getStorageAt(contractAddress, newKey)))</pre><pre><strong>result:<br></strong>0x6465766963655965617200000000000000000000000000000000000000000014<br>ASCII: deviceYear</pre><p>Increase by 2 result:</p><p>0x776561724c6576656c0000000000000000000000000000000000000000000012</p><p>ASCII: wearLevel</p><p>Increase by 3 you enter to second item into array result:</p><p>0x6465766963654272616e64320000000000000000000000000000000000000018</p><p>ASCII: deviceBrand2</p><p>Sources:<br><a href="https://github.com/ethereum/solidity/issues/1550">https://github.com/ethereum/solidity/issues/1550</a><br><a href="https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getstorageat">https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getstorageat</a><br><a href="https://ethereum.stackexchange.com/questions/13910/how-to-read-a-private-variable-from-a-contract">https://ethereum.stackexchange.com/questions/13910/how-to-read-a-private-variable-from-a-contract</a><br><a href="https://github.com/ethereum/web3.js/issues/445">https://github.com/ethereum/web3.js/issues/445</a></p><h4>Check out our testing ground — Aigang!</h4><blockquote><em>More about Aigang — </em><a href="http://bit.ly/AigangWebsite">http://bit.ly/AigangWebsite</a><br><em>Aigang Whitepaper — </em><a href="http://bit.ly/2hwAtkt">http://bit.ly/2hwAtkt</a><a href="http://bit.ly/AigangSlack"><em><br></em></a><em>Aigang on Telegram — </em><a href="http://bit.ly/AigangTelegram"><em>http://bit.ly/AigangTelegram<br></em></a><em>Get Aigang Latest Updates — </em><a href="http://bit.ly/AigangUpdates">http://bit.ly/AigangUpdates</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44252c8af925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Ethereum contract can communicate with external data source]]></title>
            <link>https://medium.com/@dariusdev/how-ethereum-contract-can-communicate-with-external-data-source-2e32616ea180?source=rss-6e8ea834f227------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e32616ea180</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Darius]]></dc:creator>
            <pubDate>Sat, 26 Aug 2017 04:52:53 GMT</pubDate>
            <atom:updated>2017-09-27T09:31:34.155Z</atom:updated>
            <content:encoded><![CDATA[<p>You will face into the problem when your product logic is implemented in a solidity and deployed to Ethereum network should start communicating with outside world. Ethereum virtual state machine cannot communicate with the outside world in the simple and an easy way. Why?</p><p>Because to approve each block-chain BLOCK validity, <strong>all mining nodes should get the same results from the outside</strong>. And it is not an easy task to deal with that.</p><p>After some time of research I will try to summarize my findings.</p><p>There are two ways how this can happen: Pull way or Push way.</p><h3>Pull way:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*YKPd5Y2BVEnM7-e8UR8JHQ.png" /></figure><p>To use this method you should trust 3rd party solution like <a href="http://www.oraclize.it/">Oraclize</a>. This service is not free and you should pay them for all magic they do. Usage is a really simple <a href="http://dapps.oraclize.it/browser-solidity/#gist=9817193e5b05206847ed1fcd1d16bd1d&amp;version=soljson-v0.4.15+commit.bbb8e64f.js">example</a>:</p><pre>pragma solidity ^0.4.0;<br>import &quot;github.com/oraclize/ethereum-api/oraclizeAPI.sol&quot;;</pre><pre>contract DieselPrice is usingOraclize {<br>    <br>  event newOraclizeQuery(string description);<br>  event newDieselPrice(string price);</pre><pre>  function DieselPrice() {<br>    update(); <br>  }</pre><pre>  function __callback(bytes32 myid, string result) {<br>    if (msg.sender != oraclize_cbAddress()) throw;<br>    newDieselPrice(result);<br>  }</pre><pre>  function update() payable {        <br>    newOraclizeQuery(&quot;Oraclize query was sent, <br>                        standing by for the answer..&quot;);<br>        <br>    oraclize_query(&quot;URL&quot;,&quot;xml(<a href="https://www.fueleconomy.gov/ws/rest/fuelprices).fuelPrices.diesel">https://www.fueleconomy.gov/<br>ws/rest/fuelprices).fuelPrices.diesel</a>&quot;);<br>  }<br>}</pre><p>Pros:<br>- Easy and fast to use, no need to think about implementation.<br>- Fixed cost. Gas spending will always be the same because they will call your contract __callback after they form the response (if the call is successful).</p><p>Cons:<br>- Oracle query can reach only this public API, that means that no data security available here. All data provided for contracts or published to Ethereum block chain instantly is public. It is a problem if you are working with sensitive data and don`t want to give the public access to your API.<br>- Full trust of Oracle. If Oracle gets hacked, your __callback calling can happen unexpectedly.<br>- Only the success case is covered. Not a lot of space to handle failures.<br>- Unclear how and who will pay for __callback execution.</p><h3>Push way:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*Qzgg_9_AgUyzX09WpO5vOA.png" /></figure><p>Pros:<br>- Open up data only needed for your calculations logic.<br>- You can control all process, no 3rd party components.<br>- More easily to track various communication issues and response statuses.</p><p>Cons:<br>- Complicated to implement and test it.<br>- Need Custom development and hosting for “Custom Executor”.<br>- Your front end application “PINGS” contract, which is not a very nice way to check result availability.</p><p>In both ways, your contract will trust an external wallet address, but in the second you can decide how to manage the security and balance of this address.</p><p>Overall, it is needed to remember one thing about Etherium VM, that this is a state machine, not a normal computer. Nowadays we think that everything can compute anything. We believe that in the future this global computer could do everything.</p><p>We will choose the push way for our implementation if we cannot find a better or smarter way. What do you think guys about such solution?</p><p>Sources: <a href="https://ethereum.stackexchange.com/questions/2/how-can-an-ethereum-contract-get-data-from-a-website">https://ethereum.stackexchange.com/questions/2/how-can-an-ethereum-contract-get-data-from-a-website</a></p><h4>Check out our testing ground — Aigang!</h4><blockquote>More about Aigang — <a href="http://bit.ly/AigangWebsite"><em>http://bit.ly/AigangWebsite</em></a><em><br></em>Aigang Whitepaper — <a href="http://bit.ly/2hwAtkt"><em>http://bit.ly/2hwAtkt</em></a><a href="http://bit.ly/AigangSlack"><br></a>Aigang on Telegram — <a href="http://bit.ly/AigangTelegram">http://bit.ly/AigangTelegram<br></a>Get Aigang Latest Updates — <a href="http://bit.ly/AigangUpdates"><em>http://bit.ly/AigangUpdates</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e32616ea180" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>