Commit graph

1358 commits

Author SHA1 Message Date
junderw
813b84f91f
Finalize and extract done 2019-07-03 15:13:36 +09:00
Luke Childs
8d74bebe04 Throw error when signing with a privkey that doesn't match the pubkey 2019-07-02 18:17:37 +07:00
junderw
354d67a31a
Just some ideas, TODO mostly. 2019-07-02 15:35:23 +09:00
junderw
4644e9d2eb
Finish canFinalize 2019-07-02 15:18:00 +09:00
junderw
f28e9cef71
Refactor
- Clean up sign
- Get the meaningful script
- Search for pubkey and prevent sign if can't find self
- Tests failed, so comment out for now
2019-07-02 15:03:24 +09:00
junderw
f72c915ff1
Start towards finalizing inputs 2019-07-01 19:57:35 +09:00
junderw
f87b66eb24
Finish sign 2019-07-01 18:55:18 +09:00
junderw
667ffb58eb
Use signature encode 2019-07-01 18:01:46 +09:00
Luke Childs
18e7c9de80 Move comments to main check logic 2019-06-28 18:28:28 +07:00
Luke Childs
f961724c73 Prefer buf1.equals(buf2) over Buffer.compare(buf1, buf2) !== 0 2019-06-28 18:26:42 +07:00
Luke Childs
95b4a2806d Improve code re-use for redeem script checks 2019-06-28 18:21:32 +07:00
Luke Childs
08627e65a3 Check redeem script matches witness utxo when signing PSBT input 2019-06-28 18:14:37 +07:00
Luke Childs
1afac399b1 Update BIP174 package to fix inheritance issues 2019-06-28 16:32:21 +07:00
Luke Childs
5fd18d806f Check redeem script matches when signing PSBT input 2019-06-27 18:19:45 +07:00
Luke Childs
98dff9a47e Check Non-witness UTXO hash when signing PSBT input 2019-06-26 17:55:02 +07:00
Luke Childs
ff3caa02fe Add BIP174 pseudo code for signing checks 2019-06-26 16:30:07 +07:00
Luke Childs
6ed635d7b4 Flesh out signInput interface 2019-06-25 18:22:00 +07:00
Luke Childs
6a5e395ebd Extend BIP174 PSBT base class 2019-06-24 17:38:21 +07:00
junderw
1b39d9caf4
Make errors clearer and increase coverage 2019-06-17 13:34:20 +09:00
junderw
691e4d15d1
Create Signer interface and use it 2019-06-14 15:25:07 +09:00
junderw
1cc7205e9c
Remove @ts-ignore 2019-06-14 14:48:22 +09:00
junderw
d814c21466
Condense sign parts work directly 2019-06-14 14:23:51 +09:00
junderw
84d5e67e38
Use for loop instead of some to allow for future await usage 2019-06-14 12:20:12 +09:00
junderw
ee3150d7c7
Refactor sign for clarity 2019-06-14 11:47:40 +09:00
junderw
7c454e5f44
TIL: destructuring objects without let or const is a thing 2019-06-13 17:08:43 +09:00
junderw
2e4c9f6b7a
Remove checks to outer function 2019-06-13 15:04:11 +09:00
junderw
053d282e9d
Add stricter Signer interface check 2019-06-13 13:32:21 +09:00
junderw
969b3a5e18
Fix tests to use new sign method 2019-06-13 13:07:00 +09:00
junderw
17f5f35569
Migrate to stricter type checks during sign 2019-06-12 19:33:18 +09:00
junderw
9aa2842123
Merge branch 'master' into trimSpace 2019-05-21 15:42:43 +09:00
junderw
e28e04427e
Use Prettier to make JS easier to read/audit 2019-04-21 21:30:21 +09:00
junderw
352e9ef0a3
Add low R signing to TransactionBuilder 2019-04-15 17:27:28 +09:00
junderw
3b402d00c6
Add low R grinding option 2019-04-12 17:44:55 +09:00
junderw
335ed99a1c
Fix error for lack of rmd160 in Electron v4 2019-04-02 18:57:07 +09:00
junderw
74375bfedf
Fix class constructors 2019-03-20 15:25:48 +09:00
junderw
0426c66389
Remove prepare script and checkMerkleRoot method on Block 2019-03-14 17:32:45 +09:00
junderw
7fb859b1f7
Fix lint types.ts 2019-03-07 14:21:11 +09:00
junderw
08c4d6ac7d
Fix lint for templates 2019-03-07 14:16:45 +09:00
junderw
512b03e284
Fix lint transaction_builder.ts 2019-03-07 14:03:04 +09:00
junderw
e6ea0389a2
Fix lint for transaction.ts 2019-03-07 13:40:23 +09:00
junderw
94f3348519
Fix lint for script_number.ts script_signature.ts 2019-03-07 13:21:18 +09:00
junderw
c2c650812e
Fix lint script.ts 2019-03-07 13:17:03 +09:00
junderw
f058140ea8
Fix lint payments p2wsh 2019-03-07 13:05:04 +09:00
junderw
3ddb88168d
Fix lint payments p2wpkh 2019-03-07 13:01:40 +09:00
junderw
fe62e13023
Fix lint payments p2sh 2019-03-07 12:59:52 +09:00
junderw
db0e3f1203
Fix lint payments p2pkh 2019-03-07 12:51:22 +09:00
junderw
8d5d78431c
Fix P2PK payment lint 2019-03-07 12:47:26 +09:00
junderw
4054f3ae87
Fix lint for p2ms payment 2019-03-07 12:40:18 +09:00
junderw
db937f8110
Fix lazy.ts in payments lint 2019-03-07 12:33:47 +09:00
junderw
389ec8cb33
Fix embed.ts and index.ts for payments lint 2019-03-07 12:29:24 +09:00
junderw
3f34fe457a
Fix index.ts networks.ts lint 2019-03-07 12:11:15 +09:00
junderw
6a734aef4c
Fix lint for ecpair.ts 2019-03-07 12:06:12 +09:00
junderw
cb5ab7684e
Fix classify.ts lint 2019-03-07 11:54:37 +09:00
junderw
51d078cbce
Fix block.ts lint 2019-03-07 11:47:00 +09:00
junderw
d9cba6f176
Fixed address.ts lint 2019-03-07 11:32:06 +09:00
junderw
ee60862df6
Add JS for prettier glob fix 2019-03-07 11:20:28 +09:00
junderw
0729fde36f
Remove eslint comments. 2019-03-05 15:11:20 +09:00
d-yokoi
0ad8fbc6ba
style: add build output after applying prettier 2019-03-04 22:11:54 +09:00
junderw
4c6ea80459
Check for segwit block with no witness commit 2019-01-17 17:10:52 +09:00
junderw
e52abecee2
Move to checkTxRoots and warn checkMerkleRoot deprecation 2019-01-17 17:01:15 +09:00
junderw
1732bafbc1
Update TypeScript to use ! instead of casting 2019-01-15 17:47:30 +09:00
junderw
bc28949056
Commit js, ts, and definitions in separate folders 2019-01-04 18:33:02 +09:00
junderw
e7ac2b9a4e
pull in bip32 typescript 2018-12-30 15:08:29 +09:00
junderw
63d51d1da7
Export some types and interfaces 2018-12-30 13:34:40 +09:00
junderw
b8c2e9e339
Change ECPair to be compatible with payment({pubkey:ecpair.publicKey}) 2018-12-30 11:23:28 +09:00
junderw
35adaa8471
Add test from bugfix, also remove unnecessary arg 2018-12-29 23:27:57 +09:00
junderw
f8427274cc
Add a few type aliases to TransactionBuilder 2018-12-29 23:00:32 +09:00
junderw
572fd159b0
Added TypeScript standard linter to tests 2018-12-29 22:49:35 +09:00
junderw
e58d012615
Remove safe-buffer and add type to bitcoin-ops 2018-12-29 21:39:19 +09:00
junderw
3124e50e52
TypeScript hates Buffer.prototype.reverse, so fixed it. 2018-12-29 16:36:36 +09:00
junderw
c17cdce348
Move all imports to modules where possible 2018-12-29 16:10:36 +09:00
junderw
9955c3c082
Add strictPropertyInitialization 2018-12-29 15:25:54 +09:00
junderw
fdf0006fde
Add strictNullChecks 2018-12-29 15:25:45 +09:00
junderw
4cddc83016
noImplicitAny is now true 2018-12-29 15:25:45 +09:00
junderw
867f4b59f9
Add payments 2018-12-29 15:25:45 +09:00
junderw
5c34b4ce22
Add Witness Commitment 2018-12-29 15:25:44 +09:00
junderw
604072ffad
Add P2SH 2018-12-29 15:25:44 +09:00
junderw
528dff01c1
Add P2WSH 2018-12-29 15:25:44 +09:00
junderw
c488001b82
Add P2WPKH 2018-12-29 15:25:44 +09:00
junderw
3db951fc64
Add p2pkh template 2018-12-29 15:25:44 +09:00
junderw
9da1c95f89
Add P2PK templates 2018-12-29 15:25:44 +09:00
junderw
2f32ea6bc9
OP_RETURN and Multisig templates 2018-12-29 15:25:43 +09:00
junderw
3b77caa4f1
Fixed script, script number and signature 2018-12-29 15:25:27 +09:00
junderw
fce08352f5
Add TransactionBuilder 2018-12-29 15:25:27 +09:00
junderw
58a6b0e545
Convert ECPair 2018-12-29 15:25:27 +09:00
junderw
a652d0492d
Added Transaction 2018-12-29 15:25:11 +09:00
junderw
2eb9534939
Move Block Class from ES6 PR 2018-12-29 15:25:00 +09:00
junderw
91d3037cf3
Fix some exports 2018-12-29 15:24:59 +09:00
junderw
037fbd8984
# This is a combination of 2 commits.
# The first commit's message is:

