Skip to content
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

Signing message with multisig wallet #2408

Closed
RCasatta opened this issue May 16, 2017 · 7 comments
Closed

Signing message with multisig wallet #2408

RCasatta opened this issue May 16, 2017 · 7 comments

Comments

@RCasatta
Copy link
Contributor

Hi,
I would like to sign message from a multisig wallet.

Ideal solution would be using the multisig "3" address and passing the partially signed message around cosigner (the sameway transaction are signed)

Less ideal solution would be to sign with a single sig address "1" derived from every cosigner xpub.
I tried to derive /0/0 from my xpub but when I try to sign a text message with that address I receive "Address not in wallet"

Is it somehow possible to sign text messages with a multisig wallet?

@dabura667
Copy link
Contributor

I know of no standard library for doing such a thing. So if it were implemented in Electrum, only Electrum would be able to verify it until every other wallet supported it.

@ecdsa
Copy link
Member

ecdsa commented May 21, 2017

you do not sign a message with an address, but with a public key.

@ecdsa ecdsa closed this as completed May 21, 2017
@fresheneesz
Copy link

How can you easily verify your multisig wallet partner still has access to their keys? I was hoping the signature interface would allow me to sign something with the individual private key of one party, in such a way that the other party could verify it. Is that not possible?

@SomberNight
Copy link
Member

SomberNight commented Dec 23, 2019

@fresheneesz There is currently no way in the GUI/CLI to sign/verify a message with a privkey/pubkey; only "with" an address. If someone implements this, it could get merged, most certainly for the CLI. It does not look difficult to do.

If you want a workaround right now, you can encrypt a message to your cosigner's pubkey, and if they can decrypt it and tell you the contents, they still have the key.

@fresheneesz
Copy link

That sounds like a reasonable workaround. Doesn't look like an intuitive workflow tho. In particular, I'm seeing the following usability issues:

  • There's no indication of which cosigner key is yours (ie the corresponding private key is held by this wallet) and which one is from an outside cosigner.
  • The encrypt/decryption UI is unnecessarily confusing, where if you're doing decryption, you put the encrypted message in the bottom field, and if you're doing encryption you put it in the top field. I can see this being useful in testing that the feature works correctly, but its an odd interface to use an input field as an output field (and vice versa) in different cases.
  • Where in a normal wallet, you can right click on an address and use it to either sign or encrypt/decrypt, in a multisig wallet, that option is gone. Using one of the master public keys doesn't work here (brings up an error). Using one of the public keys in the details of an address brings up the incomprehensible message "m 1, n 66" seemingly no matter which public key I use.

The last problem there is the biggest blocker, since at this point I don't know how to encrypt something with this multisig wallet.

@SomberNight
Copy link
Member

@fresheneesz

Using one of the public keys in the details of an address brings up the incomprehensible message "m 1, n 66" seemingly no matter which public key I use.

I see. That's a bug. Please open a separate issue for it.

@fresheneesz
Copy link

#5856

cculianu added a commit to Toporin/electrum-satochip that referenced this issue Feb 25, 2022
* Miscellaneous fixups to synchronizer.py and wallet.py

- Updated copyright in wallet.py and synchronizer.py
- Fixed a FIXME in synchronizer.py
- Fixed miscellanous python formatting/style issues found by PyCharm
- Added some typing annotations to make code more readable

* Refactor of synchronizer.py to support tracking of change addresses

This is an initial step in order to allow us to only subscribe to N
change addresses at a time.

* Fixed a comment that was too long

* Added mechanism to network.py to unsubscribe from addresses

New method in class Network: unsubscribe_from_scripthashes. If all
callbacks for a scripthash are gone, will send a
blockchain.scripthash.unsubscribe message to the server.

This will be used later to reap old change addresses.

* Unsubscribe from individual addresses on wallet close

This should keep the subs count down for unused addresses when wallets
are closed.  If the refct for a scripthash drops to 0, we send
blockchain.scripthash.unsubscribe to the server.

Note that an individual address may be "seen" or used by multiple
wallets so we only unsub when a scripthash's refct drops to 0 (meaning
no wallet cares about it anymore).

* Minor optimization in synchronizer.py subscribe_to_addresses

Don't build a list and then convert it to a dict. Build the dict
directly. This saves CPU.

* Get rid of checking if history is sorted properly

This check wastes CPU cycles and doesn't actually amount to any
functional change in Electron Cash.  Moreover, the check is not
guaranteed to work correctly in the case of mempool tx's appearing in
history, since the mempool txns have an unspecified order.

* Added tracking of change addresses and expiration candidates to synchronizer.py

These are the data structures we will use to expire change address
subscriptions.

* Implemented expiring old change address subs in synchronizer.py

If Synchronizer is constructed with positive, nonzero limit_change_subs,
then it will take an alternate code path to expire old change addresses.
It still runs through the entire change address list, and does briefly
subscribe to all change addresses to detect changes, however it then
unsubscribes when limit_change_subs is exceeded for change addresses.

* Added ability to enable/disable retiring of change in QT GUI

Default is enabled with a threshold of older than: 1000

* Refactor: Precede "private" methods in synchronizer.py with '_'

* Added periodid check that we are not over chagne addr subs limit

* Small nit/optimization

Create the huge int once for the sorter in _check_change_subs_limits
(should save CPU cycles).

* Added custom messaging when changing change retire settings

Tell user that they need to close and reopen the wallet (rather than all
of electron cash), in order for settings to take effect.

* Optimization: Persist the retired change addresses to wallet storage

This allows us to have very fast startup times in the happy case where
the retired change addresses have no new history.

Note that now it is possible for the wallet to not realize if it was
sent funds to a "retired" change address.  Such is life.  User can
disable the feature to revert to old behavior or they can select
"rebuild wallet history" in that corner case.

* Update address tab GUI code to gray out "retired" change addresses

This at least provides the user with some visual indicator of what is
happening.

* Only load the retired change set if using the limit_change option

Otherwise don't bother loading the set as it may cause trouble.

* Fixed undefined variable bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants