首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

交易提案系统

版权声明:

本文原文内容链接来自于https://github.com/EOSIO/eos/issues/1030,作者bytemaster ,由本号“EOS技术爱好者”翻译。

全文内容如下:

Transaction Proposal System

交易提案系统

A user, Alice, wishes to propose a transaction that contains actions which require permissions from Alice, Bob, and Charlie in order to process. She proposes the transaction through the Transaction Proposal system, publicly on-chain. Bob and Charlie review the transaction at their convenience and individually contribute their approvals. The transaction is posted to the chain and processes with the permission levels granted by the individuals at the time of approval.

用户Alice希望能有一个需要Alice、Bob和Charlie三个人都通过的权限才能处理的交易。她通过交易提案系统,在公开的链上发出交易。Bob和Charlie在有空的时候验证了交易,批准通过。该交易被发布到整条链上和流程中,并在审批时授予个人权限级别。

Description

This system is designed to allow multiple parties to co-operate on-chain to authorize a given transaction. While SignedTransaction s can be constructed through side-channels and published to the chain to represent multi-party consent, the process of doing so can be opaque to the point of untenable in certain circumstances. As an alternative, the Proposal system allows parties to conduct that process asynchronous and transparently. Additionally, it allows for a hierarchical set of proposals which can respect a much larger and deeper authorization structure than a single transaction would likely have the capacity to represent within the limits of the chain.

说明

该系统的设计目的是允许多方在链上进行合作,以授权特定的交易。 SignedTransaction 可以通过侧向通道构建,并发布到链上表示这是多方同意的结果,但这个过程很难保证每一个环节都是透明的。作为一种替代方案,提案系统允许各方在这个过程中不同步但保持透明。此外,它允许优先级的提议,也就是优先通过一个比单个交易更大、授权更高阶的交易,而单个交易具有在这条链的范围内提出异议的资格。

Implementation Details

In order to facilitate hardforks without binary code drops, this will be implemented in WASM however, it will require some privilege not available to normal user contracts. This means there is need for a privileged mode of execution and relates to to#1029 .

• Addeosio.anypermission tolinkauthwhich allows any named permission to satisfy the link and assumes contracts will implement additional considerations

• Add wasm API to access the permission names on the action as read only

• Implement proposal endpoints

◦proposewhich takes a packedtransactionand a list of authorizers

◦approvewhich takes a permission level and must be be authorized by the user at that permission level

• Implement API to check to see if a set of named permissions and public keys can satisfy the stated permission levels on a transaction.

• Add support for privileged contracts to senddeferred_transactionswith the explicit permission levels instead of the assumed code account'sactive

细节的实现

为了方便硬盘,没有二进制代码的使用,这些将在WASM中实现,但它有一些特权是普通合约用户无法使用的。这意味着需要执行#1029的特权模式。

•添加eosio.any给linkauth授权,允许任何指定的许可来满足link,并假设合同将实现额外的考虑。

•添加wasm API来访问仅有读取权限的name。

•提案中端点的实现

◦propose一个打包好的transaction和授权人的列表

◦approve一个权限级别,必须是授权用户的权限级别

•用API来检查命名权限和公钥是否能够满足交易中声明的权限级别。

•增加对特权合约的支持,将deferred_transactions发送到明确的权限级别,而不是假定代码帐户的active 。

本文图片来源于网络

本文原文内容链接来自于https://github.com/EOSIO/eos/issues/1030,作者 bytemaster,由Lochaiching翻译。转载请参照本文文首说明。

更多内容,可关注“EOS技术爱好者”

如果文章对你有帮助,可以扫描以下地址给我们打赏哦!

  • 发表于:
  • 原文链接http://kuaibao.qq.com/s/20180316G14SBO00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券