软件工程师们经常使用“所有权”一词,用来表示,某块代码负责管理某种数据结构或系统资源。这种隐喻在编程环境中最为普遍,在这种环境中,内存管理并非是从程序成员那里抽象出来的,所谓的代码“拥有”一个对象,就是说代码有权管理并释放分配给该对象的内存。
但是,当我们在其他任何情况下降低“所有权”时,通常是在拥有长期价值的资产,而不是短暂的数据结构。但是可以使用现有的编程环境来跟踪资产的所有权,但是它们通常用公链区块链的独特之处在于,其明确设计用于管理真正稀缺和完全访问控制的数字资产所有权。诸如比特币或 Flow 之类的公链。区块链上的数字资产应表现得像有形资产:不得复制或伪造,只能转让。
伴随着区块链链的发展,代表所有权的机制也发生了变化。比特币是使用“未用交易输出”或称为 UTXO 的所有权模型重构的。虽然 UTXO 模型非常高效,但它很复杂并且会不幸的是,以太坊模型几乎没有针对编程出现的错误进行保护措施,导致程序的错误造成加密货币社区损失了超过 10 亿美元的资金。
理想情况下,预测管理数字专有的编程语言应包括数字资产的本身的表示形式,并具有防止破坏价值的错误的内置保护措施。
Cadence 介绍,一种高级的面向资源的编程语言
去年,在对更好的智能合约语言进行学术研究之后,Flow 团队正在研究在区块链环境中使用线性类型。而几乎在同一时间,Libra 团队发布了最初的公告,其中包括 MoveVM 的技术细节。
Libra 团队基于线性类型的启发,构建了新所有权模型:资源(资源),为 Move 定义了新的编程模型。资源是一种直接用编程语言表示资产所有权和启用加密数字资产属性的新方法。
关于移动的简