Add types to Networks and Addresses

# This is the 2nd commit message:

Added types
2018-12-29 15:23:28 +09:00
junderw
b4d54af0fe
Remove AllowJS and get definitions 2018-12-29 15:23:14 +09:00
junderw
d684a6b2ef
Fix compiler errors, tests, and scripts 2018-12-29 15:20:37 +09:00
junderw
bb98289501
Renamed files to ts 2018-12-21 17:55:03 +09:00
junderw
f860d467d6
Revert "Merge pull request #1086 from bitcoinjs/refactorTransaction"
This reverts commit 5e1ae82a5d, reversing
changes made to 96240b636d.
2018-12-19 00:16:48 +09:00
Jonathan Underwood
5e1ae82a5d
Merge pull request #1086 from bitcoinjs/refactorTransaction
Move Transaction to ES6 class syntax
2018-12-18 11:47:37 +09:00
junderw
7c0e02ad48
Fix Block to allow regtest target (easiest possible target) 2018-12-12 21:07:16 +09:00
junderw
44a98c0fa6
Add regtest network 2018-11-15 15:32:03 +09:00
junderw
a88aa33348
Revert function hoisting removal 2018-09-26 16:30:33 +09:00
Jonathan Underwood
582727f6de
Merge pull request #1232 from bitcoinjs/payments
P2SH/P2WSH payments .network should use .redeem.network if undefined
2018-09-26 15:09:39 +09:00
Daniel Cousens
a976fba27b add network derivation from redeem.network 2018-09-26 16:03:45 +10:00
junderw
17c89fdc5e
Move Transaction to ES6 2018-09-26 14:54:53 +09:00
junderw
b4bab427f8
Merge pull request #1201 from bitcoinjs/p2msmore
tests: add extra P2MS testing fixtures
2018-09-26 14:13:16 +09:00
Daniel Cousens
c8ae86b9ce refactor(txb): maxSignatures is optional 2018-09-26 15:02:18 +10:00
Daniel Cousens
7c3d1f292d txb: add inline explanatory comment 2018-09-26 14:57:03 +10:00
Daniel Cousens
1119a449a5 txbuilder: add missing signature P2MS fixture 2018-09-26 14:54:03 +10:00
Daniel Cousens
d232545ac8 rename MULTISIG to P2MS 2018-09-26 14:54:03 +10:00
Daniel Cousens
a58c5b4f5b txb/tests: add solo SIGHASH_ALL fixes 2018-09-26 14:52:05 +10:00
Daniel Cousens
2223e6170e txb/tests: test solo SIGHASH_ALL, support existing SIGHASH_NONE 2018-09-26 14:39:58 +10:00
Daniel Cousens
ed1c1a5661 txb: enforce outputs exist when signing 2018-09-26 14:36:10 +10:00
Daniel Cousens
f89ef93d1e rm empty file 2018-09-17 10:38:18 +10:00
JP Richardson
09b2475117
remove superfluous package.json file in payments/ 2018-09-16 01:17:04 -05:00
junderw
24d541d0ed
Fix default assignment of validate key for payments
Fixes problems with p2ms experienced in issue below.

