2018 April

Batchoverflow Bug Points to Smart Contract Challenges; Sagewise has Solutions


Multiple exchanges have now halted trading for a number of ERC20 tokens due to a newly discovered smart contract bug called Batchoverflow. Batchoverflow is an exploit discovered where a public function called “batch” can be maliciously used to create additional tokens on some ERC20 token contracts. A hacker recently attacked two specific ICO contracts using this approach, minting billions of unplanned ICO tokens, then attempted to transfer them to an exchange to sell them off. One such token, BeautyChain (BEC) was among the first to fall victim on Sunday when attackers generated 10^58 (that’s a one with 58 zeros after it) BEC tokens, resulting in a loss of ¥6,447,277,680.

The security researchers who first discovered and named Batchoverflow have listed a number of challenges encountered with reporting and resolution of this issue.

To understand the new challenges presented by smart contract bugs, we should first explain how security researchers generally report software exploits they discover: A researcher who discovers an exploit normally will first quietly report the issue to the company who owns and maintains the vulnerable system. The researcher will also give a time window which the company can use to fix the issue before the general public is made aware that the issue exists. The reason for this is that if the researcher immediately announces the flaw, there will be time for hackers to use the published exploit before the company can reasonably take measures to mitigate or resolve the issue.

Smart contracts present a unique challenge for security research disclosure windows because smart contracts are immutable and cannot be changed. Thus, giving notice to a smart contract creator will not enable them to patch their system since the smart contract cannot be patched at all, no matter the timeline. If and when a company is made aware that their smart contract is flawed, they may need to turn to exchanges to halt trading simply because they have no method of fixing the issue at all. Secondly, at some point the company must decide when to notify users that the smart contract is flawed, but doing so will guarantee the contract will be exploited by a multitude of hackers.

Sagewise presents a simple solution to remedy the problems presented by the immutable nature of smart contracts. Contract creators can wrap their contract using the Sagewise SDK allowing additional functionality when they need it most. In the case of Batchoverflow, over a dozen smart contracts are vulnerable. If these contracts had implemented the Sagewise SDK, contract participants could have frozen the contract as soon as they became aware of the exploit. For most of the impacted contracts, this would have meant freezing the contract prior to any exploit occurring, thus removing any chance that the contract could be exploited. The timing would also be much more favorable as the contract could be frozen quickly before the exploit was publicly disclosed leaving no time for a bad actor to exploit the contract after the announcement.

To follow Sagewise, please join out Telegram at t.me/sagewise and sign up for our newsletter at www.sagewise.io

Sagewise Announces Alpha Release of Ethereum Smart Contract SDK To Combat the More than Half a Billion Dollars Lost in Smart Contracts in 2017

Today, we are proud to announce the alpha release of the Sagewise smart contract SDK. Built on the Ethereum blockchain, the SDK is a core component of Sagewise’s toolkit for unforeseen errors and disputes in smart contracts and marks a key milestone in its overall development. Before getting into the details of today’s launch, let me start with a little background on what we hope to accomplish at Sagewise.

Modern day smart contracts started with the launch of Ethereum in 2015 and, in a lot of ways, represented the dawn of fully programmable money. From the outset, one of the biggest concerns of the community was that combining human-created code with instant money transfer could frequently and unexpectedly result in the loss of user funds. Because less than one percent of the earth’s population can program or read code, cryptocurrency-related transactions–including smart contracts do not represent an area where we can reasonably tell a person to “DYOR” (do your own research), as often stated in the cryptocurrency community. Instead, smart contracts represent something very similar to traditional paper contracts in that they cannot be adequately understood or audited by ordinary people. While anyone can attempt to read acontract, if they lack a background in programming or law, respectively, it is highly unlikely they  will be able to catch all the nuances and find all the holes. As an example, someone with no programming background cannot be expected to be aware of all the possible obfuscated bugs that may exist in a smart contract.

Which is where we find ourselves today. More than a half a billion dollars was lost to smart contract coding bugs in 2017. The initial fears and predictions are now reality, and it’s time to figure out how to fix it. Many people are working on this issue through two different approaches:

  1. Making smart contract code better through better coding, tools, and audits
  2. Resolving issues that arise through mediation and dispute resolution

At Sagewise, we are focused on the latter. We are bringing transactional confidence to smart contracts by building infrastructure that acts as a safety net for unforeseen circumstances, whether that be coding errors, security vulnerabilities, changes in circumstances, or disputes. We chose to focus on this because not all issues related to smart contracts can be foreseen–even with the most careful, thoughtful coding. Smart contracts can get bad data from an oracle, or a situation can occur that was never considered. While code is static, human situations are not–we live in a world where volcanoes can halt air travel, strikes can delay commerce, and seemingly unlikely human actions can result in situations no one thought possible. Code cannot be aware of every future possibility. The question is, how do you put a safety net around a smart contract without completely damaging the immutability and decentralization?

Our release today provides a peek at our approach and can be summarized by the following features:

  • All functions in the contract can be frozen;
  • Contracting parties do not have any special control aside from the ability to start a dispute, which freezes execution of the smart contract;
  • Dispute resolution vendors are given complete access to the contract via ‘Administrator Mode’, but this only is available when a dispute has been initiated by one of the contracting parties. This allows contracting parties to fix any issues that may have occurred.

In coming months, we plan to add several more features to the SDK to improve its robustness and usability. Alongside the Sagewise ContractCanary–a smart contract email monitoring and notification system available to licensees– the Sagewise SDK prevents unforeseen execution of a smart contract. Sagewise also  plans to release other support tools as part of its infrastructure that will help bring the entire transactional process together, from documentation of smart contract intent to dispute resolution process handling.

We welcome feedback and engagement by community members, who can sign up for updates at sagewise.io and engage via our Telegram channel at t.me/sagewise.

Our alpha SDK repository can be found here.