OutCast3k / coinbin

Javascript Bitcoin Wallet. Supports Multisig, Stealth, HD, SegWit, Bech32, Time Locked Addresses, RBF and more!
https://coinb.in/
MIT License
906 stars 621 forks source link

cannot send to a multisig bech32 wallet #209

Closed ghost closed 4 years ago

ghost commented 4 years ago

Steps to reproduce: (I don't recommend doing this with real Bitcoin as it will result in funds sent to the void. Use testnet instead).

The output address will be different in the Verify screen. If you actually broadcast the transaction the output will be shown as nonstandard.

I think coinbin is writing the output as a public key (33 bytes) when in fact it is a P2WSH (32 bytes). Anyone want to take a shot at fixing this?

OutCast3k commented 4 years ago

Hi,

Not sure I understand the problem entirely, could you please provide encoded transaction examples. Coinbins multisig and electrums multisig have never been compatible, but I get the feeling you maybe trying to explain something else but am not entirely sure.

ghost commented 4 years ago

Electrum gives me this address from my Segwit Multisig wallet: bc1qvn665tmwxqjyhul5mlm7kvd9ntgzevumd3v70huu2vqhpemy0zqqwrg7vh

I paste that into the New Transaction screen Output field. Load up a UTXO for inputs and click on Submit. The output generated is:

0100000001a6635a3454e22550536e0b998f3efc2a34edf4cb26c58023ee3be020cdb3016a010000001976a914c34bb044e49729ad9e61966ccff84b0af619117788acfeffffff0130e602000000000023002164f5aa2f6e30244bf3f4dff7eb31a59ad02cb39b6c59e7df9c530170e76478800000000000

The output section in the hex 1 byte longer than it should be.
Any P2WSH address has this issue, not just multisig.

junderw commented 4 years ago

Anyone sending to P2WSH with coinbin is sending to a black hole and doesn't know it, basically.

junderw commented 4 years ago

P2WPKH addresses also work with the change I proposed.

junderw commented 4 years ago

the black hole thing

Of course they'd need to know a miner since it's non-standard and shouldn't propagate.