@@ -28,7 +28,7 @@ For a smooth and quick integration:
28
28
#### Table of Contents
29
29
30
30
* [ bippath] ( #bippath )
31
- * [ Btc ] ( #btc )
31
+ * [ Acre ] ( #acre )
32
32
* [ Parameters] ( #parameters )
33
33
* [ Examples] ( #examples )
34
34
* [ getWalletXpub] ( #getwalletxpub )
@@ -55,7 +55,7 @@ For a smooth and quick integration:
55
55
* [ Parameters] ( #parameters-8 )
56
56
* [ getTrustedInputBIP143] ( #gettrustedinputbip143 )
57
57
* [ Parameters] ( #parameters-9 )
58
- * [ BtcNew ] ( #btcnew )
58
+ * [ AcreBtcNew ] ( #acrebtcnew )
59
59
* [ getWalletXpub] ( #getwalletxpub-1 )
60
60
* [ Parameters] ( #parameters-10 )
61
61
* [ getWalletPublicKey] ( #getwalletpublickey-1 )
@@ -68,7 +68,7 @@ For a smooth and quick integration:
68
68
* [ Parameters] ( #parameters-14 )
69
69
* [ descrTemplFrom] ( #descrtemplfrom )
70
70
* [ Parameters] ( #parameters-15 )
71
- * [ BtcOld ] ( #btcold )
71
+ * [ AcreBtcOld ] ( #acrebtcold )
72
72
* [ getWalletPublicKey] ( #getwalletpublickey-2 )
73
73
* [ Parameters] ( #parameters-16 )
74
74
* [ Examples] ( #examples-7 )
@@ -130,9 +130,9 @@ which are commonly used in hierarchical deterministic (HD) wallets.
130
130
It includes functions to convert BIP32 paths to and from different formats,
131
131
extract components from extended public keys (xpubs), and manipulate path elements.
132
132
133
- ### Btc
133
+ ### Acre
134
134
135
- Bitcoin API.
135
+ Acre app API.
136
136
137
137
#### Parameters
138
138
@@ -143,8 +143,8 @@ Bitcoin API.
143
143
#### Examples
144
144
145
145
``` javascript
146
- import Btc from " @blooo/hw-app-acre:" ;
147
- const btc = new Btc ({ transport, currency: " bitcoin" });
146
+ import Acre from " @blooo/hw-app-acre:" ;
147
+ const acre = new Acre ({ transport, currency: " bitcoin" });
148
148
```
149
149
150
150
#### getWalletXpub
@@ -181,8 +181,8 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
181
181
##### Examples
182
182
183
183
``` javascript
184
- btc .getWalletPublicKey (" 44'/0'/0'/0/0" ).then (o => o .bitcoinAddress )
185
- btc .getWalletPublicKey (" 49'/0'/0'/0/0" , { format: " p2sh" }).then (o => o .bitcoinAddress )
184
+ acre .getWalletPublicKey (" 44'/0'/0'/0/0" ).then (o => o .bitcoinAddress )
185
+ acre .getWalletPublicKey (" 49'/0'/0'/0/0" , { format: " p2sh" }).then (o => o .bitcoinAddress )
186
186
```
187
187
188
188
Returns ** [ Promise] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise ) <{publicKey: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , bitcoinAddress: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , chainCode: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) }>**   ;
@@ -199,7 +199,7 @@ You can sign a message according to the Bitcoin Signature format and retrieve v,
199
199
##### Examples
200
200
201
201
``` javascript
202
- btc .signMessage (" 44'/60'/0'/0'/0" , Buffer .from (" test" ).toString (" hex" )).then (function (result ) {
202
+ acre .signMessage (" 44'/60'/0'/0'/0" , Buffer .from (" test" ).toString (" hex" )).then (function (result ) {
203
203
var v = result[' v' ] + 27 + 4 ;
204
204
var signature = Buffer .from (v .toString (16 ) + result[' r' ] + result[' s' ], ' hex' ).toString (' base64' );
205
205
console .log (" Signature : " + signature);
@@ -239,7 +239,7 @@ To sign a transaction involving standard (P2PKH) inputs, call createTransaction
239
239
##### Examples
240
240
241
241
``` javascript
242
- btc .createTransaction ({
242
+ acre .createTransaction ({
243
243
inputs: [ [tx1, 1 ] ],
244
244
associatedKeysets: [" 0'/0/0" ],
245
245
outputScriptHex: " 01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -267,7 +267,7 @@ To obtain the signature of multisignature (P2SH) inputs, call signP2SHTransactio
267
267
##### Examples
268
268
269
269
``` javascript
270
- btc .signP2SHTransaction ({
270
+ acre .signP2SHTransaction ({
271
271
inputs: [ [tx, 1 , " 52210289b4a3ad52a919abd2bdd6920d8a6879b1e788c38aa76f0440a6f32a9f1996d02103a3393b1439d1693b063482c04bd40142db97bdf139eedd1b51ffb7070a37eac321030b9a409a1e476b0d5d17b804fcdb81cf30f9b99c6f3ae1178206e08bc500639853ae" ] ],
272
272
associatedKeysets: [" 0'/0/0" ],
273
273
outputScriptHex: " 01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -290,7 +290,7 @@ For each UTXO included in your transaction, create a transaction object from the
290
290
##### Examples
291
291
292
292
``` javascript
293
- const tx1 = btc .splitTransaction (" 01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000" );
293
+ const tx1 = acre .splitTransaction (" 01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000" );
294
294
```
295
295
296
296
Returns ** [ Transaction] ( #transaction ) ** the transaction object deserialized from the raw hexadecimal transaction
@@ -306,8 +306,8 @@ Serialize a transaction's outputs to hexadecimal
306
306
##### Examples
307
307
308
308
``` javascript
309
- const tx1 = btc .splitTransaction (" 01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000" );
310
- const outputScript = btc .serializeTransactionOutputs (tx1).toString (' hex' );
309
+ const tx1 = acre .splitTransaction (" 01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000" );
310
+ const outputScript = acre .serializeTransactionOutputs (tx1).toString (' hex' );
311
311
```
312
312
313
313
Returns ** [ Buffer] ( https://nodejs.org/api/buffer.html ) **   ;
@@ -338,25 +338,23 @@ Trusted input is the hash of a UTXO that needs to be signed. BIP143 is used for
338
338
339
339
Returns ** [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) **   ;
340
340
341
- ### BtcNew
341
+ ### AcreBtcNew
342
342
343
- This class implements the same interface as BtcOld (formerly
344
- named Btc), but interacts with Bitcoin hardware app version 2. 1.0+
345
- which uses a totally new APDU protocol. This new
346
- protocol is documented at
347
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/bitcoin .md >
343
+ This class implements the same interface as AcreBtcOld (formerly
344
+ named Btc), but interacts with Acre hardware app from version 1.0.0
345
+ which uses the same APDU protocol as the Bitcoin app version 2.1.0+.
346
+ This protocol is documented at
347
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/acre .md >
348
348
349
- Since the interface must remain compatible with BtcOld , the methods
349
+ Since the interface must remain compatible with AcreBtcOld , the methods
350
350
of this class are quite clunky, because it needs to adapt legacy
351
- input data into the PSBT process. In the future, a new interface should
352
- be developed that exposes PSBT to the outer world, which would render
353
- a much cleaner implementation.
351
+ input data into the PSBT process.
354
352
355
353
#### getWalletXpub
356
354
357
355
This is a new method that allow users to get an xpub at a standard path.
358
356
Standard paths are described at
359
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/bitcoin .md#description >
357
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/acre .md#description >
360
358
361
359
This boils down to paths (N=0 for Bitcoin, N=1 for Testnet):
362
360
M/44'/N'/x'/\*\*
@@ -409,7 +407,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
409
407
410
408
#### createPaymentTransaction
411
409
412
- Build and sign a transaction. See Btc .createPaymentTransaction for
410
+ Build and sign a transaction. See Acre .createPaymentTransaction for
413
411
details on how to use this method.
414
412
415
413
This method will convert the legacy arguments, CreateTransactionArg, into
@@ -455,7 +453,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
455
453
### descrTemplFrom
456
454
457
455
This function returns a descriptor template based on the address format.
458
- See < https://github.com/LedgerHQ /app-bitcoin-new /blob/develop/doc/wallet.md > for details of
456
+ See < https://github.com/blooo-io /app-acre /blob/develop/doc/wallet.md > for details of
459
457
the bitcoin descriptor template.
460
458
461
459
#### Parameters
@@ -464,9 +462,11 @@ the bitcoin descriptor template.
464
462
465
463
Returns ** DefaultDescriptorTemplate**   ;
466
464
467
- ### BtcOld
465
+ ### AcreBtcOld
468
466
469
- This Bitcoin old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0
467
+ This old API is compatible with versions of the Bitcoin nano app that are earlier than 2.1.0 .
468
+ It is never used by Acre, that is based on the latest Bitcoin nano app (2.1.0+).
469
+ This class is kept for compatibility purposes.
470
470
471
471
#### getWalletPublicKey
472
472
@@ -489,8 +489,8 @@ This Bitcoin old API is compatible with versions of the Bitcoin nano app that ar
489
489
##### Examples
490
490
491
491
``` javascript
492
- btc .getWalletPublicKey (" 44'/0'/0'/0/0" ).then (o => o .bitcoinAddress )
493
- btc .getWalletPublicKey (" 49'/0'/0'/0/0" , { format: " p2sh" }).then (o => o .bitcoinAddress )
492
+ acre .getWalletPublicKey (" 44'/0'/0'/0/0" ).then (o => o .bitcoinAddress )
493
+ acre .getWalletPublicKey (" 49'/0'/0'/0/0" , { format: " p2sh" }).then (o => o .bitcoinAddress )
494
494
```
495
495
496
496
Returns ** [ Promise] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise ) <{publicKey: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , bitcoinAddress: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , chainCode: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) }>**   ;
@@ -525,7 +525,7 @@ To sign a transaction involving standard (P2PKH) inputs, call createTransaction
525
525
##### Examples
526
526
527
527
``` javascript
528
- btc .createTransaction ({
528
+ acre .createTransaction ({
529
529
inputs: [ [tx1, 1 ] ],
530
530
associatedKeysets: [" 0'/0/0" ],
531
531
outputScriptHex: " 01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
@@ -658,7 +658,7 @@ Returns **[Buffer](https://nodejs.org/api/buffer.html)** The output key
658
658
### AppClient
659
659
660
660
This class encapsulates the APDU protocol documented at
661
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/bitcoin .md >
661
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/acre .md >
662
662
663
663
#### Parameters
664
664
@@ -696,17 +696,17 @@ The reason for this is the limited amount of memory available to the app,
696
696
so it can't always store the full psbt in memory.
697
697
698
698
The signing process is documented at
699
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/bitcoin .md#sign_psbt >
699
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/acre .md#sign_psbt >
700
700
701
701
#### Parameters
702
702
703
703
* ` psbt ` ** [ PsbtV2] ( #psbtv2 ) **   ;
704
704
705
705
### Merkle
706
706
707
- This class implements the merkle tree used by Ledger Bitcoin app v2+ ,
707
+ This class implements the merkle tree used by Ledger Acre app,
708
708
which is documented at
709
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/merkle.md >
709
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/merkle.md >
710
710
711
711
#### Parameters
712
712
@@ -716,7 +716,7 @@ which is documented at
716
716
### MerkleMap
717
717
718
718
This implements "Merkelized Maps", documented at
719
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/merkle.md#merkleized-maps >
719
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/merkle.md#merkleized-maps >
720
720
721
721
A merkelized map consist of two merkle trees, one for the keys of
722
722
a map and one for the values of the same map, thus the two merkle
@@ -736,7 +736,7 @@ how to construct output scripts from keys. A "Wallet Policy" consists
736
736
of a "Descriptor Template" and a list of "keys". A key is basically
737
737
a serialized BIP32 extended public key with some added derivation path
738
738
information. This is documented at
739
- < https://github.com/LedgerHQ /app-bitcoin-new /blob/master /doc/wallet.md >
739
+ < https://github.com/blooo-io /app-acre /blob/develop /doc/wallet.md >
740
740
741
741
#### Parameters
742
742
@@ -829,8 +829,8 @@ complemantary fields as needed in the future.
829
829
#### Examples
830
830
831
831
``` javascript
832
- const tx1 = btc .splitTransaction (" 01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000" );
833
- const outputScript = btc .serializeTransactionOutputs (tx1).toString (' hex' );
832
+ const tx1 = acre .splitTransaction (" 01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000" );
833
+ const outputScript = acre .serializeTransactionOutputs (tx1).toString (' hex' );
834
834
```
835
835
836
836
Returns ** [ Buffer] ( https://nodejs.org/api/buffer.html ) **   ;
0 commit comments