2

This is tangentially related to this question:
Can I Make A Contract A Keyholder to a Multisig Wallet?

Is it possible to setup a multisignature wallet from directly within a contract? My intuition says no, because any generated private keys to be assigned to the key holders would be visible on the public chain.

If it were possible, the basic idea seems like it could be extremely useful for contracts facilitating crowdfunding or situations where large amounts of ether need to be managed decentrally but with enough flexibility that it would be infeasible to attempt to enforce every possible future use of the funds via explicit contracts.

As far as I know, nothing like this currently exists in Solidity. But does anyone have an idea of how this could be implemented? I was thinking something along the lines of a function that could generate a keypair without saving the private key in the state of the contract.

2
  • I suppose if you can generate a key-pair with Javascript, you could have an oracle that listens for an event on the blockchain within a Dapp. Then you could call a function that takes in the public key as an argument and stores the public key in the contract's state. So that would present a possible work-around for generating a single address/wallet. But generating a multisig wallet requires broadcasting private keys to other nodes, and therein lies the rub.
    – user9402
    Jun 6, 2017 at 18:11
  • The contract would be set up with the public addresses of the keyholders, and then funds can be stored on the contract, but not spent unless a certain number of signatories have approved them to be. The contract only needs the addresses to validate that the correct private keys have been used to approve a transaction.
    – Chev_603
    Jul 27, 2023 at 20:57

2 Answers 2

1

In my opinion, a slight shift in paradigm may help. Contracts are designed to be used in certain ways that are counter-intuitive at first.

You can have subjectivity and human oversight as well as flexibility by creating a flexible system of proposals and votes. The proposals are the flexible part. For example, proposal to "send 1 eth from: account with data: payload to address: receiver".

Voting is the deterministic part: Only/Always do it after a majority vote from a minimum quorum (for example).

You may find that what you really want is a governance contract that can hold funds and flexibly initiate action subject to oversight by/approval of board members.

Hope it helps.

1
  • 1
    Here is a multisignature smart contract wallet that I wrote. The code is simple enough to understand and provides an example of how you could implement this. github.com/darkerego/ethervault
    – Chev_603
    Jul 27, 2023 at 20:55
1

There are two types of accounts on Ethereum. Externally Owned Accounts (EOA) which have a public & private key and Contract accounts. Contract accounts do not need a private key, as their code and state combined act as their authority.

All accounts on Ethereum can own Ether or even ERC20 tokens. If you wish for a contract to sign a transaction on the blockchain this is currently possible without need for a private key for the contract.

Reference: http://ethdocs.org/en/latest/contracts-and-transactions/account-types-gas-and-transactions.html

1
  • I'm aware my contract can sign its own transactions. The problem is building a multisig wallet in the contract for the later movement of funds between untrusted parties without having to rely too heavily on explicit contract logic.
    – user9402
    Jun 6, 2017 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.