diff --git a/address.js b/src/address.js similarity index 100% rename from address.js rename to src/address.js diff --git a/base58.js b/src/base58.js similarity index 100% rename from base58.js rename to src/base58.js diff --git a/bitcoin.js b/src/bitcoin.js similarity index 95% rename from bitcoin.js rename to src/bitcoin.js index 42c5d13..452158b 100755 --- a/bitcoin.js +++ b/src/bitcoin.js @@ -90,6 +90,8 @@ function hashTransactionForSignature(scriptCode, tx, inIndex, hashType) var buffer = serializeTransaction(txTmp); buffer.concat(Crypto.util.wordsToBytes([parseInt(hashType)])); + + console.log(buffer); return Crypto.SHA256(Crypto.SHA256(buffer, {asBytes: true}), {asBytes: true}); }; @@ -148,8 +150,8 @@ $(function () { var key = new Bitcoin.ECKey(Crypto.util.hexToBytes("5c0b98e524ad188ddef35dc6abba13c34a351a05409e5d285403718b93336a4a")); key = new Bitcoin.ECKey(Crypto.util.hexToBytes("180cb41c7c600be951b5d3d0a7334acc7506173875834f7a6c4c786a28fcbb19")); //console.log(key.getBitcoinAddress().toString()); - var message = Crypto.util.hexToBytes("2aec28d323ee7b06a799d540d224b351161fe48967174ca5e43164e86137da11"); - message = [0]; + //var message = Crypto.util.hexToBytes("2aec28d323ee7b06a799d540d224b351161fe48967174ca5e43164e86137da11"); + //message = [0]; //var out = key.sign(message); //console.log("pubkey: "+Crypto.util.bytesToHex(key.getPub())); //console.log("sig: "+Crypto.util.bytesToHex(out)); @@ -161,4 +163,4 @@ $(function () { //console.log(Bitcoin.ECDSA.verify(Crypto.util.hexToBytes("230aba77ccde46bb17fcb0295a92c0cc42a6ea9f439aaadeb0094625f49e6ed8"), Crypto.util.hexToBytes("3046022100a3ee5408f0003d8ef00ff2e0537f54ba09771626ff70dca1f01296b05c510e85022100d4dc70a5bb50685b65833a97e536909a6951dd247a2fdbde6688c33ba6d6407501"),Crypto.util.hexToBytes("04a19c1f07c7a0868d86dbb37510305843cc730eb3bea8a99d92131f44950cecd923788419bfef2f635fad621d753f30d4b4b63b29da44b4f3d92db974537ad5a4"))); //console.log(Bitcoin.ECDSA.verify(Crypto.util.hexToBytes("c2c75bb77d7a5acddceb1d45ceef58e7451fd0d3abc9d4c16df7848eefafe00d"), Crypto.util.hexToBytes("3045022100ff9362dadcbf1f6ef954bc8eb27144bbb4f49abd32be1eb04c311151dcf4bcf802205112c2ca6a25aefb8be98bf460c5a9056c01253f31e118d80b81ec9604e3201a01"),Crypto.util.hexToBytes("04fe62ce7892ec209310c176ef7f06565865e286e8699e884603657efa9aa51086785099d544d4e04f1f7b4b065205c1783fade8daf4ba1e0d1962292e8eb722cd"))); }); -*/ +//*/ diff --git a/crypto-js/crypto-min.js b/src/crypto-js/crypto-min.js similarity index 100% rename from crypto-js/crypto-min.js rename to src/crypto-js/crypto-min.js diff --git a/crypto-js/crypto.js b/src/crypto-js/crypto.js similarity index 100% rename from crypto-js/crypto.js rename to src/crypto-js/crypto.js diff --git a/crypto-js/ripemd160.js b/src/crypto-js/ripemd160.js similarity index 100% rename from crypto-js/ripemd160.js rename to src/crypto-js/ripemd160.js diff --git a/crypto-js/sha256-min.js b/src/crypto-js/sha256-min.js similarity index 100% rename from crypto-js/sha256-min.js rename to src/crypto-js/sha256-min.js diff --git a/crypto-js/sha256.js b/src/crypto-js/sha256.js similarity index 100% rename from crypto-js/sha256.js rename to src/crypto-js/sha256.js diff --git a/ecdsa.js b/src/ecdsa.js similarity index 100% rename from ecdsa.js rename to src/ecdsa.js diff --git a/eckey.js b/src/eckey.js similarity index 100% rename from eckey.js rename to src/eckey.js diff --git a/events/eventemitter.js b/src/events/eventemitter.js similarity index 100% rename from events/eventemitter.js rename to src/events/eventemitter.js diff --git a/jsbn/ec.js b/src/jsbn/ec.js similarity index 100% rename from jsbn/ec.js rename to src/jsbn/ec.js diff --git a/jsbn/jsbn.js b/src/jsbn/jsbn.js similarity index 100% rename from jsbn/jsbn.js rename to src/jsbn/jsbn.js diff --git a/jsbn/jsbn2.js b/src/jsbn/jsbn2.js similarity index 100% rename from jsbn/jsbn2.js rename to src/jsbn/jsbn2.js diff --git a/jsbn/prng4.js b/src/jsbn/prng4.js similarity index 100% rename from jsbn/prng4.js rename to src/jsbn/prng4.js diff --git a/jsbn/rng.js b/src/jsbn/rng.js similarity index 100% rename from jsbn/rng.js rename to src/jsbn/rng.js diff --git a/jsbn/sec.js b/src/jsbn/sec.js similarity index 100% rename from jsbn/sec.js rename to src/jsbn/sec.js diff --git a/opcode.js b/src/opcode.js similarity index 100% rename from opcode.js rename to src/opcode.js diff --git a/script.js b/src/script.js similarity index 100% rename from script.js rename to src/script.js diff --git a/transaction.js b/src/transaction.js similarity index 99% rename from transaction.js rename to src/transaction.js index 53ec29c..b4da64e 100644 --- a/transaction.js +++ b/src/transaction.js @@ -137,6 +137,7 @@ txTmp.ins = [txTmp.ins[inIndex]]; } + console.log(txTmp); var buffer = txTmp.serialize(); buffer = buffer.concat(Crypto.util.wordsToBytes([parseInt(hashType)]).reverse()); diff --git a/txdb.js b/src/txdb.js similarity index 100% rename from txdb.js rename to src/txdb.js diff --git a/util.js b/src/util.js similarity index 100% rename from util.js rename to src/util.js diff --git a/wallet.js b/src/wallet.js similarity index 100% rename from wallet.js rename to src/wallet.js