Skip to main content
QUICK REVIEW

[论文解读] Obsidian: Typestate and Assets for Safer Blockchain Programming

Michael Coblenz, Reed Oei|arXiv (Cornell University)|Sep 8, 2019
Blockchain Technology Applications and Security参考文献 43被引用 12
一句话总结

Obsidian 是一种领域特定编程语言,结合了类型态和线性类型,以静态方式检测智能合约中常见的错误,例如不正确的状态转换和资产损失。通过在编译时强制执行所有权和状态纪律,Obsidian 减少了样板代码并提高了安全性,如在参数化保险和供应链管理方面的案例研究所示,相比 Solidity 表现更优。

ABSTRACT

Blockchain platforms are coming into broad use for processing critical transactions among participants who have not established mutual trust. Many blockchains are programmable, supporting smart contracts, which maintain persistent state and support transactions that transform the state. Unfortunately, bugs in many smart contracts have been exploited by hackers. Obsidian is a novel programming language with a type system that enables static detection of bugs that are common in smart contracts today. Obsidian is based on a core calculus, Silica, for which we proved type soundness. Obsidian uses typestate to detect improper state manipulation and uses linear types to detect abuse of assets. We describe two case studies that evaluate Obsidian's applicability to the domains of parametric insurance and supply chain management, finding that Obsidian's type system facilitates reasoning about high-level states and ownership of resources. We compared our Obsidian implementation to a Solidity implementation, observing that the Solidity implementation requires much boilerplate checking and tracking of state, whereas Obsidian does this work statically.

研究动机与目标

  • 解决由于常见编程错误导致的智能合约安全漏洞日益增长的风险。
  • 设计一种编程语言,实现对与状态操作和资产滥用相关错误的静态检测。
  • 将类型态和线性类型结合成一种实用且可使用的区块链开发语言。
  • 通过保险和供应链管理等实际案例研究,评估该语言的有效性。
  • 通过核心演算 Silica,为智能合约编程提供一个可靠且形式化验证的基础。

提出的方法

  • 设计 Obsidian 作为基于核心演算 Silica 的表层语言,该演算已通过形式化证明是可靠的。
  • 使用类型态强制执行正确的状态转换,确保仅在对象处于有效状态时才可调用方法。
  • 应用线性类型来追踪资产所有权,防止数字资产的意外丢失或重复。
  • 实现一种权限系统,限制别名使用,以在支持实际编程的同时维持安全保证。
  • 统一支持链上智能合约和链下客户端程序,确保端到端的安全性。
  • 将语言与 Hyperledger Fabric 等区块链平台集成,并计划支持 Ethereum。

实验结果

研究问题

  • RQ1类型态和线性类型能否在实用编程语言中有效结合,以防止常见智能合约错误?
  • RQ2与现有语言如 Solidity 相比,Obsidian 在代码简洁性和安全性方面表现如何?
  • RQ3Obsidian 的类型系统能否用于构建具有强安全保证的非平凡、真实世界的智能合约?
  • RQ4使用统一语言同时支持智能合约和客户端程序,其架构影响是什么?
  • RQ5形式化基础(Silica)如何支持该语言的可靠性和可扩展性?

主要发现

  • Obsidian 的类型系统可静态防止常见错误,如不正确的状态转换和资产损失,从而减少运行时漏洞。
  • 与 Solidity 相比,Obsidian 消除了大量用于状态和资产追踪的样板代码,使程序更简洁且易于维护。
  • 在参数化保险和供应链管理的案例研究中表明,Obsidian 的类型态和资产建模机制非常适合涉及价值转移和状态依赖操作的领域。
  • 尽管是研究原型且文档有限,开发人员仍成功在 Obsidian 中实现了非平凡的智能合约。
  • 核心演算 Silica 已通过形式化证明是可靠的,为 Obsidian 及未来面向类型态的语言提供了可信基础。
  • 该语言对链上和链下编程的统一方法,确保了整个应用栈中一致的安全保证。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。