GithubHelp home page GithubHelp logo

outcast3k / bitcoin-multisig Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 61.0 467 KB

Javascript Bitcoin Multi Signature Address Script

Home Page: http://coinb.in/multisig

License: MIT License

CSS 0.75% HTML 99.25%

bitcoin-multisig's People

Contributors

outcast3k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcoin-multisig's Issues

Don't use minified JS

If possible, please don't use minified JS which is much more ... it's much more difficult to audit.

Testnet Support

Please add support (or a branch) for testnet, I would be more comfortable testing this software with testnet coins than actual bitcoins.

Valid signed transaction will not broadcast. Says "TX Rejected".

Hi. First off, I love this tool. It's always worked great up until this happened...

I created a 4of4 address and put ~$20 there

I created this transaction and signed it with all four keys:

0100000001c05dfc5258e85f4ccfb8c4cca54654ddff144de8d33381e976df57296212d99b00000000fd34020048304502210081f0c66bbf34fc4d1c44fd3d2b0eb1edded12519361f5faf33fc369c0ac34ff10220128415425d5edb03dad136119ab5eaca5585f7e8302f0caaeb9d8affc65e5b6c01493046022100f37fdf9266e8d5785ee30475021a8b3b667793f95852f07bd50c93d95660d509022100969944ebaa692531f2aeb36b50c1bdf67070e79f0ff1ee3b164cf469f3ba0dc30147304402200ddfd169d9b2b47f8dc496a5d42511a6f15e559c2f5724b40544114e2bc2da30022011abaa76db56aa4dd6eaafe54215af3157e837abe68a164de3b360c4f1a2bc0a01493046022100b5cbe26922742fd1ace852cfcafb5edc69acfed69ef1ba1eaea0b9f7280834f6022100da88b76b8604beeed891766050e7e3b7a753f64dba609ccaa8084ad1f092ad2a014d0b01544104ebd71a2081c65fdf6fc9971536fdd4676e3fcc26d87b0e23ccc784c41c2c1ba26396a438185c87b4a347c53809335c100f94c491109335895859498078db59d141042efb34c7eb19ebc36856885c73a4bae6ce45ee06793f7f24a50944f4d701c4e76f528ed433a0549632c0f636fdd762f0fefa134e2aeb1c0edbb1e1559be6ca244104cc28f61306886d81e930c0c28c317af96ac7a52d04966eee3b090a9d81f92b9a526b93147f45504fae85470de9ac27542fb97c4099cd8f86f4ef3a42d4d024fc4104cb7af157a46288e0eaa304b2e07be8ed11d8bb8e08986556ead2d188422a37d791a9f74c89b183c62dc77edd1714a000c8640568cc0be8ca3976868a26b1074d54aeffffffff01b03e5200000000001976a914d05987bb15b4048e6ec77d1ac614f24d3a9b6c4a88ac00000000

It verifies properly, confirms that it has all four signatures, there's even a decent miner fee included, everything's cool with the transaction as far as I can tell ... but if I try to broadcast the transaction I get "TX Rejected"

I don't know if this is a bug or not but I don't think I'm doing anything wrong or inappropriate. The error message is rather ambiguous. I hope I didn't lose those bitcoin but if I did I really need to know how I did it so I don't do it again.

Thanks for your help

SM

Use Offline

I really want to be able to use this offline, but I can't build the transaction because it wants to make sure there is enough bitcoin in the wallet to cover the transaction. I've tried bastardising the code to get around it, but frankly i've got no idea what i'm doing.

I want to be able to use the whole thing offline, then just paste the raw transaction on blockchain.info/pushtx

I know a few people have already asked for this, but I'd like to know if it's something your working on?

Bitcoin.js modification

Could you provide a non-minified version of Bitcoin.js with this project so it would be easier to compare to the original? I also noticed that some methods (e.g. getSECCurveByName) are exposed to window namespace which isn't ideal. Mind moving these to Bitcoin or Crypto object or creating a new one (e.g. BitcoinMultisig).

Unminified Source

Could you either link to or include a copy of the JS source that isn't minified?

Thanks,

Nick

How should this work?

OK, i see what this is doing, but not all of it. Is it using blockchain.info API?

