Andrea Benini, Mauro Gambini, Sara Migliorini, Fausto Spoto
Generics are a powerful feature of programming languages that allows one to write highly reusable code. More specifically, they are based on the use of type placeholders in order to produce parametrized code, that can be instantiated for each concrete type provided for them. In many programming languages, such as Java, they are implemented by erasure, ie. replaced by their upper bound type during compilation into bytecode. This paper originated from a real security issue that we found while using generics for writing smart contracts for blockchain, in order to implement a contract for shared entities (such as a company shared by its shareholders), for the Hotmoka blockchain, whose contracts are written in Java. The considered case study is particularly important since the validators’ set of the blockchain itself is a special case of shared entities. The analysis shows that the power of generics comes at the risk of a too permissive typing of the compiled code, due to the erasure mechanism, with a consequent possible attack to the validators’ set. This paper proposes a solution that forces the compiler to generate more precise type information than those arising by erasure.
In blockchains such as Bitcoin and Ethereum, users compete in a transaction fee auction to get their transactions confirmed in the next block. A line of recent works set forth the desiderata for a "dream" transaction fee mechanism (TFM), and explored whether such a mechanism existed. A dream TFM should satisfy 1) user incentive compatibility (UIC), i.e., truthful bidding should be a user's dominant strategy; 2) miner incentive compatibility (MIC), i.e., the miner's dominant strategy is to faithfully implement the prescribed mechanism; and 3) miner-user side contract proofness (SCP), i.e., no coalition of the miner and one or more user(s) can increase their joint utility by deviating from the honest behavior. The weakest form of SCP is called 1-SCP, where we only aim to provide resilience against the collusion of the miner and a single user. Sadly, despite the various attempts, to the best of knowledge, no existing mechanism can satisfy all three properties in all situations. Since the TFM departs from classical mechanism design in modeling and assumptions, to date, our understanding of the design space is relatively little. In this paper, we further unravel the mathematical structure of transaction fee mechanism design by proving the following results: - Can we have a dream TFM? - Rethinking the incentive compatibility notions. - Do the new design elements make a difference?
When users deploy or invoke smart contracts on Ethereum, a fee is charged for avoiding resource abuse. Metered in gas, the fee is the product of the amount of gas used and the gas price. The more gas used indicates a higher transaction fee. In my doctoral research, we aim to investigate two widely studied issues regarding gas, i.e., gas estimation and gas optimization. The former is to predict gas costs for executing a transactions to avoid out-of-gas exceptions, and the latter is to modify existing contracts to save transaction fee. We target some problems that previous work did not solve: gas estimation for loop functions, and gas optimization for storage usage and arrays. We expect that my research can help Ethereum users avoid economical loss for out-of-gas exceptions and pay less transaction fee.
Jonathan Carrero, Ismael Rodrı́guez, Fernando Rubio
Auction security has been a major challenge for researchers in this area. For example, one of the biggest problems has always been the trust in a third party, an intermediary, which is the one who usually conducts the auction and knows the bids made by the participants. Over time, traditional methods have been overtaken by new technologies that eliminate the problems that arise when using traditional methods. Blockchain technology allows us to use its inherent characteristics of privacy, traceability and decentralization to conduct auctions with a much higher level of security and to execute auctions while reducing transaction costs. In addition, the automation of operations provided by smart contracts allows us to eliminate the intermediary, leading to additional cost savings. Furthermore, in contrast to previous technologies, the pseudo-anonymity of blockchain allows us to verify the authenticity of data, mitigating malicious behavior on the part of agents. In this paper we address this challenge; we present a smart contract that allows us to run an auction within the Ethereum blockchain at a relatively low cost, eliminating the intermediary and guaranteeing the trust of the agents involved in the auction. In particular, we concentrate on dealing with egalitarian social welfare, where the goal is to maximize the utility of the agent whose utility turns out to be minimal.
Mengyao Du, Miao Zhang, Yue Hu, Jie Yang · 6 authors
Multi-agent systems (MAS) promote developments in various applications such as rescue, tracking, and health care. Through the cooperation of multiple agents, the system can emerge beyond the ability of individual intelligence. However, considering the flexibility and mobility of agents, accountability and trusted interactions among agents have become mandatory aspects. One of the challenges in developing multi-agent systems is the design of appropriate coordination strategies. In this paper, we leverage the features of Ethereum architecture and propose a novel Clique-based distributed multi-agent system. The advantages of our system include secure, self-governing, and tamper-proof properties. We implement our system framework and test custom smart contracts based on a private blockchain in Ethereum. The experimental results show that the resource consumption of our proposed scheme is reasonable and feasible.
The rise of renewable energy sources and smart grids and the almost simultaneous appearance of blockchain technology has, through their synergy, opened a path to a fundamental shift in the very nature of energy systems as we know them. Traditionally, production, distribution, and trading of electrical energy has been a centralized process based on a limited number of regional, vertically integrated monopolies. Today, the share of energy produced using renewable energy systems by former consumers, now termed ‘prosumers,’ is constantly increasing, leading to a decentralized environment in which the line between producers and consumers is getting ever blurrier. In this paper, we first discuss the current state-of-the-art in applications of distributed ledgers and blockchain in the energy sector. For addressing novel challenges which appear in such a decentralized setting, we propose a system based on a lean distributed ledger with aggregator nodes and intelligent-agent trading founded on the notion of a shared supraordinal grid and a common carrier/producer that serves as the medium of exchange and supplier of last resort. We also show how such a pragmatic solution may be extended to allow for a futuristic fully decentralized grid while still respecting the here-and-now.
With the exception of some well-funded industries, legal documents remain difficult and expensive to use, and prone to ambiguities. Emerging blockchain technologies hold the promise of changing this, however the tools for coding these 'smart contracts' require programmers and are prone to fraud. To fully realise the benefits of smart contracts, widespread adoption is required, which depends on improving security and replacing programmers with tools that lawyers, business-people and the general public can use. Our objective is to investigate improved approaches to the creation, testing and deployment of smart contracts by demonstrating that pure declarative languages can be used, and that these facilitate achieving improved utility in smart contracts. Our investigation implemented a 'Will and Testament' as a smart contract on a custom simulator, and demonstrated improved utility by auto-generating a smart contract from a status-quo user interface with an untrained user. We found a number of small benefits to using a declarative language like simplification, ease of code auto-generation and ease of testing. We have identified an approach to smart contract creation supportive of adoption because conversion starts with current legal contacts, is tolerant of varying levels of automation, and allows human-in-the-loop interaction. Smart contracts are seen as game changing by many, and should issues with cost, usability and security be solved, the economic impact is likely to be large.
Zeshun Shi, Cees de Laat, Paola Grosso, Zhiming Zhao
In recent years, blockchain has gained widespread attention as an emerging technology for decentralization, transparency, and immutability in advancing online activities over public networks. As an essential market process, auctions have been well studied and applied in many business fields due to their efficiency and contributions to fair trade. Complementary features between blockchain and auction models trigger a great potential for research and innovation. On the one hand, the decentralized nature of blockchain can provide a trustworthy, secure, and cost-effective mechanism to manage the auction process; on the other hand, auction models can be utilized to design incentive and consensus protocols in blockchain architectures. These opportunities have attracted enormous research and innovation activities in both academia and industry; however, there is a lack of an in-depth review of existing solutions and achievements. In this paper, we conduct a comprehensive state-of-the-art survey of these two research topics. We review the existing solutions for integrating blockchain and auction models, with some application-oriented taxonomies generated. Additionally, we highlight some open research challenges and future directions towards integrated blockchain-auction models.
Lijun Wang, Pinghai Xu, Wei Su, Yang Li · 5 authors
Aiming at the problem of low voting enthusiasm of nodes in the Delegated Proof of Stake (DPOS) consensus mechanism in the blockchain, an incentive mechanism based on a clustering algorithm is proposed. By establishing a node positivity model, the nodes are classified by a clustering algorithm, and rewards are distributed to different nodes according to the classification results, so as to improve the enthusiasm of nodes in voting. The traditional K-means clustering algorithm has problems such as the need to predict the number of clusters K and the inability to deal with outliers, so it is not suitable for the incentive mechanism of node classification. Aiming at the problem of K-means clustering algorithm, an Hegselmann-Krause (HK) opinion dynamics clustering algorithm is introduced, which can meet the needs of the reward distribution mechanism in this paper. Through simulation and comparison with the existing schemes, the effectiveness of the improved algorithm is verified.
Smart contracts are programs that are executed on a blockhain. They have been used for applications in voting, decentralized finance, and supply chain management. However, vulnerabilities in smart contracts have been abused by hackers, leading to financial losses. Understanding state machine protocols in smart contracts has been identified as important to catching common bugs, improving documentation, and optimizing smart contracts. We analyze Solidity smart contracts deployed on the Ethereum blockchain and study the prevalence of protocols and protocol-based bugs, as well as opportunities for gas optimizations.
Abstract This study furthers recent research on Initial Coin Offerings (ICO) in understanding the set of characteristics that drive ICO performance and reduce information asymmetry. Using data on 166 ICOs and more than 300,000 contribution addresses that sent funds to ICOs in Bitcoins or in Ether between 2013 and 2017, we examined the effect of ICO characteristics on ICO performance. We found that three boundary conditions predict ICO fundraising amount, number of investors, hard cap achievement and token ranking. These are registering ICO and publishing project’s code on GitHub, obtaining VC or Business angel financing before the campaign or during presale, and finally, publishing the whitepaper before the campaign’s start. Other factors such as serial investors, presale of tokens, bonus sales and funders' ownership share explain ICO performance. We offer implications for ICO investors and policymakers.
Ethereum Improvement Proposal (EIP) 1559 was recently implemented to transform Ethereum's transaction fee market. EIP-1559 utilizes an algorithmic update rule with a constant learning rate to estimate a base fee. The base fee reflects prevailing network conditions and hence provides a more reliable oracle for current gas prices. Using on-chain data from the period after its launch, we evaluate the impact of EIP-1559 on the user experience and market performance. Our empirical findings suggest that although EIP-1559 achieves its goals on average, short-term behavior is marked by intense, chaotic oscillations in block sizes (as predicted by our recent theoretical dynamical system analysis [1]) and slow adjustments during periods of demand bursts (e.g., NFT drops). Both phenomena lead to unwanted inter-block variability in mining rewards. To address this issue, we propose an alternative base fee adjustment rule in which the learning rate varies according to an additive increase, multiplicative decrease (AIMD) update scheme. Our simulations show that the latter robustly outperforms the EIP-1559 protocol under various demand scenarios. These results provide evidence that variable learning rate mechanisms may constitute a promising alternative to the default EIP-1559-based format and contribute to the ongoing discussion on the design of more efficient transaction fee markets.
This study proposes a simple two-period model to consider consumers’ borrowing behaviour in a decentralised consensus and information distribution platform. Based on this model, we develop a bank risk mitigation framework and find that decentralised digital identity and encryption technology are the most important factors for attaining market equilibrium between decentralised consensus and information distribution. Specifically, the greater the scope of digital identity construction and the more blockchain consensus records there are, the less likely the borrower will default. Our study provides meaningful practical implications for bankers and policy regulators to help them better understand consumers’ borrowing behaviour and decisions to default.
Oct 1, 2021·2021 IEEE SmartWorld, Ubiquitous Intelligence & Computing, Advanced & Trusted Computing, Scalable Computing & Communications, Internet of People and Smart City Innovation (SmartWorld/SCALCOM/UIC/ATC/IOP/SCI)
Trading data as valuable assets has become a trend. Data such as IoT data constitute a new source of profit for their owners and they have become tradeable assets in data marketplaces. In this work, we present the technical implementation and evaluation of our marketplace model, which was introduced in a previous work. The marketplace supports the trading of streaming data, from offering data for sale and negotiating trade agreements, to automating trade obligations and fulfilment. It ends with payment settlement and the scoring of trade parties. We show that by using Ethereum blockchain technology and Ethereum smart contracts in particular, we can offer a trade-off between the gas price paid for transaction confirmation and the transaction latency, the time taken for an Ethereum network to process and confirm our marketplace transactions. We experimentally assess such trade-offs on a testbed using our marketplace implementation as a DApp.
Oct 1, 2021·2021 IEEE Intl Conf on Dependable, Autonomic and Secure Computing, Intl Conf on Pervasive Intelligence and Computing, Intl Conf on Cloud and Big Data Computing, Intl Conf on Cyber Science and Technology Congress (DASC/PiCom/CBDCom/CyberSciTech)
Due to the rapid increasing of smart contracts in Ethereum, retrieving the related smart contracts has become an important issue. A key step of recognizing the related smart contracts is to classify them. Nowadays most of the classification methods of smart contracts are based on source code or bytecode analysis. However, as the interface of a smart contract, ABI has key information about the smart contract's function and behavior. Aiming to find out the effect of ABI on the classification of smart contracts, we propose an automatic classification method that utilize popular text classification method on ABI granularity. Our experiments are based on basic machine learning algorithms - SVM, XGBoost, Stacking and Bagging, which take TF-IDF vectors of ABIs as input, and the results indicate that ABI-based smart contracts classification is an effective approach. Compared with source code-based classification method, the MCC score of our method increased by more than 0.1 on average.
A key component of blockchain technology is the ledger, viz., a database\nthat, unlike standard databases, keeps in memory the complete history of past\ntransactions as in a notarial archive for the benefit of any future test. In\nsecond-generation blockchains such as Ethereum the ledger is coupled with smart\ncontracts, which enable the automation of transactions associated with\nagreements between the parties of a financial or commercial nature. The\ncoupling of smart contracts and ledgers provides the technological background\nfor very innovative application areas, such as Decentralized Autonomous\nOrganizations (DAOs), Initial Coin Offerings (ICOs) and Decentralized Finance\n(DeFi), which propelled blockchains beyond cryptocurrencies that were the only\nfocus of first generation blockchains such as the Bitcoin. However, the\ncurrently used implementation of smart contracts as arbitrary programming\nconstructs has made them susceptible to dangerous bugs that can be exploited\nmaliciously and has moved their semantics away from that of legal contracts. We\npropose here to recompose the split and recover the reliability of databases by\nformalizing a notion of contract modelled as a finite-state automaton with\nwell-defined computational characteristics derived from an encoding in terms of\nallocations of resources to actors, as an alternative to the approach based on\nprogramming. To complete the work, we use temporal logic as the basis for an\nabstract query language that is effectively suited to the historical nature of\nthe information kept in the ledger.\n
The use of Artificial Intelligence (AI), in particular sequential decision-making (SDM) algorithms, in blockchains can greatly improve their autonomy and general features. In this context, this paper proposes the protocol CONDOR (Connecting ai-based Oracles to blockchaiN via an auDitable auctiOn pRotocol) between a smart contract and some off-chain AI-based oracles to enable the smart contract to choose among AI solution proposals while inciting those oracles to provide non-forged results. The main principle is to consider the AI outcomes as auctions that can be challenged and audited through a dispute phase. An Ethereum implementation of the aforementioned protocol was built in order to assess its scalability and time performances.
This paper proposes an architecture for implementing Y Combinator's Simple Agreements for Future Equity (SAFEs), a class of financial instruments used in funding startups, as smart contracts. We describe design patterns used and the way that aspects of the application motivate the structure of the architecture.
Second-layer or off-chain protocols aim to increase the throughput of permissionless blockchains by enabling parties to lock funds into smart-contracts and perform payments through peer-to-peer communication, only resorting to the smart-contracts for protection against fraud. Current protocols have fixed periods during which participants can dispute any fraud attempts. However, current blockchains have limited transaction processing capacity, so a fixed dispute period will not always be sufficient to deter all fraudulent behaviour in an off-chain protocol. In this paper we present a novel mechanism for adaptive dispute cutoffs (ADCs) which ensure that users retain the opportunity to dispute fraudulent behaviours despite blockchain congestion, while increasing second-layer protocol efficiency by reducing dispute period lengths when the number of disputes is low. We present a non-interactive argument system for setting adaptive dispute periods under the current Ethereum Virtual Machine, and describe how to efficiently integrate built-in support for adaptive dispute periods in any blockchain using binary-indexed trees. We empirically demonstrate that an ADC-enabled second -layer protocol can handle a larger number of disputes and prevent more fraud than its non-adaptive counterparts even when users are slow to issue disputes, due to denial of service or blockchain congestion.
Blockchain technology supports digital assets, which can take the form of cryptocurrencies and tokens. Tokens are usually created on top of the blockchain platform, using smart contracts. Two main categories of tokens exist: Fungible Tokens and Non-Fungible Tokens (NFTs). Here, we focus on NFTs and propose a correlation analysis between various NFTs' characteristics and the popularity of the NFTs. The results can have practical implications for both designers and users.