outcast3k / bitcoin-multisig Goto Github PK
View Code? Open in Web Editor NEWJavascript Bitcoin Multi Signature Address Script
Home Page: http://coinb.in/multisig
License: MIT License
Javascript Bitcoin Multi Signature Address Script
Home Page: http://coinb.in/multisig
License: MIT License
If possible, please don't use minified JS which is much more ... it's much more difficult to audit.
Please add support (or a branch) for testnet, I would be more comfortable testing this software with testnet coins than actual bitcoins.
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
Essentially what Brainwallet allows on their Transactions page
http://brainwallet.org/#tx
http://i.imgur.com/J4eHVuW.png
This allows offline use of the Transaction Generation
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?
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
).
Are the main site and repo here running the same versions of code?
Could you either link to or include a copy of the JS source that isn't minified?
Thanks,
Nick
OK, i see what this is doing, but not all of it. Is it using blockchain.info API?
What exactly is https://coinb.in/api/ doing? Is it using blockchain.info, or your own bitcoind?
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.
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.
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:
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]
Needs a proper license for developers.
This script leaks information to Google because QR codes are generated by making a request to Google
https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=bitcoin:addressgoesgere
You should really use a local QR code generating JS library. There are many.
It also means you cannot get a QR code when offline.
I am trying to use http://coinb.in/multisig/ to create a transaction.
I keep getting "This address has no available balance to spend" though it has balance .
The address is :369cUZdwYuCf1L987xmMz8ZJZUT1UCWVQf
What I am missing here?
When using https://rawgit.com/OutCast3k/bitcoin-multisig/master/index.html ..I get " Failed to retrive unspent inputs"
At the moment there are several issues which stem from Coinb.in not supporting compressed keys.
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, 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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.