Related: #1194
2018-08-28 14:21:18 +09:00
Jonathan Underwood
20551fd380
Merge pull request #1153 from bitcoinjs/paybetter
Increased coverage for payments
2018-08-23 13:47:07 +09:00
Daniel Cousens
55207e5742 tests/payments/p2pk*: add signature mismatch tests 2018-07-27 20:48:32 +10:00
Daniel Cousens
3ed77c4820 payments: cleanup 2018-07-27 20:48:28 +10:00
Daniel Cousens
54ec449a75 payments/p2sh: try not to rely on o. in validation 2018-07-27 20:31:30 +10:00
Daniel Cousens
cf9a35f59b payments: more const 2018-07-27 20:31:30 +10:00
Daniel Cousens
85b1b92b6d tests/ECPair: test fromPublic/fromPrivate in isolation 2018-07-26 18:05:39 +10:00
Daniel Cousens
079d83d887 txbuilder: note consensus issue 2018-07-23 10:41:01 +10:00
Daniel Cousens
de0259a820 tests/integration/payments: enable failing P2SH(P2WSH(P2WPKH)) tests 2018-07-20 17:30:29 +10:00
Daniel Cousens
74756ed597 TransactionBuilder: fix P2WPKH not using a P2PKH signScript for P2WPKH 2018-07-17 22:33:32 +10:00
Daniel Cousens
14d9636b6e testing/p2wsh: add missing test case coverage 2018-07-17 15:35:08 +10:00
Daniel Cousens
5481bde49c templates: rm unused nulldata code 2018-07-14 20:49:01 +10:00
Daniel Cousens
de90fea0ac payments: rename p2data to embed 2018-07-14 20:49:01 +10:00
Daniel Cousens
44c13665c8 payments: add p2data 2018-07-14 20:49:01 +10:00
Daniel Cousens
7104bb412e tests/payments: add missing tests 2018-07-14 20:45:30 +10:00
Daniel Cousens
0d9619aeed payments/p2wpkh: fix exception messages 2018-07-14 20:14:15 +10:00
Daniel Cousens
35e0956ed9 payments/p2ms: add const to p2ms 2018-07-14 20:14:13 +10:00
Daniel Cousens
a9090dc0cc templates: rm dead code 2018-07-03 23:00:00 +10:00
Daniel Cousens
0d0f1d0847 payments: rm dependence on address export 2018-07-03 22:07:08 +10:00
Daniel Cousens
6cacea6f31 rm templates export, rename to classify 2018-07-03 22:07:08 +10:00
Daniel Cousens
400be7114b use payments in TxBuilder 2018-06-27 17:39:55 +10:00
Daniel Cousens
1fba0c62a5 tests: add missing context information to Sighash V1 description 2018-06-27 17:38:27 +10:00
Daniel Cousens
47e5a0e179 witnessScriptHash: fix null decompile leading to errors -- TODO: add test 2018-06-27 17:38:27 +10:00
Daniel Cousens
38efc35fdf payments: dont always require output data 2018-06-27 13:40:20 +10:00
Daniel Cousens
6c957533d6 index: expose payments 2018-06-26 21:24:08 +10:00
Daniel Cousens
f9a739e1db add payments p2ms, p2pk, p2pkh, p2sh, p2wpkh, p2wsh 2018-06-26 21:24:08 +10:00
Daniel Cousens
a5db0a4e44 sed -i 's/ var / const /', with const->let fixes 2018-06-25 18:26:23 +10:00
Daniel Cousens
91b8823aa8 sed -i 's/^var /const /' 2018-06-25 16:25:46 +10:00
Daniel Cousens
93b1ae4303 sed -i 's/^let /const /' 2018-06-25 16:24:37 +10:00
Daniel Cousens
e50679d2c3
Merge pull request #1094 from bitcoinjs/canon
script isCanonical* refactor/renames
2018-06-21 12:45:21 +10:00
Daniel Cousens
7592a6bcc2 script: rename isCanonicalSignature to isCanonicalScriptSignature 2018-06-05 17:26:52 +10:00
Daniel Cousens
d934e543d8 rm Litecoin 2018-06-05 17:22:39 +10:00
Daniel Cousens
726e4c53b6 script: use ecc.isPoint for canonical public keys 2018-06-05 17:15:53 +10:00
Daniel Cousens
2fe220517f transition ECPair to properties over getters 2018-05-30 15:52:03 +10:00
Daniel Cousens
fba0699dd3 rm ecdsa, add new ECPair using secp256k1 2018-05-30 15:52:03 +10:00
Daniel Cousens
c2a5d9dc1a rm getAddress 2018-05-30 11:09:07 +10:00
Daniel Cousens
4aaf295cd5 fix standard 11 issues 2018-05-29 11:37:03 +10:00
Daniel Cousens
581f57ff6f script/tx: decompile returns maybe chunks 2018-05-22 18:50:00 +10:00
Daniel Cousens
6c4977983d ECPair/script_signature: switch to 64-byte RS buffers only 2018-05-22 16:59:05 +10:00
Daniel Cousens
884f3fd57d rm HDNode, use bip32 module 2018-05-22 13:46:45 +10:00