Spending from a multisig address

You provide a way to sign a standard transaction (single private key) here:
https://coinb.in/multisig/

Do you have any plans to allow the signing of multisig transactions?
I would like to be able to provide two private keys, and sign a 2-of-3 transaction ready to be sent to the network.

Thanks.

Bitcoin-qt verifyaddress directions do not work

The directions do not work for creating a multi sig address. The problem lies in the fact that bitcoin qt since 0.6 uses compressed public keys(not public bitcoin address, though that can also compressed). This results in a shorter public key that starts with 02 or 03 and not the expected value of 04.

Transactions cannot accept a multisig public address

Currently the functionality does not allow for me to add multi signature addresses as an output. This functionality is needed in order to pay a partial amount and direct the balance to a wallet using the same m of n rules.

The functionality should allow for me to do the following:

  1. alice and bob exchange public keys and make a multi signature address
  2. alice sends bob the redeem script to create a transaction
  3. bob only has to send 1 btc for the transaction but the wallet has 2 btc, and he doesnt want to tip 1 btc. So he uses alice's public key and picks a new public key address from his bitcoin wallet to make a new multi signature address with alice. He sends the remaining 0.9999 btc balance to this new multi signature address.
  4. bob sends alice his signed raw transaction, and his new redeem script for the new multi sig address with the remaining balance on it.

QR codes

Could you add QR codes for the redemption script so they can be easily copied to a phone or other device, and it would be good to be able to print them out too with the script address and a note of which public keys were used to create the script (and the bitcoin addresses they represent).

So the printout would look like this:

pubkey1 [QR] 
(in small letters, bitcoin address)

pubkey2 [QR] 
(in small letters, bitcoin address)

pubkeyn [QR] 
(in small letters, bitcoin address)

redemption script [QR]

script address [QR]

license

Needs a proper license for developers.

Support compressed keys.

At the moment there are several issues which stem from Coinb.in not supporting compressed keys.

  • When asked to sign a partially signed transaction, where the signature was added by a key that is compressed in the redeemScript, Coinb.in ignores this signature, and leaves it out when creating the signed transaction.
  • #5

So just to explain how annoying this is:
Bitcoin Core is the only client which supports multisig.
People can't use keys taken from Bitcoin Core and sign transactions using Coinbin.
People can't take transactions signed by someone using Bitcoin Core, and complete them using Coinbin.
Uncompressed keys are about twice as long as compressed - meaning you're bloating the blockchain by forcing these.
Electrum will soon only support compressed keys, as this is in the formal specification of BIP32.
Coinbin is the only web utility for signing these tx's, but it isn't compatible with ANYONE else. Please fix this, your tool is very important for multisigs usability right now.

I've implemented support for signing P2SH transactions in a PHP library of mine: https://github.com/Bit-Wasp/bitcoin-lib-php/Raw_transaction.php check out some of the examples. This wallet structure contains enough info to allow signature verification of sigs that are there, and also to add sigs where possible.

    array(
        'hash160 of public key' => 
            array(
                'type' => 'pubkeyhash',
                'private_key' => '5...',
                'public_key' => '04....',
                'uncompressed_key' => '04...',
                'is_compressed' => 'false',
                'address' => '1A',
            ),
    'hash160 of public key' =>  array(
                'type' => 'pubkeyhash',
                'private_key' => 'K....',
                'public_key' => '03......',
                'uncompressed_key' => '04......',
                'is_compressed' => 'true',
                'address' => '1B',
        )
    'hash160 of SCRIPT' =>  array(
                'type' => 'scripthash',
                'script' => '52........ae',
                'required_signature_count' => m,
                'public_keys' => array( as given in redeem script ),
                'keys' => array with references to above entries of keys, identified by the hash160 of the public key in the redeem script
        )

If you don't know PHP feel free to email me on [email protected] and I'll try explain how you might change your code - I can read JS, but don't know it well enough to fix this.

When signing a transaction, the signatures are in the wrong order

When signing a transaction, signatures must be in the order of the public keys are in, in the redeem script.

If a signature is added to the transaction in the wrong order, the transaction will fail to broadcast.

Issue brought to my attention by: ktorn

Currently working on a fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.