starcoin icon indicating copy to clipboard operation
starcoin copied to clipboard

[Feature Request] Multisig account deploy package

Open jolestar opened this issue 3 years ago • 1 comments

Feature Request

Describe the Feature Request

当前用户通过命令行发起多签交易是先通过:

  1. sign-multisig-txn 命令生成一个交易,并自己签名,保存交易文件。
  2. 将文件发送给其他多签参与方,通过 sign-multisig-txn 命令签名。
  3. 收集够签名后,通过 submit-txn 提交交易。

但现在 sign-multisig-txn 没有生成 package 交易的选项,导致多签部署合约无法实现。

Describe Preferred Solution

考虑到,多签账号和单签账号不应该区别对待,理想的方案是:

  1. 任何命令都应该同时支持单签和多签,比如 account transferaccount execute-functiondev deploy 等。
  2. 当交易构造成功,如果发现该账号是个多签账号,并且签名并没有收集足够,则将交易保存为文件,然后提示用户发送交易给其他参与方,然后收集签名。
  3. 其他人收集够签名后,再通过 submit-txn 提交交易。

代码在 https://github.com/starcoinorg/starcoin/blob/88d3f51d3f94403fb865a69549bdfcecf3c9ea28/cmd/starcoin/src/cli_state.rs#L248

Describe Alternatives

如果上述方案重构比较复杂,另外一个更简单直接的方案就是给 sign-multisig-txn 增加参数,可以直接生成 Package 交易。

Related Code

Additional Context

If the feature request is approved, would you be willing to submit a PR? Yes / No (Help can be provided if you need assistance submitting a PR)

jolestar avatar May 17 '22 06:05 jolestar

For "any" txn, checking it's multisig public key or not. If it is, generate multisig file(under default dir). If not, executing it directly.

templexxx avatar Jun 09 '22 16:06 templexxx

resolved

jolestar avatar Oct 18 '22 11:10 jolestar