-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC: Standard API for multisig wallet smart contracts #763
Comments
Is it necessary to invent an entirely new API for this? Why not write it to conform to one or more of the existing implementations? Also, personally I think the format that accepts a single TX with the signatures of a quorum of participants is a much better approach than having each participant individually submit an approval TX. |
Compatibility with existing implementations is surely good thing, but did you mean some particular existing implementation that has API good and generic enough to be promoted to EIP standard?
This makes it impossible to revoke signatures, and this requires owners to know each other's contact information and to communicate off-chain as in private flow described in my proposal, right? |
There's a couple of others already. I don't understand why you wouldn't pick one instead of inventing something from scratch.
I don't see this as an important feature, personally.
Yes - but we shouldn't restructure APIs around offchain coordination problems. I certainly think it's implausible that users of a multisig don't communicate with each other out of band. |
I think we probably could split this question into two:
In my opinion, answer to the first question is “yes” and my motivation is explained in “Motivation” section above. |
Standard multisig wallet deployed by Mist do have such feature. Not sure how widely it is used, but at least authors of standard wallet probably saw some reason to include it.
The actual question is whether should we be restrictive about on-chain coordination, i.e. should we forbid on-chain coordination flow (which is currently default flow for standard multisig wallet deployed by Mist) at API level? Multisig wallets coordinated on-chain will anyway exist, and EIP standard cannot change this fact. If standard will not support on-chain coordination, all such wallets will just be non-standard. In my understanding, the goal of the standard is to improve compatibility between smart contracts and tools, not to force people to use approaches preferred by the authors of the standard. |
Contract authors and users will use the approach recommended by an EIP. You cannot ignore the impact an approved standard will have on common practice when deciding how to author it. |
Did I get right, that in your opinion API for multisig wallet that collects approvals on-chain should not be standardized, because right approach is to collect approvals off-chain as for bitcoin multisig wallets? |
Reasonable people can differ on whether onchain or offchain approvals are the better approach. What I'm saying is that you shouldn't conclude you should do it one way or the other based entirely on what competing implementations would exist. Write the best standard you can and encourage people to adopt it. |
I see. Anyway, multisig wallets that collect approvals off-chain are completely out of scope for this proposal, because I didn't find elegant way to support both, on-chain and off-chain approvals collecting in one single API. To support both, public and private flows, was already challenging enough. |
I would very much like to see a multisig API standard, but I think this one is too complex. I recommend Christina Lundkvist's simple-multisig implementation, which has instantiation as this:
and exactly one function:
I think there is real value to standardizing an interface so that wallet providers can easily add multisig functionality (I think we all need more multisigs in our lives), but IMO standardizing other features at this stage is dangerous. |
I think the standard API should be for "Multi-signature" transaction authorization, and should only include the methods regarding this, and the management of owners can be set to other EIP, because we can have multisigs that are not necessary to be owner's changeable. |
I agree that such wallets that collect signatures completely off-chain are useful and it does make sense to standardize API for such wallets, though discussion about such API is out of scope in this proposal, because this proposal is about different kind of multisig wallets. About API of Christina's wallet, it seems that the way how it prevents transaction re-execution effectively does not allow collecting signatures for several transactions in parallel, limiting usages of such wallet to the following two cases:
While these two cases are not uncommon and Christina's wallet will definitely be found useful by many teams, limitations mentioned above probably prevent Christina's wallet API from becoming common standard. |
Totally agree, and proposed API is just of this kind. |
I don't see the design as limited by those use cases at all. Once a message is signed, it can be passed between wallets (a.k.a. second-layer applications) over http. Transactions could also be executed autonomously by your software if you have codified transfer limits and authorized co-signers. Again, standards should be the lowest level possible. On-chain approval functions are an unnecessary (and expensive) complexity IMO. |
This may not be obvious, but these limitations are (probably unintended) consequences of how the API prevents signed transaction from being executed more than once. The wallet assigns sequentially incremented nonce value to every transaction being executed, and this value is a part of transaction data that ought to be signed. So you have to know transaction nonce when you are signing it, while nonce is assigned only when transaction is executed. Of cause it is impossible to know transaction nonce fore sure before transaction has been executed, so you have to guess. And if you are wrong, you will have to start over collecting signatures. |
Standards surely impact people, that's why standard author should be very careful and should not use his power to force other people to share standard author's personal preferences. There are too many cases already when people use standard approach just because it is standard, while personally they don't like it and there are better approaches widely known. |
Suppose that an owner submits a transaction by mistake. If he can not revoke his approval, the transaction remains in circulation forever, and the effective threshold of the multisig wallet will be one owner smaller. |
I agree that transactions submitted by mistake are not a problem because such transactions will never collect enough signatures. Actually I've never meant such scenario when I was telling about revocation as a valuable feature. For me, usual scenario where revocation would be helpful looks like this:
With revocation feature available, Alice would revoke her signature either after realizing that her transaction has no chances to be approved, or after realizing that her transaction is not profitable for her anymore. People do change their opinions and circumstances do change, so I would prefer to be able to revoke my signature from not yet executed transaction if I changed my mind. Especially this is important for controversial transactions that fail to quickly collect enough signatures and may stuck in half-signed state forever. |
I believe that by default multisigs should allow to change owners. I was doing some research / reading / education and collected some links in a blogpost: https://steemit.com/ethereum/@genesisre/ethereum-multisig-wallet-interacting-with-contracts-on-behalf-of-multisig (we are in such early days) |
Just did some comparative gas cost calculations between SimpleMultiSig and MultiSigWallet for reference:
|
@elenadimitrova Cool stats. How many signatures went into the 75k |
@alex-miller-0 you're right, that test was using 2 signatures so I updated to 3 and cost went up with ~10,000 gas. Updated the stats to reflect that. |
I think that offchain ethereum signed messages can be included in the same function, that would call internal methods that are the same used by the regular ethereum signed transaction calls to the contract, that fill _from with msg.sender instead of recovered address, and this can be part of another ERC. |
@elenadimitrova very interesting that it would take 10k gas for an extra signature since |
Why the method Sendmultisig is listing the transaction as internal transaction? |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
Standard API for multisig wallet smart contracts
This ERC proposes standard API for multisig wallets Ethereum smart contracts.
1. Motivation
Multisig wallets are widely-used class of Ethereum smart contracts. Multisig wallet is a smart contract that allows a group of people to collectively own Ethereum address and to execute transactions from it. This addresses know problem of plain Ethereum addresses controlled by private keys, where private key becomes single point of failure.
Currently, there is no common API nor implementation for multisig wallets. Being an owner of multiple multisig wallets with different APIs is a hard job, because one needs to use different tools/calls for the same operations on different wallet. This is inconvenient and error-prone. Standard API will make it possible to create convenient and secure tools one could make to deal with all his multisig wallets in the same way.
2. Use Cases
Proposed API supports two main use cases named “Public Flow” and “Private Flow”. Both use cases have the same roles: Suggester, Approvers, Executor, and the same goal: execute transaction via multisig wallet.
2.1. Public Flow
2.2. Private Flow
3. Methods
We propose the following methods to be included into API standard:
3.1. suggest(bytes32)
Signature:
Description:
Suggest transaction with given hash to be executed.
Returns unique ID of suggested transactions.
Logs “Suggestion” event.
Reverts if transaction was not suggested, e.g. when _hash is zero or caller is not authorized to suggest transactions.
Hash is calculated via the following Solidity statement:
Here:
Hash may not be zero.
ID of suggested transactions are never reused.
3.2. approve(uint256)
Signature:
Description:
Approve pending suggested transaction with given ID.
Logs “Approval” event.
Reverts if transaction was not approved, e.g. when _id is not a valid ID of pending suggested transaction, caller is not authorized to approve transaction or caller has already approved this transaction.
3.3. revokeApproval(uint256 _id)
Signature:
Description:
Revoke approval from suggested transaction with given ID.
Logs “ApprovalRevocation” event.
Reverts if approval was not revoked from transaction, e.g. when _id is not a valid ID of pending suggested transaction, caller is not authorized to revoke approvals or called has not approved this transaction yet.
3.4. execute(uint256,address,uint256,bytes,uint256)
Signature:
Description:
Execute suggested transaction with given ID and details.
Returns true if transaction was executed successfully, false if execution failed.
Logs “Execution” event.
Reverts if transaction was not executed, e.g. when _id is not a valid ID of pending suggested transaction, transaction didn't collect enough approvals yet, transaction details do not match hash passed to “suggest” method or caller is not authorized to execute transactions.
3.5. reveal(uint256, address, uint256, bytes)
Signature:
Description:
Reveal details of suggested transaction with given ID by logging “Revelation” event.
Logs “Revelation” event.
Reverts if transaction details were not revealed, e.g. when _id is not a valid ID of pending suggested transaction, transaction details (assuming zero salt) do not match hash passed to “suggest” method or caller it not authorized to reveal transaction details.
Note, that details of transactions whose hash was calculated with non-zero salt cannot be revealed.
3.6. getHash(uint256)
Signature:
Description:
Get hash of details of suggested transaction with given ID.
Reverts if _id is not a valid ID of pending suggested transaction.
3.7. isApproved(uint256)
Signature:
Description:
Tells whether suggested transaction with given ID has collected enough approvals to be executed.
Reverts if _id is not a valid ID of pending suggested transaction.
3.8. isApprovedBy(uint256,address)
Signature
Description
Tells whether suggested transaction with given ID has been approved by given owner.
Reverts if _id is not a valid ID of pending suggested transaction.
4. Events
We propose the following events to be included into API standard:
4.1. Suggestion(uint256,address,bytes32)
Signature:
Description
Logged when transaction with given ID and hash of details was suggested by given owner.
4.2. Approval(uint256,address)
Signature:
Description:
Logged when transaction with given ID was approved by given owner.
4.3. ApprovalRevocation(uint256,address)
Signature:
Description:
Logged when approval was revoked by given owner from transaction with given ID.
4.4. Execution(uint256,address,bool)
Signature:
Description:
Logged when transaction with given ID was executed by given owner and produced given result.
4.5. Revelation(uint256,address,address,uint256,bytes)
Signature:
Description:
Logged when given details (assuming zero salt) of transaction with given ID was revealed by given owner.
The text was updated successfully, but these errors were encountered: