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

bitcoinjs-min.js giving incorrect addresses ? #2

Closed
9876691 opened this issue Dec 1, 2011 · 2 comments
Closed

bitcoinjs-min.js giving incorrect addresses ? #2

9876691 opened this issue Dec 1, 2011 · 2 comments

Comments

@9876691
Copy link

9876691 commented Dec 1, 2011

Hi,

I've got an issue I can reproduce with the following code.

<script src="https://raw.github.com/bitcoinjs/bitcoinjs-lib/master/build/bitcoinjs-min.js"></script>
<script>
var hex = '222cb2d3da6e9fa64d36c4580d3bf9fb81a35076c06b6b8f584c0230a00a3872';

var bytes = Crypto.util.hexToBytes(hex);
var btcKey = new Bitcoin.ECKey(bytes);
document.write(btcKey.getBitcoinAddress());
</script>

The output of this is 1BWL9833GQHYGtmvdfLD1Qxvors7LYjzBZ

However if I put the same hex string (222cb2d3da6e9fa64d36c4580d3bf9fb81a35076c06b6b8f584c0230a00a3872) into BitAddress.org http://bitaddress.org I get

175U2wVLLeCEMznpK6jnYyFdhzvmt8L9pf

BitAddress uses the same technique as above and also use BitcoinJS, so why the difference ?

@9876691
Copy link
Author

9876691 commented Dec 1, 2011

I get the correct address if I include the files seperately, so is bitcoinjs-min.js not up to date ?

@justmoon
Copy link
Member

justmoon commented Dec 2, 2011

Sorry, the build in the Github repo was outdated.

The official URL for publicly hosted copies of bitcoinjs-lib is: http://cdn.bitcoinjs.org/libs/bitcoinjs-lib/0.1.0/bitcoinjs-min.js

However, I strongly recommend hosting it yourself for anything other than a quick test.

@justmoon justmoon closed this as completed Dec 2, 2011
kyledrake referenced this issue in coinpunk/bitcoinjs-lib Feb 2, 2014
Support Numbers in formatValue
dcousens added a commit that referenced this issue Aug 16, 2014
Clean up Wallet constructor function
gskapka referenced this issue in provable-things/liquidjs-lib Jul 9, 2020
* Add prefix for confidential address to network

* Add method for finding address type

* Add test

* Add generated code

* Add comments

* Changes to generated code

* Fix code style

* Change property name to confidentialPrefix

* Define type for function return value

* Create unit test file

* Move contants to fixtures

* Fix test vectors
gskapka referenced this issue in provable-things/liquidjs-lib Jul 9, 2020
* Support encoding/decoding witness and confidential fields

* Add missing fields to Transaction for supporting witness and confidentiality

* Fixes & Refactors hashForWitnessV0

* Fixes due to breaking changes to addInput && fixes copying wtiness from raw && add unit test for hashForWitnessV0

* Add test vectors for hashForWitnessV0

* Lint

* Lint

* Fix due to Transaction.addInut breaking change
junderw pushed a commit that referenced this issue May 24, 2023
Update test to specify sighashTypes
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

2 participants