This paper develops semantic typing in a smart-contract setting to ensure type safety of code that uses statically untypable language constructs, such as the fallback function. The idea is that the creator of a contract on the blockchain equips code containing such constructs with a formal proof of its type safety, given in terms of the semantics of types. Then, a user of the contract only needs to check the validity of the provided 'proof certificate' of type safety. This is a form of proof-carrying code, which naturally fits with the immutable nature of the blockchain environment. As a concrete application of our approach, we focus on ensuring information flow control and non-interference for TinySol, a distilled version of the Solidity language, through security types. We provide the semantics of types in terms of a typed operational semantics of TinySol and we express the proofs of safety as coinductively-defined typing interpretations, which can be represented compactly via up-to techniques, similar to those used for bisimilarity. We also show how our machinery can be used to type the typical pointer-to-implementation pattern based on the fallback function and to reject a distilled version of the infamous Parity Multisig Wallet Attack.


翻译:本文在智能合约场景中发展了语义类型化方法,以确保使用静态不可类型化语言构造(如回退函数)的代码的类型安全性。核心思想是:区块链上的合约创建者为包含此类构造的代码配备基于类型语义的形式化类型安全证明。随后,合约用户仅需验证所提供类型安全"证明证书"的有效性。这是一种证明携带代码(proof-carrying code)形式,天然契合区块链环境的不可变性。作为本方法的具体应用,我们专注于通过安全类型确保Solidity语言精简版本TinySol的信息流控制与非干扰性。我们基于TinySol的类型化操作语义给出了类型的语义,并将安全证明表示为余归纳定义的类型解释,这些解释可通过与双模拟类似的up-to技术进行紧凑表示。我们还展示了如何利用该机制对基于回退函数的典型指针到实现模式进行类型化,并拒绝著名Parity多签名钱包攻击的精简版本。

0
下载
关闭预览

相关内容

生成式人工智能大型语言模型的安全性:概述
专知会员服务
35+阅读 · 2024年7月30日
【2024新书】大型语言模型安全开发者手册,250页pdf
专知会员服务
76+阅读 · 2024年2月12日
可解释人工智能中的对抗攻击和防御
专知会员服务
43+阅读 · 2023年6月20日
专知会员服务
34+阅读 · 2021年5月8日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
强化学习《奖励函数设计: Reward Shaping》详细解读
深度强化学习实验室
20+阅读 · 2020年9月1日
推荐召回算法之深度召回模型串讲
AINLP
22+阅读 · 2019年6月14日
详解常见的损失函数
七月在线实验室
20+阅读 · 2018年7月12日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
在Python中使用SpaCy进行文本分类
专知
24+阅读 · 2018年5月8日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
战略前沿人工智能的再思考(中文)
专知会员服务
4+阅读 · 5月29日
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
4+阅读 · 5月29日
“史诗怒火行动”中美军损失的作战飞机
专知会员服务
4+阅读 · 5月29日
ICML 2026 | 理解上下文持续学习中的泛化与遗忘
专知会员服务
5+阅读 · 5月28日
Agent Harness综述:大模型智能体执行器工程全景
专知会员服务
14+阅读 · 5月28日
《基于理论的威慑效能评估》
专知会员服务
8+阅读 · 5月28日
相关资讯
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
强化学习《奖励函数设计: Reward Shaping》详细解读
深度强化学习实验室
20+阅读 · 2020年9月1日
推荐召回算法之深度召回模型串讲
AINLP
22+阅读 · 2019年6月14日
详解常见的损失函数
七月在线实验室
20+阅读 · 2018年7月12日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
在Python中使用SpaCy进行文本分类
专知
24+阅读 · 2018年5月8日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员