@bsv/sdk 1.6.14 → 1.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/transaction/http/HttpClient.d.ts +2 -0
- package/dist/types/src/transaction/http/HttpClient.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/reference/auth.md +159 -212
- package/docs/reference/compat.md +96 -120
- package/docs/reference/identity.md +12 -21
- package/docs/reference/kvstore.md +19 -21
- package/docs/reference/messages.md +0 -3
- package/docs/reference/overlay-tools.md +18 -46
- package/docs/reference/primitives.md +390 -571
- package/docs/reference/registry.md +20 -43
- package/docs/reference/script.md +105 -140
- package/docs/reference/storage.md +12 -32
- package/docs/reference/totp.md +11 -16
- package/docs/reference/transaction.md +129 -201
- package/docs/reference/wallet.md +64 -241
- package/package.json +1 -1
- package/src/transaction/http/HttpClient.ts +2 -0
|
@@ -52,7 +52,6 @@ See also: [Curve](./primitives.md#class-curve)
|
|
|
52
52
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
53
53
|
|
|
54
54
|
---
|
|
55
|
-
|
|
56
55
|
### Class: BigNumber
|
|
57
56
|
|
|
58
57
|
JavaScript numbers are only precise up to 53 bits. Since Bitcoin relies on
|
|
@@ -229,12 +228,12 @@ constructor(number: number | string | number[] | bigint | undefined = 0, base: n
|
|
|
229
228
|
|
|
230
229
|
Argument Details
|
|
231
230
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
+ **number**
|
|
232
|
+
+ The number (various types accepted) to construct a BigNumber from. Default is 0.
|
|
233
|
+
+ **base**
|
|
234
|
+
+ The base of number provided. By default is 10.
|
|
235
|
+
+ **endian**
|
|
236
|
+
+ The endianness provided. By default is 'big endian'.
|
|
238
237
|
|
|
239
238
|
#### Property red
|
|
240
239
|
|
|
@@ -243,7 +242,6 @@ Reduction context of the big number.
|
|
|
243
242
|
```ts
|
|
244
243
|
public red: ReductionContext | null
|
|
245
244
|
```
|
|
246
|
-
|
|
247
245
|
See also: [ReductionContext](./primitives.md#class-reductioncontext)
|
|
248
246
|
|
|
249
247
|
#### Property wordSize
|
|
@@ -268,7 +266,6 @@ The multiplicative inverse is a number which when multiplied with the current Bi
|
|
|
268
266
|
```ts
|
|
269
267
|
_invmp(p: BigNumber): BigNumber
|
|
270
268
|
```
|
|
271
|
-
|
|
272
269
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
273
270
|
|
|
274
271
|
Returns
|
|
@@ -277,8 +274,8 @@ The multiplicative inverse `BigNumber` in the modulus field specified by `p`.
|
|
|
277
274
|
|
|
278
275
|
Argument Details
|
|
279
276
|
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
+ **p**
|
|
278
|
+
+ The `BigNumber` specifying the modulus field.
|
|
282
279
|
|
|
283
280
|
#### Method bitLength
|
|
284
281
|
|
|
@@ -313,7 +310,6 @@ Creates a BigNumber from a number representing the "bits" value in a block heade
|
|
|
313
310
|
```ts
|
|
314
311
|
static fromBits(bits: number, strict: boolean = false): BigNumber
|
|
315
312
|
```
|
|
316
|
-
|
|
317
313
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
318
314
|
|
|
319
315
|
Returns
|
|
@@ -322,10 +318,10 @@ Returns a BigNumber equivalent to the "bits" value in a block header.
|
|
|
322
318
|
|
|
323
319
|
Argument Details
|
|
324
320
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
321
|
+
+ **bits**
|
|
322
|
+
+ The number representing the bits value in a block header.
|
|
323
|
+
+ **strict**
|
|
324
|
+
+ If true, an error is thrown if the number has negative bit set.
|
|
329
325
|
|
|
330
326
|
Throws
|
|
331
327
|
|
|
@@ -338,7 +334,6 @@ Creates a BigNumber from a hexadecimal string.
|
|
|
338
334
|
```ts
|
|
339
335
|
static fromHex(hex: string, endian?: "le" | "be" | "little" | "big"): BigNumber
|
|
340
336
|
```
|
|
341
|
-
|
|
342
337
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
343
338
|
|
|
344
339
|
Returns
|
|
@@ -347,10 +342,10 @@ Returns a BigNumber created from the hexadecimal input string.
|
|
|
347
342
|
|
|
348
343
|
Argument Details
|
|
349
344
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
345
|
+
+ **hex**
|
|
346
|
+
+ The hexadecimal string to create a BigNumber from.
|
|
347
|
+
+ **endian**
|
|
348
|
+
+ Optional endianness for parsing the hex string.
|
|
354
349
|
|
|
355
350
|
Example
|
|
356
351
|
|
|
@@ -366,7 +361,6 @@ Creates a BigNumber from a JSON-serialized string.
|
|
|
366
361
|
```ts
|
|
367
362
|
static fromJSON(str: string): BigNumber
|
|
368
363
|
```
|
|
369
|
-
|
|
370
364
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
371
365
|
|
|
372
366
|
Returns
|
|
@@ -375,8 +369,8 @@ Returns a BigNumber created from the JSON input string.
|
|
|
375
369
|
|
|
376
370
|
Argument Details
|
|
377
371
|
|
|
378
|
-
|
|
379
|
-
|
|
372
|
+
+ **str**
|
|
373
|
+
+ The JSON-serialized string to create a BigNumber from.
|
|
380
374
|
|
|
381
375
|
#### Method fromNumber
|
|
382
376
|
|
|
@@ -385,7 +379,6 @@ Creates a BigNumber from a number.
|
|
|
385
379
|
```ts
|
|
386
380
|
static fromNumber(n: number): BigNumber
|
|
387
381
|
```
|
|
388
|
-
|
|
389
382
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
390
383
|
|
|
391
384
|
Returns
|
|
@@ -394,8 +387,8 @@ Returns a BigNumber equivalent to the input number.
|
|
|
394
387
|
|
|
395
388
|
Argument Details
|
|
396
389
|
|
|
397
|
-
|
|
398
|
-
|
|
390
|
+
+ **n**
|
|
391
|
+
+ The number to create a BigNumber from.
|
|
399
392
|
|
|
400
393
|
#### Method fromScriptNum
|
|
401
394
|
|
|
@@ -404,7 +397,6 @@ Creates a BigNumber from the format used in Bitcoin scripts.
|
|
|
404
397
|
```ts
|
|
405
398
|
static fromScriptNum(num: number[], requireMinimal: boolean = false, maxNumSize?: number): BigNumber
|
|
406
399
|
```
|
|
407
|
-
|
|
408
400
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
409
401
|
|
|
410
402
|
Returns
|
|
@@ -413,12 +405,12 @@ Returns a BigNumber equivalent to the number used in a Bitcoin script.
|
|
|
413
405
|
|
|
414
406
|
Argument Details
|
|
415
407
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
408
|
+
+ **num**
|
|
409
|
+
+ The number in the format used in Bitcoin scripts.
|
|
410
|
+
+ **requireMinimal**
|
|
411
|
+
+ If true, non-minimally encoded values will throw an error.
|
|
412
|
+
+ **maxNumSize**
|
|
413
|
+
+ The maximum allowed size for the number.
|
|
422
414
|
|
|
423
415
|
#### Method fromSm
|
|
424
416
|
|
|
@@ -427,7 +419,6 @@ Creates a BigNumber from a signed magnitude number.
|
|
|
427
419
|
```ts
|
|
428
420
|
static fromSm(bytes: number[], endian: "big" | "little" = "big"): BigNumber
|
|
429
421
|
```
|
|
430
|
-
|
|
431
422
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
432
423
|
|
|
433
424
|
Returns
|
|
@@ -436,10 +427,10 @@ Returns a BigNumber equivalent to the signed magnitude number interpreted with s
|
|
|
436
427
|
|
|
437
428
|
Argument Details
|
|
438
429
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
430
|
+
+ **bytes**
|
|
431
|
+
+ The signed magnitude number to convert to a BigNumber.
|
|
432
|
+
+ **endian**
|
|
433
|
+
+ Defines endianess. If not provided, big endian is assumed.
|
|
443
434
|
|
|
444
435
|
#### Method fromString
|
|
445
436
|
|
|
@@ -448,7 +439,6 @@ Creates a BigNumber from a string, considering an optional base.
|
|
|
448
439
|
```ts
|
|
449
440
|
static fromString(str: string, base?: number | "hex"): BigNumber
|
|
450
441
|
```
|
|
451
|
-
|
|
452
442
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
453
443
|
|
|
454
444
|
Returns
|
|
@@ -457,10 +447,10 @@ Returns a BigNumber equivalent to the string after conversion from the specified
|
|
|
457
447
|
|
|
458
448
|
Argument Details
|
|
459
449
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
450
|
+
+ **str**
|
|
451
|
+
+ The string to create a BigNumber from.
|
|
452
|
+
+ **base**
|
|
453
|
+
+ The base used for conversion. If not provided, base 10 is assumed.
|
|
464
454
|
|
|
465
455
|
#### Method isBN
|
|
466
456
|
|
|
@@ -476,8 +466,8 @@ Returns
|
|
|
476
466
|
|
|
477
467
|
Argument Details
|
|
478
468
|
|
|
479
|
-
|
|
480
|
-
|
|
469
|
+
+ **num**
|
|
470
|
+
+ The value to be checked.
|
|
481
471
|
|
|
482
472
|
#### Method max
|
|
483
473
|
|
|
@@ -486,7 +476,6 @@ Returns the bigger value between two BigNumbers
|
|
|
486
476
|
```ts
|
|
487
477
|
static max(left: BigNumber, right: BigNumber): BigNumber
|
|
488
478
|
```
|
|
489
|
-
|
|
490
479
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
491
480
|
|
|
492
481
|
Returns
|
|
@@ -495,10 +484,10 @@ Returns
|
|
|
495
484
|
|
|
496
485
|
Argument Details
|
|
497
486
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
487
|
+
+ **left**
|
|
488
|
+
+ The first BigNumber to be compared.
|
|
489
|
+
+ **right**
|
|
490
|
+
+ The second BigNumber to be compared.
|
|
502
491
|
|
|
503
492
|
#### Method min
|
|
504
493
|
|
|
@@ -507,7 +496,6 @@ Returns the smaller value between two BigNumbers
|
|
|
507
496
|
```ts
|
|
508
497
|
static min(left: BigNumber, right: BigNumber): BigNumber
|
|
509
498
|
```
|
|
510
|
-
|
|
511
499
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
512
500
|
|
|
513
501
|
Returns
|
|
@@ -516,10 +504,10 @@ Returns
|
|
|
516
504
|
|
|
517
505
|
Argument Details
|
|
518
506
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
507
|
+
+ **left**
|
|
508
|
+
+ The first BigNumber to be compared.
|
|
509
|
+
+ **right**
|
|
510
|
+
+ The second BigNumber to be compared.
|
|
523
511
|
|
|
524
512
|
#### Method mulTo
|
|
525
513
|
|
|
@@ -529,7 +517,6 @@ It chooses the multiplication method based on the lengths of the numbers to opti
|
|
|
529
517
|
```ts
|
|
530
518
|
mulTo(num: BigNumber, out: BigNumber): BigNumber
|
|
531
519
|
```
|
|
532
|
-
|
|
533
520
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
534
521
|
|
|
535
522
|
Returns
|
|
@@ -538,10 +525,10 @@ The BigNumber resulting from the multiplication operation.
|
|
|
538
525
|
|
|
539
526
|
Argument Details
|
|
540
527
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
528
|
+
+ **num**
|
|
529
|
+
+ The BigNumber multiply with.
|
|
530
|
+
+ **out**
|
|
531
|
+
+ The BigNumber where to store the result.
|
|
545
532
|
|
|
546
533
|
#### Method toArray
|
|
547
534
|
|
|
@@ -557,10 +544,10 @@ Array of bytes representing the BigNumber.
|
|
|
557
544
|
|
|
558
545
|
Argument Details
|
|
559
546
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
547
|
+
+ **endian**
|
|
548
|
+
+ Endianness of the output array, defaults to 'be'.
|
|
549
|
+
+ **length**
|
|
550
|
+
+ Optional length of the output array.
|
|
564
551
|
|
|
565
552
|
#### Method toBitArray
|
|
566
553
|
|
|
@@ -569,7 +556,6 @@ Converts a BigNumber to an array of bits.
|
|
|
569
556
|
```ts
|
|
570
557
|
static toBitArray(num: BigNumber): Array<0 | 1>
|
|
571
558
|
```
|
|
572
|
-
|
|
573
559
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
574
560
|
|
|
575
561
|
Returns
|
|
@@ -578,8 +564,8 @@ An array of bits.
|
|
|
578
564
|
|
|
579
565
|
Argument Details
|
|
580
566
|
|
|
581
|
-
|
|
582
|
-
|
|
567
|
+
+ **num**
|
|
568
|
+
+ The BigNumber to convert.
|
|
583
569
|
|
|
584
570
|
#### Method toBits
|
|
585
571
|
|
|
@@ -607,8 +593,8 @@ Returns a string representing the hexadecimal value of this BigNumber.
|
|
|
607
593
|
|
|
608
594
|
Argument Details
|
|
609
595
|
|
|
610
|
-
|
|
611
|
-
|
|
596
|
+
+ **length**
|
|
597
|
+
+ The minimum length of the hex string
|
|
612
598
|
|
|
613
599
|
Example
|
|
614
600
|
|
|
@@ -672,8 +658,8 @@ Returns an array equivalent to this BigNumber interpreted as a signed magnitude
|
|
|
672
658
|
|
|
673
659
|
Argument Details
|
|
674
660
|
|
|
675
|
-
|
|
676
|
-
|
|
661
|
+
+ **endian**
|
|
662
|
+
+ Defines endianess. If not provided, big endian is assumed.
|
|
677
663
|
|
|
678
664
|
#### Method toString
|
|
679
665
|
|
|
@@ -691,10 +677,10 @@ The string representation of the BigNumber instance
|
|
|
691
677
|
|
|
692
678
|
Argument Details
|
|
693
679
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
680
|
+
+ **base**
|
|
681
|
+
+ The base for representing number. Default is 10. Other accepted values are 16 and 'hex'.
|
|
682
|
+
+ **padding**
|
|
683
|
+
+ Represents the minimum number of digits to represent the BigNumber as a string. Default is 1.
|
|
698
684
|
|
|
699
685
|
#### Method zeroBits
|
|
700
686
|
|
|
@@ -719,7 +705,6 @@ const zeroBits = bn.zeroBits(); // 3
|
|
|
719
705
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
720
706
|
|
|
721
707
|
---
|
|
722
|
-
|
|
723
708
|
### Class: Curve
|
|
724
709
|
|
|
725
710
|
```ts
|
|
@@ -794,7 +779,6 @@ See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#
|
|
|
794
779
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
795
780
|
|
|
796
781
|
---
|
|
797
|
-
|
|
798
782
|
### Class: DRBG
|
|
799
783
|
|
|
800
784
|
This class behaves as a HMAC-based deterministic random bit generator (DRBG). It implements a deterministic random number generator using SHA256HMAC HASH function. It takes an initial entropy and nonce when instantiated for seeding purpose.
|
|
@@ -833,8 +817,8 @@ The required deterministic random hexadecimal string.
|
|
|
833
817
|
|
|
834
818
|
Argument Details
|
|
835
819
|
|
|
836
|
-
|
|
837
|
-
|
|
820
|
+
+ **len**
|
|
821
|
+
+ The length of required random number.
|
|
838
822
|
|
|
839
823
|
Example
|
|
840
824
|
|
|
@@ -849,7 +833,6 @@ Generates HMAC using the K value of the instance. This method is used internally
|
|
|
849
833
|
```ts
|
|
850
834
|
hmac(): SHA256HMAC
|
|
851
835
|
```
|
|
852
|
-
|
|
853
836
|
See also: [SHA256HMAC](./primitives.md#class-sha256hmac)
|
|
854
837
|
|
|
855
838
|
Returns
|
|
@@ -877,8 +860,8 @@ Nothing, but updates the internal state `K` and `V` value.
|
|
|
877
860
|
|
|
878
861
|
Argument Details
|
|
879
862
|
|
|
880
|
-
|
|
881
|
-
|
|
863
|
+
+ **seed**
|
|
864
|
+
+ an optional value that used to update `K` and `V`. Default is `undefined`.
|
|
882
865
|
|
|
883
866
|
Example
|
|
884
867
|
|
|
@@ -889,7 +872,6 @@ drbg.update('e13af...');
|
|
|
889
872
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
890
873
|
|
|
891
874
|
---
|
|
892
|
-
|
|
893
875
|
### Class: JacobianPoint
|
|
894
876
|
|
|
895
877
|
The `JacobianPoint` class extends the `BasePoint` class for handling Jacobian coordinates on an Elliptic Curve.
|
|
@@ -932,19 +914,18 @@ Constructs a new `JacobianPoint` instance.
|
|
|
932
914
|
```ts
|
|
933
915
|
constructor(x: string | BigNumber | null, y: string | BigNumber | null, z: string | BigNumber | null)
|
|
934
916
|
```
|
|
935
|
-
|
|
936
917
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
937
918
|
|
|
938
919
|
Argument Details
|
|
939
920
|
|
|
940
|
-
|
|
941
|
-
|
|
921
|
+
+ **x**
|
|
922
|
+
+ If `null`, the x-coordinate will default to the curve's defined 'one' constant.
|
|
942
923
|
If `x` is not a BigNumber, `x` will be converted to a `BigNumber` assuming it is a hex string.
|
|
943
|
-
|
|
944
|
-
|
|
924
|
+
+ **y**
|
|
925
|
+
+ If `null`, the y-coordinate will default to the curve's defined 'one' constant.
|
|
945
926
|
If `y` is not a BigNumber, `y` will be converted to a `BigNumber` assuming it is a hex string.
|
|
946
|
-
|
|
947
|
-
|
|
927
|
+
+ **z**
|
|
928
|
+
+ If `null`, the z-coordinate will default to 0.
|
|
948
929
|
If `z` is not a BigNumber, `z` will be converted to a `BigNumber` assuming it is a hex string.
|
|
949
930
|
|
|
950
931
|
Example
|
|
@@ -961,7 +942,6 @@ The `x` coordinate of the point in the Jacobian form.
|
|
|
961
942
|
```ts
|
|
962
943
|
x: BigNumber
|
|
963
944
|
```
|
|
964
|
-
|
|
965
945
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
966
946
|
|
|
967
947
|
#### Property y
|
|
@@ -971,7 +951,6 @@ The `y` coordinate of the point in the Jacobian form.
|
|
|
971
951
|
```ts
|
|
972
952
|
y: BigNumber
|
|
973
953
|
```
|
|
974
|
-
|
|
975
954
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
976
955
|
|
|
977
956
|
#### Property z
|
|
@@ -981,7 +960,6 @@ The `z` coordinate of the point in the Jacobian form.
|
|
|
981
960
|
```ts
|
|
982
961
|
z: BigNumber
|
|
983
962
|
```
|
|
984
|
-
|
|
985
963
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
986
964
|
|
|
987
965
|
#### Property zOne
|
|
@@ -1001,7 +979,6 @@ when either one of the points is the point at infinity, it will return the other
|
|
|
1001
979
|
```ts
|
|
1002
980
|
add(p: JacobianPoint): JacobianPoint
|
|
1003
981
|
```
|
|
1004
|
-
|
|
1005
982
|
See also: [JacobianPoint](./primitives.md#class-jacobianpoint)
|
|
1006
983
|
|
|
1007
984
|
Returns
|
|
@@ -1010,8 +987,8 @@ Returns a new Jacobian point as the result of the addition.
|
|
|
1010
987
|
|
|
1011
988
|
Argument Details
|
|
1012
989
|
|
|
1013
|
-
|
|
1014
|
-
|
|
990
|
+
+ **p**
|
|
991
|
+
+ The Jacobian point to be added.
|
|
1015
992
|
|
|
1016
993
|
Example
|
|
1017
994
|
|
|
@@ -1028,7 +1005,6 @@ Point doubling operation in the Jacobian coordinates. A special case is when the
|
|
|
1028
1005
|
```ts
|
|
1029
1006
|
dbl(): JacobianPoint
|
|
1030
1007
|
```
|
|
1031
|
-
|
|
1032
1008
|
See also: [JacobianPoint](./primitives.md#class-jacobianpoint)
|
|
1033
1009
|
|
|
1034
1010
|
Returns
|
|
@@ -1049,7 +1025,6 @@ Multiple doubling operation. It doubles the Jacobian point as many times as the
|
|
|
1049
1025
|
```ts
|
|
1050
1026
|
dblp(pow: number): JacobianPoint
|
|
1051
1027
|
```
|
|
1052
|
-
|
|
1053
1028
|
See also: [JacobianPoint](./primitives.md#class-jacobianpoint)
|
|
1054
1029
|
|
|
1055
1030
|
Returns
|
|
@@ -1058,8 +1033,8 @@ Returns a new Jacobian point as the result of multiple doublings.
|
|
|
1058
1033
|
|
|
1059
1034
|
Argument Details
|
|
1060
1035
|
|
|
1061
|
-
|
|
1062
|
-
|
|
1036
|
+
+ **pow**
|
|
1037
|
+
+ The number of times the point should be doubled.
|
|
1063
1038
|
|
|
1064
1039
|
Example
|
|
1065
1040
|
|
|
@@ -1075,7 +1050,6 @@ Equality check operation. It checks whether the affine or Jacobian point is equa
|
|
|
1075
1050
|
```ts
|
|
1076
1051
|
eq(p: Point | JacobianPoint): boolean
|
|
1077
1052
|
```
|
|
1078
|
-
|
|
1079
1053
|
See also: [JacobianPoint](./primitives.md#class-jacobianpoint), [Point](./primitives.md#class-point)
|
|
1080
1054
|
|
|
1081
1055
|
Returns
|
|
@@ -1084,8 +1058,8 @@ Returns true if the points are equal, otherwise returns false.
|
|
|
1084
1058
|
|
|
1085
1059
|
Argument Details
|
|
1086
1060
|
|
|
1087
|
-
|
|
1088
|
-
|
|
1061
|
+
+ **p**
|
|
1062
|
+
+ The affine or Jacobian point to compare with.
|
|
1089
1063
|
|
|
1090
1064
|
Example
|
|
1091
1065
|
|
|
@@ -1104,7 +1078,6 @@ of a point in projective coordinates.
|
|
|
1104
1078
|
```ts
|
|
1105
1079
|
eqXToP(x: BigNumber): boolean
|
|
1106
1080
|
```
|
|
1107
|
-
|
|
1108
1081
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1109
1082
|
|
|
1110
1083
|
Returns
|
|
@@ -1113,8 +1086,8 @@ Returns true if the x coordinates are equal, otherwise returns false.
|
|
|
1113
1086
|
|
|
1114
1087
|
Argument Details
|
|
1115
1088
|
|
|
1116
|
-
|
|
1117
|
-
|
|
1089
|
+
+ **x**
|
|
1090
|
+
+ The x coordinate of a point in projective coordinates.
|
|
1118
1091
|
|
|
1119
1092
|
Example
|
|
1120
1093
|
|
|
@@ -1170,7 +1143,6 @@ the affine point to Jacobian, and then preforms the addition.
|
|
|
1170
1143
|
```ts
|
|
1171
1144
|
mixedAdd(p: Point): JacobianPoint
|
|
1172
1145
|
```
|
|
1173
|
-
|
|
1174
1146
|
See also: [JacobianPoint](./primitives.md#class-jacobianpoint), [Point](./primitives.md#class-point)
|
|
1175
1147
|
|
|
1176
1148
|
Returns
|
|
@@ -1179,8 +1151,8 @@ Returns the result of the mixed addition as a new Jacobian point.
|
|
|
1179
1151
|
|
|
1180
1152
|
Argument Details
|
|
1181
1153
|
|
|
1182
|
-
|
|
1183
|
-
|
|
1154
|
+
+ **p**
|
|
1155
|
+
+ The affine point to be added.
|
|
1184
1156
|
|
|
1185
1157
|
Example
|
|
1186
1158
|
|
|
@@ -1197,7 +1169,6 @@ Negation operation. It returns the additive inverse of the Jacobian point.
|
|
|
1197
1169
|
```ts
|
|
1198
1170
|
neg(): JacobianPoint
|
|
1199
1171
|
```
|
|
1200
|
-
|
|
1201
1172
|
See also: [JacobianPoint](./primitives.md#class-jacobianpoint)
|
|
1202
1173
|
|
|
1203
1174
|
Returns
|
|
@@ -1218,7 +1189,6 @@ Converts the `JacobianPoint` object instance to standard affine `Point` format a
|
|
|
1218
1189
|
```ts
|
|
1219
1190
|
toP(): Point
|
|
1220
1191
|
```
|
|
1221
|
-
|
|
1222
1192
|
See also: [Point](./primitives.md#class-point)
|
|
1223
1193
|
|
|
1224
1194
|
Returns
|
|
@@ -1237,7 +1207,6 @@ const pointP = pointJ.toP(); // The point in affine coordinates.
|
|
|
1237
1207
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1238
1208
|
|
|
1239
1209
|
---
|
|
1240
|
-
|
|
1241
1210
|
### Class: K256
|
|
1242
1211
|
|
|
1243
1212
|
A class representing K-256, a prime number with optimizations, specifically used in the secp256k1 curve.
|
|
@@ -1283,7 +1252,6 @@ Multiplies a BigNumber ('num') with the constant 'K' in-place and returns the re
|
|
|
1283
1252
|
```ts
|
|
1284
1253
|
imulK(num: BigNumber): BigNumber
|
|
1285
1254
|
```
|
|
1286
|
-
|
|
1287
1255
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1288
1256
|
|
|
1289
1257
|
Returns
|
|
@@ -1292,8 +1260,8 @@ Returns the mutated BigNumber after multiplication.
|
|
|
1292
1260
|
|
|
1293
1261
|
Argument Details
|
|
1294
1262
|
|
|
1295
|
-
|
|
1296
|
-
|
|
1263
|
+
+ **num**
|
|
1264
|
+
+ The BigNumber to multiply with K.
|
|
1297
1265
|
|
|
1298
1266
|
Example
|
|
1299
1267
|
|
|
@@ -1310,15 +1278,14 @@ rules. This method modifies the input and output big numbers.
|
|
|
1310
1278
|
```ts
|
|
1311
1279
|
split(input: BigNumber, output: BigNumber): void
|
|
1312
1280
|
```
|
|
1313
|
-
|
|
1314
1281
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1315
1282
|
|
|
1316
1283
|
Argument Details
|
|
1317
1284
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1285
|
+
+ **input**
|
|
1286
|
+
+ The BigNumber to be split.
|
|
1287
|
+
+ **output**
|
|
1288
|
+
+ The BigNumber that results from the split.
|
|
1322
1289
|
|
|
1323
1290
|
Example
|
|
1324
1291
|
|
|
@@ -1331,7 +1298,6 @@ k256.split(input, output);
|
|
|
1331
1298
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1332
1299
|
|
|
1333
1300
|
---
|
|
1334
|
-
|
|
1335
1301
|
### Class: KeyShares
|
|
1336
1302
|
|
|
1337
1303
|
Example
|
|
@@ -1356,7 +1322,6 @@ See also: [PointInFiniteField](./primitives.md#class-pointinfinitefield)
|
|
|
1356
1322
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1357
1323
|
|
|
1358
1324
|
---
|
|
1359
|
-
|
|
1360
1325
|
### Class: Mersenne
|
|
1361
1326
|
|
|
1362
1327
|
A representation of a pseudo-Mersenne prime.
|
|
@@ -1385,10 +1350,10 @@ constructor(name: string, p: string)
|
|
|
1385
1350
|
|
|
1386
1351
|
Argument Details
|
|
1387
1352
|
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1353
|
+
+ **name**
|
|
1354
|
+
+ An identifier for the Mersenne instance.
|
|
1355
|
+
+ **p**
|
|
1356
|
+
+ A string representation of the pseudo-Mersenne prime, expressed in hexadecimal.
|
|
1392
1357
|
|
|
1393
1358
|
Example
|
|
1394
1359
|
|
|
@@ -1403,7 +1368,6 @@ The constant subtracted from 2^n to derive a pseudo-Mersenne prime.
|
|
|
1403
1368
|
```ts
|
|
1404
1369
|
k: BigNumber
|
|
1405
1370
|
```
|
|
1406
|
-
|
|
1407
1371
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1408
1372
|
|
|
1409
1373
|
#### Property n
|
|
@@ -1429,7 +1393,6 @@ BigNumber equivalent to 2^n - k.
|
|
|
1429
1393
|
```ts
|
|
1430
1394
|
p: BigNumber
|
|
1431
1395
|
```
|
|
1432
|
-
|
|
1433
1396
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1434
1397
|
|
|
1435
1398
|
#### Method imulK
|
|
@@ -1439,7 +1402,6 @@ Performs an in-place multiplication of the parameter by constant k.
|
|
|
1439
1402
|
```ts
|
|
1440
1403
|
imulK(num: BigNumber): BigNumber
|
|
1441
1404
|
```
|
|
1442
|
-
|
|
1443
1405
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1444
1406
|
|
|
1445
1407
|
Returns
|
|
@@ -1448,8 +1410,8 @@ The result of the multiplication, in BigNumber format.
|
|
|
1448
1410
|
|
|
1449
1411
|
Argument Details
|
|
1450
1412
|
|
|
1451
|
-
|
|
1452
|
-
|
|
1413
|
+
+ **num**
|
|
1414
|
+
+ The BigNumber to multiply with k.
|
|
1453
1415
|
|
|
1454
1416
|
Example
|
|
1455
1417
|
|
|
@@ -1465,7 +1427,6 @@ it is less than the square of the pseudo-Mersenne prime.
|
|
|
1465
1427
|
```ts
|
|
1466
1428
|
ireduce(num: BigNumber): BigNumber
|
|
1467
1429
|
```
|
|
1468
|
-
|
|
1469
1430
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1470
1431
|
|
|
1471
1432
|
Returns
|
|
@@ -1474,8 +1435,8 @@ The reduced BigNumber.
|
|
|
1474
1435
|
|
|
1475
1436
|
Argument Details
|
|
1476
1437
|
|
|
1477
|
-
|
|
1478
|
-
|
|
1438
|
+
+ **num**
|
|
1439
|
+
+ The BigNumber to be reduced.
|
|
1479
1440
|
|
|
1480
1441
|
Example
|
|
1481
1442
|
|
|
@@ -1491,15 +1452,14 @@ to meet the magnitude of the pseudo-Mersenne prime.
|
|
|
1491
1452
|
```ts
|
|
1492
1453
|
split(input: BigNumber, out: BigNumber): void
|
|
1493
1454
|
```
|
|
1494
|
-
|
|
1495
1455
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1496
1456
|
|
|
1497
1457
|
Argument Details
|
|
1498
1458
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1459
|
+
+ **input**
|
|
1460
|
+
+ The BigNumber to be shifted (will contain HI part).
|
|
1461
|
+
+ **out**
|
|
1462
|
+
+ The BigNumber to hold the shifted result (LO part).
|
|
1503
1463
|
|
|
1504
1464
|
Example
|
|
1505
1465
|
|
|
@@ -1510,7 +1470,6 @@ mersenne.split(new BigNumber('2345', 16), new BigNumber());
|
|
|
1510
1470
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1511
1471
|
|
|
1512
1472
|
---
|
|
1513
|
-
|
|
1514
1473
|
### Class: MontgomoryMethod
|
|
1515
1474
|
|
|
1516
1475
|
Represents a Montgomery reduction context, which is a mathematical method
|
|
@@ -1545,13 +1504,12 @@ See also: [BigNumber](./primitives.md#class-bignumber), [ReductionContext](./pri
|
|
|
1545
1504
|
```ts
|
|
1546
1505
|
constructor(m: BigNumber | "k256")
|
|
1547
1506
|
```
|
|
1548
|
-
|
|
1549
1507
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1550
1508
|
|
|
1551
1509
|
Argument Details
|
|
1552
1510
|
|
|
1553
|
-
|
|
1554
|
-
|
|
1511
|
+
+ **m**
|
|
1512
|
+
+ The modulus to be used for the Montgomery method reductions.
|
|
1555
1513
|
|
|
1556
1514
|
#### Property minv
|
|
1557
1515
|
|
|
@@ -1560,7 +1518,6 @@ The modular multiplicative inverse of `m` mod `r`.
|
|
|
1560
1518
|
```ts
|
|
1561
1519
|
minv: BigNumber
|
|
1562
1520
|
```
|
|
1563
|
-
|
|
1564
1521
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1565
1522
|
|
|
1566
1523
|
#### Property r
|
|
@@ -1570,7 +1527,6 @@ The 2^shift, shifted left by the bit length of modulus `m`.
|
|
|
1570
1527
|
```ts
|
|
1571
1528
|
r: BigNumber
|
|
1572
1529
|
```
|
|
1573
|
-
|
|
1574
1530
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1575
1531
|
|
|
1576
1532
|
#### Property r2
|
|
@@ -1580,7 +1536,6 @@ The square of `r` modulo `m`.
|
|
|
1580
1536
|
```ts
|
|
1581
1537
|
r2: BigNumber
|
|
1582
1538
|
```
|
|
1583
|
-
|
|
1584
1539
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1585
1540
|
|
|
1586
1541
|
#### Property rinv
|
|
@@ -1590,7 +1545,6 @@ The modular multiplicative inverse of `r` mod `m`.
|
|
|
1590
1545
|
```ts
|
|
1591
1546
|
rinv: BigNumber
|
|
1592
1547
|
```
|
|
1593
|
-
|
|
1594
1548
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1595
1549
|
|
|
1596
1550
|
#### Property shift
|
|
@@ -1608,7 +1562,6 @@ Converts a number from the Montgomery domain back to the original domain.
|
|
|
1608
1562
|
```ts
|
|
1609
1563
|
convertFrom(num: BigNumber): BigNumber
|
|
1610
1564
|
```
|
|
1611
|
-
|
|
1612
1565
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1613
1566
|
|
|
1614
1567
|
Returns
|
|
@@ -1617,8 +1570,8 @@ The result of the conversion from the Montgomery domain.
|
|
|
1617
1570
|
|
|
1618
1571
|
Argument Details
|
|
1619
1572
|
|
|
1620
|
-
|
|
1621
|
-
|
|
1573
|
+
+ **num**
|
|
1574
|
+
+ The number to be converted from the Montgomery domain.
|
|
1622
1575
|
|
|
1623
1576
|
Example
|
|
1624
1577
|
|
|
@@ -1634,7 +1587,6 @@ Converts a number into the Montgomery domain.
|
|
|
1634
1587
|
```ts
|
|
1635
1588
|
convertTo(num: BigNumber): BigNumber
|
|
1636
1589
|
```
|
|
1637
|
-
|
|
1638
1590
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1639
1591
|
|
|
1640
1592
|
Returns
|
|
@@ -1643,8 +1595,8 @@ The result of the conversion into the Montgomery domain.
|
|
|
1643
1595
|
|
|
1644
1596
|
Argument Details
|
|
1645
1597
|
|
|
1646
|
-
|
|
1647
|
-
|
|
1598
|
+
+ **num**
|
|
1599
|
+
+ The number to be converted into the Montgomery domain.
|
|
1648
1600
|
|
|
1649
1601
|
Example
|
|
1650
1602
|
|
|
@@ -1660,7 +1612,6 @@ Performs an in-place multiplication of two numbers in the Montgomery domain.
|
|
|
1660
1612
|
```ts
|
|
1661
1613
|
imul(a: BigNumber, b: BigNumber): BigNumber
|
|
1662
1614
|
```
|
|
1663
|
-
|
|
1664
1615
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1665
1616
|
|
|
1666
1617
|
Returns
|
|
@@ -1669,10 +1620,10 @@ The result of the in-place multiplication.
|
|
|
1669
1620
|
|
|
1670
1621
|
Argument Details
|
|
1671
1622
|
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1623
|
+
+ **a**
|
|
1624
|
+
+ The first number to multiply.
|
|
1625
|
+
+ **b**
|
|
1626
|
+
+ The second number to multiply.
|
|
1676
1627
|
|
|
1677
1628
|
Example
|
|
1678
1629
|
|
|
@@ -1688,7 +1639,6 @@ Calculates the modular multiplicative inverse of a number in the Montgomery doma
|
|
|
1688
1639
|
```ts
|
|
1689
1640
|
invm(a: BigNumber): BigNumber
|
|
1690
1641
|
```
|
|
1691
|
-
|
|
1692
1642
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1693
1643
|
|
|
1694
1644
|
Returns
|
|
@@ -1697,8 +1647,8 @@ The modular multiplicative inverse of 'a'.
|
|
|
1697
1647
|
|
|
1698
1648
|
Argument Details
|
|
1699
1649
|
|
|
1700
|
-
|
|
1701
|
-
|
|
1650
|
+
+ **a**
|
|
1651
|
+
+ The number to compute the modular multiplicative inverse of.
|
|
1702
1652
|
|
|
1703
1653
|
Example
|
|
1704
1654
|
|
|
@@ -1714,7 +1664,6 @@ Performs the multiplication of two numbers in the Montgomery domain.
|
|
|
1714
1664
|
```ts
|
|
1715
1665
|
mul(a: BigNumber, b: BigNumber): BigNumber
|
|
1716
1666
|
```
|
|
1717
|
-
|
|
1718
1667
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1719
1668
|
|
|
1720
1669
|
Returns
|
|
@@ -1723,10 +1672,10 @@ The result of the multiplication.
|
|
|
1723
1672
|
|
|
1724
1673
|
Argument Details
|
|
1725
1674
|
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1675
|
+
+ **a**
|
|
1676
|
+
+ The first number to multiply.
|
|
1677
|
+
+ **b**
|
|
1678
|
+
+ The second number to multiply.
|
|
1730
1679
|
|
|
1731
1680
|
Example
|
|
1732
1681
|
|
|
@@ -1738,7 +1687,6 @@ const product = montMethod.mul(a, b);
|
|
|
1738
1687
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1739
1688
|
|
|
1740
1689
|
---
|
|
1741
|
-
|
|
1742
1690
|
### Class: Point
|
|
1743
1691
|
|
|
1744
1692
|
`Point` class is a representation of an elliptic curve point with affine coordinates.
|
|
@@ -1796,17 +1744,16 @@ See also: [BasePoint](./primitives.md#class-basepoint), [BigNumber](./primitives
|
|
|
1796
1744
|
```ts
|
|
1797
1745
|
constructor(x: BigNumber | number | number[] | string | null, y: BigNumber | number | number[] | string | null, isRed: boolean = true)
|
|
1798
1746
|
```
|
|
1799
|
-
|
|
1800
1747
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1801
1748
|
|
|
1802
1749
|
Argument Details
|
|
1803
1750
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1751
|
+
+ **x**
|
|
1752
|
+
+ The x-coordinate of the point. May be a number, a BigNumber, a string (which will be interpreted as hex), a number array, or null. If null, an "Infinity" point is constructed.
|
|
1753
|
+
+ **y**
|
|
1754
|
+
+ The y-coordinate of the point, similar to x.
|
|
1755
|
+
+ **isRed**
|
|
1756
|
+
+ A boolean indicating if the point is a member of the field of integers modulo the k256 prime. Default is true.
|
|
1810
1757
|
|
|
1811
1758
|
Example
|
|
1812
1759
|
|
|
@@ -1830,7 +1777,6 @@ The x-coordinate of the point.
|
|
|
1830
1777
|
```ts
|
|
1831
1778
|
x: BigNumber | null
|
|
1832
1779
|
```
|
|
1833
|
-
|
|
1834
1780
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1835
1781
|
|
|
1836
1782
|
#### Property y
|
|
@@ -1840,7 +1786,6 @@ The y-coordinate of the point.
|
|
|
1840
1786
|
```ts
|
|
1841
1787
|
y: BigNumber | null
|
|
1842
1788
|
```
|
|
1843
|
-
|
|
1844
1789
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
1845
1790
|
|
|
1846
1791
|
#### Method add
|
|
@@ -1850,7 +1795,6 @@ Adds another Point to this Point, returning a new Point.
|
|
|
1850
1795
|
```ts
|
|
1851
1796
|
add(p: Point): Point
|
|
1852
1797
|
```
|
|
1853
|
-
|
|
1854
1798
|
See also: [Point](./primitives.md#class-point)
|
|
1855
1799
|
|
|
1856
1800
|
Returns
|
|
@@ -1859,8 +1803,8 @@ A new Point that results from the addition.
|
|
|
1859
1803
|
|
|
1860
1804
|
Argument Details
|
|
1861
1805
|
|
|
1862
|
-
|
|
1863
|
-
|
|
1806
|
+
+ **p**
|
|
1807
|
+
+ The Point to add to this one.
|
|
1864
1808
|
|
|
1865
1809
|
Example
|
|
1866
1810
|
|
|
@@ -1877,7 +1821,6 @@ Doubles the current point.
|
|
|
1877
1821
|
```ts
|
|
1878
1822
|
dbl(): Point
|
|
1879
1823
|
```
|
|
1880
|
-
|
|
1881
1824
|
See also: [Point](./primitives.md#class-point)
|
|
1882
1825
|
|
|
1883
1826
|
Example
|
|
@@ -1897,7 +1840,6 @@ a point at infinity is still infinity.
|
|
|
1897
1840
|
```ts
|
|
1898
1841
|
dblp(k: number): Point
|
|
1899
1842
|
```
|
|
1900
|
-
|
|
1901
1843
|
See also: [Point](./primitives.md#class-point)
|
|
1902
1844
|
|
|
1903
1845
|
Returns
|
|
@@ -1906,8 +1848,8 @@ The Point after 'k' "doubling" operations have been performed.
|
|
|
1906
1848
|
|
|
1907
1849
|
Argument Details
|
|
1908
1850
|
|
|
1909
|
-
|
|
1910
|
-
|
|
1851
|
+
+ **k**
|
|
1852
|
+
+ The number of times the "doubling" operation is to be performed on the Point.
|
|
1911
1853
|
|
|
1912
1854
|
Example
|
|
1913
1855
|
|
|
@@ -1931,10 +1873,10 @@ If enc is undefined, a byte array representation of the point will be returned.
|
|
|
1931
1873
|
|
|
1932
1874
|
Argument Details
|
|
1933
1875
|
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1876
|
+
+ **compact**
|
|
1877
|
+
+ If true, an additional prefix byte 0x02 or 0x03 based on the 'y' coordinate being even or odd respectively is used. If false, byte 0x04 is used.
|
|
1878
|
+
+ **enc**
|
|
1879
|
+
+ Expects the string 'hex' if hexadecimal string encoding is required instead of an array of numbers.
|
|
1938
1880
|
|
|
1939
1881
|
Throws
|
|
1940
1882
|
|
|
@@ -1955,7 +1897,6 @@ Checks if the Point instance is equal to another given Point.
|
|
|
1955
1897
|
```ts
|
|
1956
1898
|
eq(p: Point): boolean
|
|
1957
1899
|
```
|
|
1958
|
-
|
|
1959
1900
|
See also: [Point](./primitives.md#class-point)
|
|
1960
1901
|
|
|
1961
1902
|
Returns
|
|
@@ -1964,8 +1905,8 @@ Whether the two Point instances are equal. Both the 'x' and 'y' coordinates have
|
|
|
1964
1905
|
|
|
1965
1906
|
Argument Details
|
|
1966
1907
|
|
|
1967
|
-
|
|
1968
|
-
|
|
1908
|
+
+ **p**
|
|
1909
|
+
+ The Point to be checked if equal to the current instance.
|
|
1969
1910
|
|
|
1970
1911
|
Example
|
|
1971
1912
|
|
|
@@ -1984,7 +1925,6 @@ The function verifies the integrity of the provided data and throws errors if in
|
|
|
1984
1925
|
```ts
|
|
1985
1926
|
static fromDER(bytes: number[]): Point
|
|
1986
1927
|
```
|
|
1987
|
-
|
|
1988
1928
|
See also: [Point](./primitives.md#class-point)
|
|
1989
1929
|
|
|
1990
1930
|
Returns
|
|
@@ -1993,8 +1933,8 @@ Returns a new point representing the given string.
|
|
|
1993
1933
|
|
|
1994
1934
|
Argument Details
|
|
1995
1935
|
|
|
1996
|
-
|
|
1997
|
-
|
|
1936
|
+
+ **bytes**
|
|
1937
|
+
+ The point representation number array.
|
|
1998
1938
|
|
|
1999
1939
|
Throws
|
|
2000
1940
|
|
|
@@ -2018,7 +1958,6 @@ JSON points into proper Point objects.
|
|
|
2018
1958
|
```ts
|
|
2019
1959
|
static fromJSON(obj: string | any[], isRed: boolean): Point
|
|
2020
1960
|
```
|
|
2021
|
-
|
|
2022
1961
|
See also: [Point](./primitives.md#class-point)
|
|
2023
1962
|
|
|
2024
1963
|
Returns
|
|
@@ -2027,10 +1966,10 @@ Returns a new point based on the deserialized JSON object.
|
|
|
2027
1966
|
|
|
2028
1967
|
Argument Details
|
|
2029
1968
|
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
1969
|
+
+ **obj**
|
|
1970
|
+
+ An object or array that holds the data for the point.
|
|
1971
|
+
+ **isRed**
|
|
1972
|
+
+ A boolean to direct how the Point is constructed from the JSON object.
|
|
2034
1973
|
|
|
2035
1974
|
Example
|
|
2036
1975
|
|
|
@@ -2048,7 +1987,6 @@ The function verifies the integrity of the provided data and throws errors if in
|
|
|
2048
1987
|
```ts
|
|
2049
1988
|
static fromString(str: string): Point
|
|
2050
1989
|
```
|
|
2051
|
-
|
|
2052
1990
|
See also: [Point](./primitives.md#class-point)
|
|
2053
1991
|
|
|
2054
1992
|
Returns
|
|
@@ -2057,8 +1995,8 @@ Returns a new point representing the given string.
|
|
|
2057
1995
|
|
|
2058
1996
|
Argument Details
|
|
2059
1997
|
|
|
2060
|
-
|
|
2061
|
-
|
|
1998
|
+
+ **str**
|
|
1999
|
+
+ The point representation string.
|
|
2062
2000
|
|
|
2063
2001
|
Throws
|
|
2064
2002
|
|
|
@@ -2081,7 +2019,6 @@ y coordinate is odd.
|
|
|
2081
2019
|
```ts
|
|
2082
2020
|
static fromX(x: BigNumber | number | number[] | string, odd: boolean): Point
|
|
2083
2021
|
```
|
|
2084
|
-
|
|
2085
2022
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
2086
2023
|
|
|
2087
2024
|
Returns
|
|
@@ -2090,10 +2027,10 @@ Returns the new point.
|
|
|
2090
2027
|
|
|
2091
2028
|
Argument Details
|
|
2092
2029
|
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2030
|
+
+ **x**
|
|
2031
|
+
+ The x coordinate of the point.
|
|
2032
|
+
+ **odd**
|
|
2033
|
+
+ Boolean indicating whether the corresponding y coordinate is odd or not.
|
|
2097
2034
|
|
|
2098
2035
|
Throws
|
|
2099
2036
|
|
|
@@ -2113,7 +2050,6 @@ Returns X coordinate of point
|
|
|
2113
2050
|
```ts
|
|
2114
2051
|
getX(): BigNumber
|
|
2115
2052
|
```
|
|
2116
|
-
|
|
2117
2053
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
2118
2054
|
|
|
2119
2055
|
Example
|
|
@@ -2130,7 +2066,6 @@ Returns X coordinate of point
|
|
|
2130
2066
|
```ts
|
|
2131
2067
|
getY(): BigNumber
|
|
2132
2068
|
```
|
|
2133
|
-
|
|
2134
2069
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
2135
2070
|
|
|
2136
2071
|
Example
|
|
@@ -2186,7 +2121,6 @@ step. Instead of returning a regular Point, the result is a JacobianPoint.
|
|
|
2186
2121
|
```ts
|
|
2187
2122
|
jmulAdd(k1: BigNumber, p2: Point, k2: BigNumber): JPoint
|
|
2188
2123
|
```
|
|
2189
|
-
|
|
2190
2124
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
2191
2125
|
|
|
2192
2126
|
Returns
|
|
@@ -2195,12 +2129,12 @@ A JacobianPoint that results from the combined multiplication and addition opera
|
|
|
2195
2129
|
|
|
2196
2130
|
Argument Details
|
|
2197
2131
|
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2132
|
+
+ **k1**
|
|
2133
|
+
+ The scalar value to multiply this Point by.
|
|
2134
|
+
+ **p2**
|
|
2135
|
+
+ The other Point to be involved in the operation
|
|
2136
|
+
+ **k2**
|
|
2137
|
+
+ The scalar value to multiply the Point p2 by.
|
|
2204
2138
|
|
|
2205
2139
|
Example
|
|
2206
2140
|
|
|
@@ -2217,7 +2151,6 @@ Multiplies this Point by a scalar value, returning a new Point.
|
|
|
2217
2151
|
```ts
|
|
2218
2152
|
mul(k: BigNumber | number | number[] | string): Point
|
|
2219
2153
|
```
|
|
2220
|
-
|
|
2221
2154
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
2222
2155
|
|
|
2223
2156
|
Returns
|
|
@@ -2226,8 +2159,8 @@ A new Point that results from the multiplication.
|
|
|
2226
2159
|
|
|
2227
2160
|
Argument Details
|
|
2228
2161
|
|
|
2229
|
-
|
|
2230
|
-
|
|
2162
|
+
+ **k**
|
|
2163
|
+
+ The scalar value to multiply this Point by.
|
|
2231
2164
|
|
|
2232
2165
|
Example
|
|
2233
2166
|
|
|
@@ -2244,7 +2177,6 @@ Multiplies this Point by k1, adds the resulting Point to the result of p2 multip
|
|
|
2244
2177
|
```ts
|
|
2245
2178
|
mulAdd(k1: BigNumber, p2: Point, k2: BigNumber): Point
|
|
2246
2179
|
```
|
|
2247
|
-
|
|
2248
2180
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
2249
2181
|
|
|
2250
2182
|
Returns
|
|
@@ -2253,12 +2185,12 @@ A Point that results from the combined multiplication and addition operations.
|
|
|
2253
2185
|
|
|
2254
2186
|
Argument Details
|
|
2255
2187
|
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2188
|
+
+ **k1**
|
|
2189
|
+
+ The scalar value to multiply this Point by.
|
|
2190
|
+
+ **p2**
|
|
2191
|
+
+ The other Point to be involved in the operation.
|
|
2192
|
+
+ **k2**
|
|
2193
|
+
+ The scalar value to multiply the Point p2 by.
|
|
2262
2194
|
|
|
2263
2195
|
Example
|
|
2264
2196
|
|
|
@@ -2275,7 +2207,6 @@ Negate a point. The negation of a point P is the mirror of P about x-axis.
|
|
|
2275
2207
|
```ts
|
|
2276
2208
|
neg(_precompute?: boolean): Point
|
|
2277
2209
|
```
|
|
2278
|
-
|
|
2279
2210
|
See also: [Point](./primitives.md#class-point)
|
|
2280
2211
|
|
|
2281
2212
|
Example
|
|
@@ -2325,7 +2256,6 @@ toJSON(): [
|
|
|
2325
2256
|
}?
|
|
2326
2257
|
]
|
|
2327
2258
|
```
|
|
2328
|
-
|
|
2329
2259
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
2330
2260
|
|
|
2331
2261
|
Returns
|
|
@@ -2384,7 +2314,6 @@ const isValid = aPoint.validate();
|
|
|
2384
2314
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2385
2315
|
|
|
2386
2316
|
---
|
|
2387
|
-
|
|
2388
2317
|
### Class: PointInFiniteField
|
|
2389
2318
|
|
|
2390
2319
|
```ts
|
|
@@ -2410,7 +2339,6 @@ toString(): string
|
|
|
2410
2339
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2411
2340
|
|
|
2412
2341
|
---
|
|
2413
|
-
|
|
2414
2342
|
### Class: Polynomial
|
|
2415
2343
|
|
|
2416
2344
|
Polynomial class
|
|
@@ -2441,7 +2369,6 @@ See also: [BigNumber](./primitives.md#class-bignumber), [PointInFiniteField](./p
|
|
|
2441
2369
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2442
2370
|
|
|
2443
2371
|
---
|
|
2444
|
-
|
|
2445
2372
|
### Class: PrivateKey
|
|
2446
2373
|
|
|
2447
2374
|
Represents a Private Key, which is a secret that can be used to generate signatures in a cryptographic system.
|
|
@@ -2484,19 +2411,18 @@ See also: [BigNumber](./primitives.md#class-bignumber), [KeyShares](./primitives
|
|
|
2484
2411
|
```ts
|
|
2485
2412
|
constructor(number: BigNumber | number | string | number[] = 0, base: number | "be" | "le" | "hex" = 10, endian: "be" | "le" = "be", modN: "apply" | "nocheck" | "error" = "apply")
|
|
2486
2413
|
```
|
|
2487
|
-
|
|
2488
2414
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
2489
2415
|
|
|
2490
2416
|
Argument Details
|
|
2491
2417
|
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2418
|
+
+ **number**
|
|
2419
|
+
+ The number (various types accepted) to construct a BigNumber from. Default is 0.
|
|
2420
|
+
+ **base**
|
|
2421
|
+
+ The base of number provided. By default is 10. Ignored if number is BigNumber.
|
|
2422
|
+
+ **endian**
|
|
2423
|
+
+ The endianness provided. By default is 'big endian'. Ignored if number is BigNumber.
|
|
2424
|
+
+ **modN**
|
|
2425
|
+
+ Optional. Default 'apply. If 'apply', apply modN to input to guarantee a valid PrivateKey. If 'error', if input is out of field throw new Error('Input is out of field'). If 'nocheck', assumes input is in field.
|
|
2500
2426
|
|
|
2501
2427
|
Example
|
|
2502
2428
|
|
|
@@ -2516,7 +2442,6 @@ checkInField(): {
|
|
|
2516
2442
|
modN: BigNumber;
|
|
2517
2443
|
}
|
|
2518
2444
|
```
|
|
2519
|
-
|
|
2520
2445
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
2521
2446
|
|
|
2522
2447
|
Returns
|
|
@@ -2530,7 +2455,6 @@ Derives a child key with BRC-42.
|
|
|
2530
2455
|
```ts
|
|
2531
2456
|
deriveChild(publicKey: PublicKey, invoiceNumber: string): PrivateKey
|
|
2532
2457
|
```
|
|
2533
|
-
|
|
2534
2458
|
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
2535
2459
|
|
|
2536
2460
|
Returns
|
|
@@ -2539,10 +2463,10 @@ The derived child key.
|
|
|
2539
2463
|
|
|
2540
2464
|
Argument Details
|
|
2541
2465
|
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2466
|
+
+ **publicKey**
|
|
2467
|
+
+ The public key of the other party
|
|
2468
|
+
+ **invoiceNumber**
|
|
2469
|
+
+ The invoice number used to derive the child key
|
|
2546
2470
|
|
|
2547
2471
|
#### Method deriveSharedSecret
|
|
2548
2472
|
|
|
@@ -2551,7 +2475,6 @@ Derives a shared secret from the public key.
|
|
|
2551
2475
|
```ts
|
|
2552
2476
|
deriveSharedSecret(key: PublicKey): Point
|
|
2553
2477
|
```
|
|
2554
|
-
|
|
2555
2478
|
See also: [Point](./primitives.md#class-point), [PublicKey](./primitives.md#class-publickey)
|
|
2556
2479
|
|
|
2557
2480
|
Returns
|
|
@@ -2560,8 +2483,8 @@ The derived shared secret (a point on the curve).
|
|
|
2560
2483
|
|
|
2561
2484
|
Argument Details
|
|
2562
2485
|
|
|
2563
|
-
|
|
2564
|
-
|
|
2486
|
+
+ **key**
|
|
2487
|
+
+ The public key to derive the shared secret from.
|
|
2565
2488
|
|
|
2566
2489
|
Throws
|
|
2567
2490
|
|
|
@@ -2580,7 +2503,6 @@ const sharedSecret = privateKey.deriveSharedSecret(publicKey);
|
|
|
2580
2503
|
```ts
|
|
2581
2504
|
static fromBackupShares(shares: string[]): PrivateKey
|
|
2582
2505
|
```
|
|
2583
|
-
|
|
2584
2506
|
See also: [PrivateKey](./primitives.md#class-privatekey)
|
|
2585
2507
|
|
|
2586
2508
|
Returns
|
|
@@ -2603,7 +2525,6 @@ Generates a private key from a hexadecimal string.
|
|
|
2603
2525
|
```ts
|
|
2604
2526
|
static fromHex(str: string): PrivateKey
|
|
2605
2527
|
```
|
|
2606
|
-
|
|
2607
2528
|
See also: [PrivateKey](./primitives.md#class-privatekey)
|
|
2608
2529
|
|
|
2609
2530
|
Returns
|
|
@@ -2612,8 +2533,8 @@ The generated Private Key instance.
|
|
|
2612
2533
|
|
|
2613
2534
|
Argument Details
|
|
2614
2535
|
|
|
2615
|
-
|
|
2616
|
-
|
|
2536
|
+
+ **str**
|
|
2537
|
+
+ The hexadecimal string representing the private key. The string must represent a valid private key in big-endian format.
|
|
2617
2538
|
|
|
2618
2539
|
Throws
|
|
2619
2540
|
|
|
@@ -2626,7 +2547,6 @@ Combines shares to reconstruct the private key.
|
|
|
2626
2547
|
```ts
|
|
2627
2548
|
static fromKeyShares(keyShares: KeyShares): PrivateKey
|
|
2628
2549
|
```
|
|
2629
|
-
|
|
2630
2550
|
See also: [KeyShares](./primitives.md#class-keyshares), [PrivateKey](./primitives.md#class-privatekey)
|
|
2631
2551
|
|
|
2632
2552
|
Returns
|
|
@@ -2635,10 +2555,10 @@ The reconstructed private key.
|
|
|
2635
2555
|
|
|
2636
2556
|
Argument Details
|
|
2637
2557
|
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2558
|
+
+ **shares**
|
|
2559
|
+
+ An array of points (shares) to be used to reconstruct the private key.
|
|
2560
|
+
+ **threshold**
|
|
2561
|
+
+ The minimum number of shares required to reconstruct the private key.
|
|
2642
2562
|
|
|
2643
2563
|
#### Method fromRandom
|
|
2644
2564
|
|
|
@@ -2647,7 +2567,6 @@ Generates a private key randomly.
|
|
|
2647
2567
|
```ts
|
|
2648
2568
|
static fromRandom(): PrivateKey
|
|
2649
2569
|
```
|
|
2650
|
-
|
|
2651
2570
|
See also: [PrivateKey](./primitives.md#class-privatekey)
|
|
2652
2571
|
|
|
2653
2572
|
Returns
|
|
@@ -2667,7 +2586,6 @@ Generates a private key from a string.
|
|
|
2667
2586
|
```ts
|
|
2668
2587
|
static fromString(str: string, base: number | "hex" = "hex"): PrivateKey
|
|
2669
2588
|
```
|
|
2670
|
-
|
|
2671
2589
|
See also: [PrivateKey](./primitives.md#class-privatekey)
|
|
2672
2590
|
|
|
2673
2591
|
Returns
|
|
@@ -2676,10 +2594,10 @@ The generated Private Key.
|
|
|
2676
2594
|
|
|
2677
2595
|
Argument Details
|
|
2678
2596
|
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2597
|
+
+ **str**
|
|
2598
|
+
+ The string to generate the private key from.
|
|
2599
|
+
+ **base**
|
|
2600
|
+
+ The base of the string.
|
|
2683
2601
|
|
|
2684
2602
|
Throws
|
|
2685
2603
|
|
|
@@ -2692,7 +2610,6 @@ Generates a private key from a WIF (Wallet Import Format) string.
|
|
|
2692
2610
|
```ts
|
|
2693
2611
|
static fromWif(wif: string, prefixLength: number = 1): PrivateKey
|
|
2694
2612
|
```
|
|
2695
|
-
|
|
2696
2613
|
See also: [PrivateKey](./primitives.md#class-privatekey)
|
|
2697
2614
|
|
|
2698
2615
|
Returns
|
|
@@ -2701,10 +2618,10 @@ The generated Private Key.
|
|
|
2701
2618
|
|
|
2702
2619
|
Argument Details
|
|
2703
2620
|
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2621
|
+
+ **wif**
|
|
2622
|
+
+ The WIF string to generate the private key from.
|
|
2623
|
+
+ **base**
|
|
2624
|
+
+ The base of the string.
|
|
2708
2625
|
|
|
2709
2626
|
Throws
|
|
2710
2627
|
|
|
@@ -2727,7 +2644,6 @@ Signs a message using the private key.
|
|
|
2727
2644
|
```ts
|
|
2728
2645
|
sign(msg: number[] | string, enc?: "hex" | "utf8", forceLowS: boolean = true, customK?: ((iter: number) => BigNumber) | BigNumber): Signature
|
|
2729
2646
|
```
|
|
2730
|
-
|
|
2731
2647
|
See also: [BigNumber](./primitives.md#class-bignumber), [Signature](./primitives.md#class-signature)
|
|
2732
2648
|
|
|
2733
2649
|
Returns
|
|
@@ -2736,14 +2652,14 @@ A digital signature generated from the hash of the message and the private key.
|
|
|
2736
2652
|
|
|
2737
2653
|
Argument Details
|
|
2738
2654
|
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2655
|
+
+ **msg**
|
|
2656
|
+
+ The message (array of numbers or string) to be signed.
|
|
2657
|
+
+ **enc**
|
|
2658
|
+
+ If 'hex' the string will be treated as hex, utf8 otherwise.
|
|
2659
|
+
+ **forceLowS**
|
|
2660
|
+
+ If true (the default), the signature will be forced to have a low S value.
|
|
2661
|
+
+ **customK**
|
|
2662
|
+
+ — If provided, uses a custom K-value for the signature. Provie a function that returns a BigNumber, or the BigNumber itself.
|
|
2747
2663
|
|
|
2748
2664
|
Example
|
|
2749
2665
|
|
|
@@ -2767,8 +2683,8 @@ Returns the address encoding associated with the hash of the public key associat
|
|
|
2767
2683
|
|
|
2768
2684
|
Argument Details
|
|
2769
2685
|
|
|
2770
|
-
|
|
2771
|
-
|
|
2686
|
+
+ **prefix**
|
|
2687
|
+
+ defaults to [0x00] for mainnet, set to [0x6f] for testnet or use the strings 'testnet' or 'mainnet'
|
|
2772
2688
|
|
|
2773
2689
|
Example
|
|
2774
2690
|
|
|
@@ -2787,10 +2703,10 @@ toBackupShares(threshold: number, totalShares: number): string[]
|
|
|
2787
2703
|
|
|
2788
2704
|
Argument Details
|
|
2789
2705
|
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2706
|
+
+ **threshold**
|
|
2707
|
+
+ The number of shares which will be required to reconstruct the private key.
|
|
2708
|
+
+ **totalShares**
|
|
2709
|
+
+ The number of shares to generate for distribution.
|
|
2794
2710
|
|
|
2795
2711
|
#### Method toHex
|
|
2796
2712
|
|
|
@@ -2806,8 +2722,8 @@ Returns a string representing the hexadecimal value of this BigNumber.
|
|
|
2806
2722
|
|
|
2807
2723
|
Argument Details
|
|
2808
2724
|
|
|
2809
|
-
|
|
2810
|
-
|
|
2725
|
+
+ **length**
|
|
2726
|
+
+ The minimum length of the hex string
|
|
2811
2727
|
|
|
2812
2728
|
Example
|
|
2813
2729
|
|
|
@@ -2823,7 +2739,6 @@ Splits the private key into shares using Shamir's Secret Sharing Scheme.
|
|
|
2823
2739
|
```ts
|
|
2824
2740
|
toKeyShares(threshold: number, totalShares: number): KeyShares
|
|
2825
2741
|
```
|
|
2826
|
-
|
|
2827
2742
|
See also: [KeyShares](./primitives.md#class-keyshares)
|
|
2828
2743
|
|
|
2829
2744
|
Returns
|
|
@@ -2832,12 +2747,12 @@ An array of shares.
|
|
|
2832
2747
|
|
|
2833
2748
|
Argument Details
|
|
2834
2749
|
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2750
|
+
+ **threshold**
|
|
2751
|
+
+ The minimum number of shares required to reconstruct the private key.
|
|
2752
|
+
+ **totalShares**
|
|
2753
|
+
+ The total number of shares to generate.
|
|
2754
|
+
+ **prime**
|
|
2755
|
+
+ The prime number to be used in Shamir's Secret Sharing Scheme.
|
|
2841
2756
|
|
|
2842
2757
|
Example
|
|
2843
2758
|
|
|
@@ -2855,7 +2770,6 @@ The public key is generated by multiplying the base point G of the curve and the
|
|
|
2855
2770
|
```ts
|
|
2856
2771
|
toPublicKey(): PublicKey
|
|
2857
2772
|
```
|
|
2858
|
-
|
|
2859
2773
|
See also: [PublicKey](./primitives.md#class-publickey)
|
|
2860
2774
|
|
|
2861
2775
|
Returns
|
|
@@ -2885,10 +2799,10 @@ A string representation of the PrivateKey in the specified base, padded to the s
|
|
|
2885
2799
|
|
|
2886
2800
|
Argument Details
|
|
2887
2801
|
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2802
|
+
+ **base**
|
|
2803
|
+
+ The base for representing the number. Default is hexadecimal ('hex').
|
|
2804
|
+
+ **padding**
|
|
2805
|
+
+ The minimum number of digits for the output string. Default is 64, ensuring a 256-bit representation in hexadecimal.
|
|
2892
2806
|
|
|
2893
2807
|
#### Method toWif
|
|
2894
2808
|
|
|
@@ -2907,8 +2821,8 @@ The WIF string.
|
|
|
2907
2821
|
|
|
2908
2822
|
Argument Details
|
|
2909
2823
|
|
|
2910
|
-
|
|
2911
|
-
|
|
2824
|
+
+ **prefix**
|
|
2825
|
+
+ defaults to [0x80] for mainnet, set it to [0xef] for testnet.
|
|
2912
2826
|
|
|
2913
2827
|
Throws
|
|
2914
2828
|
|
|
@@ -2929,7 +2843,6 @@ Verifies a message's signature using the public key associated with this private
|
|
|
2929
2843
|
```ts
|
|
2930
2844
|
verify(msg: number[] | string, sig: Signature, enc?: "hex"): boolean
|
|
2931
2845
|
```
|
|
2932
|
-
|
|
2933
2846
|
See also: [Signature](./primitives.md#class-signature)
|
|
2934
2847
|
|
|
2935
2848
|
Returns
|
|
@@ -2938,12 +2851,12 @@ Whether or not the signature is valid.
|
|
|
2938
2851
|
|
|
2939
2852
|
Argument Details
|
|
2940
2853
|
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2854
|
+
+ **msg**
|
|
2855
|
+
+ The original message which has been signed.
|
|
2856
|
+
+ **sig**
|
|
2857
|
+
+ The signature to be verified.
|
|
2858
|
+
+ **enc**
|
|
2859
|
+
+ The data encoding method.
|
|
2947
2860
|
|
|
2948
2861
|
Example
|
|
2949
2862
|
|
|
@@ -2956,7 +2869,6 @@ const isSignatureValid = privateKey.verify('Hello, World!', signature);
|
|
|
2956
2869
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2957
2870
|
|
|
2958
2871
|
---
|
|
2959
|
-
|
|
2960
2872
|
### Class: PublicKey
|
|
2961
2873
|
|
|
2962
2874
|
The PublicKey class extends the Point class. It is used in public-key cryptography to derive shared secret, verify message signatures, and encode the public key in the DER format.
|
|
@@ -2985,17 +2897,16 @@ See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#
|
|
|
2985
2897
|
```ts
|
|
2986
2898
|
constructor(x: Point | BigNumber | number | number[] | string | null, y: BigNumber | number | number[] | string | null = null, isRed: boolean = true)
|
|
2987
2899
|
```
|
|
2988
|
-
|
|
2989
2900
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
2990
2901
|
|
|
2991
2902
|
Argument Details
|
|
2992
2903
|
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2904
|
+
+ **x**
|
|
2905
|
+
+ A point or the x-coordinate of the point. May be a number, a BigNumber, a string (which will be interpreted as hex), a number array, or null. If null, an "Infinity" point is constructed.
|
|
2906
|
+
+ **y**
|
|
2907
|
+
+ If x is not a point, the y-coordinate of the point, similar to x.
|
|
2908
|
+
+ **isRed**
|
|
2909
|
+
+ A boolean indicating if the point is a member of the field of integers modulo the k256 prime. Default is true.
|
|
2999
2910
|
|
|
3000
2911
|
Example
|
|
3001
2912
|
|
|
@@ -3011,7 +2922,6 @@ Derives a child key with BRC-42.
|
|
|
3011
2922
|
```ts
|
|
3012
2923
|
deriveChild(privateKey: PrivateKey, invoiceNumber: string): PublicKey
|
|
3013
2924
|
```
|
|
3014
|
-
|
|
3015
2925
|
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
3016
2926
|
|
|
3017
2927
|
Returns
|
|
@@ -3020,10 +2930,10 @@ The derived child key.
|
|
|
3020
2930
|
|
|
3021
2931
|
Argument Details
|
|
3022
2932
|
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
2933
|
+
+ **privateKey**
|
|
2934
|
+
+ The private key of the other party
|
|
2935
|
+
+ **invoiceNumber**
|
|
2936
|
+
+ The invoice number used to derive the child key
|
|
3027
2937
|
|
|
3028
2938
|
#### Method deriveSharedSecret
|
|
3029
2939
|
|
|
@@ -3033,7 +2943,6 @@ This method multiplies the public key (an instance of Point) with a private key.
|
|
|
3033
2943
|
```ts
|
|
3034
2944
|
deriveSharedSecret(priv: PrivateKey): Point
|
|
3035
2945
|
```
|
|
3036
|
-
|
|
3037
2946
|
See also: [Point](./primitives.md#class-point), [PrivateKey](./primitives.md#class-privatekey)
|
|
3038
2947
|
|
|
3039
2948
|
Returns
|
|
@@ -3042,8 +2951,8 @@ Returns the Point representing the shared secret.
|
|
|
3042
2951
|
|
|
3043
2952
|
Argument Details
|
|
3044
2953
|
|
|
3045
|
-
|
|
3046
|
-
|
|
2954
|
+
+ **priv**
|
|
2955
|
+
+ The private key to use in deriving the shared secret.
|
|
3047
2956
|
|
|
3048
2957
|
Throws
|
|
3049
2958
|
|
|
@@ -3063,7 +2972,6 @@ Static factory method to create a PublicKey instance from a number array.
|
|
|
3063
2972
|
```ts
|
|
3064
2973
|
static fromDER(bytes: number[]): PublicKey
|
|
3065
2974
|
```
|
|
3066
|
-
|
|
3067
2975
|
See also: [PublicKey](./primitives.md#class-publickey)
|
|
3068
2976
|
|
|
3069
2977
|
Returns
|
|
@@ -3072,8 +2980,8 @@ Returns the PublicKey created from the number array.
|
|
|
3072
2980
|
|
|
3073
2981
|
Argument Details
|
|
3074
2982
|
|
|
3075
|
-
|
|
3076
|
-
|
|
2983
|
+
+ **bytes**
|
|
2984
|
+
+ A number array representing a public key.
|
|
3077
2985
|
|
|
3078
2986
|
Example
|
|
3079
2987
|
|
|
@@ -3093,7 +3001,6 @@ The range represents the recovery param which can be 0,1,2,3.
|
|
|
3093
3001
|
```ts
|
|
3094
3002
|
static fromMsgHashAndCompactSignature(msgHash: BigNumber, signature: number[] | string, enc?: "hex" | "base64"): PublicKey
|
|
3095
3003
|
```
|
|
3096
|
-
|
|
3097
3004
|
See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey)
|
|
3098
3005
|
|
|
3099
3006
|
Returns
|
|
@@ -3102,12 +3009,12 @@ A PublicKey instance derived from the message hash and compact signature.
|
|
|
3102
3009
|
|
|
3103
3010
|
Argument Details
|
|
3104
3011
|
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3012
|
+
+ **msgHash**
|
|
3013
|
+
+ The message hash which was signed.
|
|
3014
|
+
+ **signature**
|
|
3015
|
+
+ The signature in compact format.
|
|
3016
|
+
+ **enc**
|
|
3017
|
+
+ The encoding of the signature string.
|
|
3111
3018
|
|
|
3112
3019
|
Example
|
|
3113
3020
|
|
|
@@ -3123,7 +3030,6 @@ It multiplies the generator point 'g' on the elliptic curve by the private key.
|
|
|
3123
3030
|
```ts
|
|
3124
3031
|
static fromPrivateKey(key: PrivateKey): PublicKey
|
|
3125
3032
|
```
|
|
3126
|
-
|
|
3127
3033
|
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
3128
3034
|
|
|
3129
3035
|
Returns
|
|
@@ -3132,8 +3038,8 @@ Returns the PublicKey derived from the given PrivateKey.
|
|
|
3132
3038
|
|
|
3133
3039
|
Argument Details
|
|
3134
3040
|
|
|
3135
|
-
|
|
3136
|
-
|
|
3041
|
+
+ **key**
|
|
3042
|
+
+ The private key from which to derive the public key.
|
|
3137
3043
|
|
|
3138
3044
|
Example
|
|
3139
3045
|
|
|
@@ -3149,7 +3055,6 @@ Static factory method to create a PublicKey instance from a string.
|
|
|
3149
3055
|
```ts
|
|
3150
3056
|
static fromString(str: string): PublicKey
|
|
3151
3057
|
```
|
|
3152
|
-
|
|
3153
3058
|
See also: [PublicKey](./primitives.md#class-publickey)
|
|
3154
3059
|
|
|
3155
3060
|
Returns
|
|
@@ -3158,8 +3063,8 @@ Returns the PublicKey created from the string.
|
|
|
3158
3063
|
|
|
3159
3064
|
Argument Details
|
|
3160
3065
|
|
|
3161
|
-
|
|
3162
|
-
|
|
3066
|
+
+ **str**
|
|
3067
|
+
+ A string representing a public key.
|
|
3163
3068
|
|
|
3164
3069
|
Example
|
|
3165
3070
|
|
|
@@ -3182,8 +3087,8 @@ Returns the address encoding associated with the hash of the public key.
|
|
|
3182
3087
|
|
|
3183
3088
|
Argument Details
|
|
3184
3089
|
|
|
3185
|
-
|
|
3186
|
-
|
|
3090
|
+
+ **prefix**
|
|
3091
|
+
+ defaults to [0x00] for mainnet, set to [0x6f] for testnet or use the strings 'mainnet' or 'testnet'
|
|
3187
3092
|
|
|
3188
3093
|
Example
|
|
3189
3094
|
|
|
@@ -3208,8 +3113,8 @@ Returns the DER-encoded public key in number array or string.
|
|
|
3208
3113
|
|
|
3209
3114
|
Argument Details
|
|
3210
3115
|
|
|
3211
|
-
|
|
3212
|
-
|
|
3116
|
+
+ **enc**
|
|
3117
|
+
+ The encoding of the DER string. undefined = number array, 'hex' = hex string.
|
|
3213
3118
|
|
|
3214
3119
|
Example
|
|
3215
3120
|
|
|
@@ -3242,7 +3147,6 @@ Verify a signature of a message using this public key.
|
|
|
3242
3147
|
```ts
|
|
3243
3148
|
verify(msg: number[] | string, sig: Signature, enc?: "hex" | "utf8"): boolean
|
|
3244
3149
|
```
|
|
3245
|
-
|
|
3246
3150
|
See also: [Signature](./primitives.md#class-signature)
|
|
3247
3151
|
|
|
3248
3152
|
Returns
|
|
@@ -3251,12 +3155,12 @@ Returns true if the signature is verified successfully, otherwise false.
|
|
|
3251
3155
|
|
|
3252
3156
|
Argument Details
|
|
3253
3157
|
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3158
|
+
+ **msg**
|
|
3159
|
+
+ The message to verify. It can be a string or an array of numbers.
|
|
3160
|
+
+ **sig**
|
|
3161
|
+
+ The Signature of the message that needs verification.
|
|
3162
|
+
+ **enc**
|
|
3163
|
+
+ The encoding of the message. It defaults to 'utf8'.
|
|
3260
3164
|
|
|
3261
3165
|
Example
|
|
3262
3166
|
|
|
@@ -3269,7 +3173,6 @@ const isVerified = myPubKey.verify(myMessage, mySignature)
|
|
|
3269
3173
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3270
3174
|
|
|
3271
3175
|
---
|
|
3272
|
-
|
|
3273
3176
|
### Class: RIPEMD160
|
|
3274
3177
|
|
|
3275
3178
|
An implementation of RIPEMD160 cryptographic hash function. Extends the BaseHash class.
|
|
@@ -3304,7 +3207,6 @@ h: number[]
|
|
|
3304
3207
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3305
3208
|
|
|
3306
3209
|
---
|
|
3307
|
-
|
|
3308
3210
|
### Class: Reader
|
|
3309
3211
|
|
|
3310
3212
|
```ts
|
|
@@ -3339,7 +3241,6 @@ See also: [BigNumber](./primitives.md#class-bignumber)
|
|
|
3339
3241
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3340
3242
|
|
|
3341
3243
|
---
|
|
3342
|
-
|
|
3343
3244
|
### Class: ReductionContext
|
|
3344
3245
|
|
|
3345
3246
|
A base reduction engine that provides several arithmetic operations over
|
|
@@ -3381,13 +3282,12 @@ Constructs a new ReductionContext.
|
|
|
3381
3282
|
```ts
|
|
3382
3283
|
constructor(m: BigNumber | "k256")
|
|
3383
3284
|
```
|
|
3384
|
-
|
|
3385
3285
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3386
3286
|
|
|
3387
3287
|
Argument Details
|
|
3388
3288
|
|
|
3389
|
-
|
|
3390
|
-
|
|
3289
|
+
+ **m**
|
|
3290
|
+
+ A BigNumber representing the modulus, or 'k256' to create a context for Koblitz curve.
|
|
3391
3291
|
|
|
3392
3292
|
Example
|
|
3393
3293
|
|
|
@@ -3403,7 +3303,6 @@ The modulus used for reduction operations.
|
|
|
3403
3303
|
```ts
|
|
3404
3304
|
m: BigNumber
|
|
3405
3305
|
```
|
|
3406
|
-
|
|
3407
3306
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3408
3307
|
|
|
3409
3308
|
#### Property prime
|
|
@@ -3413,7 +3312,6 @@ The prime number utilised in the reduction context, typically an instance of Mer
|
|
|
3413
3312
|
```ts
|
|
3414
3313
|
prime: Mersenne | null
|
|
3415
3314
|
```
|
|
3416
|
-
|
|
3417
3315
|
See also: [Mersenne](./primitives.md#class-mersenne)
|
|
3418
3316
|
|
|
3419
3317
|
#### Method add
|
|
@@ -3423,7 +3321,6 @@ Performs the addition operation on two BigNumbers in the reduction context.
|
|
|
3423
3321
|
```ts
|
|
3424
3322
|
add(a: BigNumber, b: BigNumber): BigNumber
|
|
3425
3323
|
```
|
|
3426
|
-
|
|
3427
3324
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3428
3325
|
|
|
3429
3326
|
Returns
|
|
@@ -3432,10 +3329,10 @@ Returns the result of 'a + b' in the reduction context.
|
|
|
3432
3329
|
|
|
3433
3330
|
Argument Details
|
|
3434
3331
|
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3332
|
+
+ **a**
|
|
3333
|
+
+ First BigNumber to add.
|
|
3334
|
+
+ **b**
|
|
3335
|
+
+ Second BigNumber to add.
|
|
3439
3336
|
|
|
3440
3337
|
Example
|
|
3441
3338
|
|
|
@@ -3451,7 +3348,6 @@ Converts a BigNumber from reduction context to its regular form.
|
|
|
3451
3348
|
```ts
|
|
3452
3349
|
convertFrom(num: BigNumber): BigNumber
|
|
3453
3350
|
```
|
|
3454
|
-
|
|
3455
3351
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3456
3352
|
|
|
3457
3353
|
Returns
|
|
@@ -3460,8 +3356,8 @@ Returns the converted BigNumber in its regular form.
|
|
|
3460
3356
|
|
|
3461
3357
|
Argument Details
|
|
3462
3358
|
|
|
3463
|
-
|
|
3464
|
-
|
|
3359
|
+
+ **num**
|
|
3360
|
+
+ The BigNumber to convert from the reduction context.
|
|
3465
3361
|
|
|
3466
3362
|
Example
|
|
3467
3363
|
|
|
@@ -3478,7 +3374,6 @@ Converts a BigNumber to its equivalent in the reduction context.
|
|
|
3478
3374
|
```ts
|
|
3479
3375
|
convertTo(num: BigNumber): BigNumber
|
|
3480
3376
|
```
|
|
3481
|
-
|
|
3482
3377
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3483
3378
|
|
|
3484
3379
|
Returns
|
|
@@ -3487,8 +3382,8 @@ Returns the converted BigNumber compatible with the reduction context.
|
|
|
3487
3382
|
|
|
3488
3383
|
Argument Details
|
|
3489
3384
|
|
|
3490
|
-
|
|
3491
|
-
|
|
3385
|
+
+ **num**
|
|
3386
|
+
+ The BigNumber to convert to the reduction context.
|
|
3492
3387
|
|
|
3493
3388
|
Example
|
|
3494
3389
|
|
|
@@ -3505,7 +3400,6 @@ in order to avoid creating a new BigNumber, it modifies the first one with the r
|
|
|
3505
3400
|
```ts
|
|
3506
3401
|
iadd(a: BigNumber, b: BigNumber): BigNumber
|
|
3507
3402
|
```
|
|
3508
|
-
|
|
3509
3403
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3510
3404
|
|
|
3511
3405
|
Returns
|
|
@@ -3514,10 +3408,10 @@ Returns the modified 'a' after addition with 'b' in the reduction context.
|
|
|
3514
3408
|
|
|
3515
3409
|
Argument Details
|
|
3516
3410
|
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3411
|
+
+ **a**
|
|
3412
|
+
+ First BigNumber to add.
|
|
3413
|
+
+ **b**
|
|
3414
|
+
+ Second BigNumber to add.
|
|
3521
3415
|
|
|
3522
3416
|
Example
|
|
3523
3417
|
|
|
@@ -3534,7 +3428,6 @@ Performs an in-place reduction of the given BigNumber by the modulus of the redu
|
|
|
3534
3428
|
```ts
|
|
3535
3429
|
imod(a: BigNumber): BigNumber
|
|
3536
3430
|
```
|
|
3537
|
-
|
|
3538
3431
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3539
3432
|
|
|
3540
3433
|
Returns
|
|
@@ -3543,8 +3436,8 @@ Returns the reduced result.
|
|
|
3543
3436
|
|
|
3544
3437
|
Argument Details
|
|
3545
3438
|
|
|
3546
|
-
|
|
3547
|
-
|
|
3439
|
+
+ **a**
|
|
3440
|
+
+ BigNumber to be reduced.
|
|
3548
3441
|
|
|
3549
3442
|
Example
|
|
3550
3443
|
|
|
@@ -3561,7 +3454,6 @@ modifying the first BigNumber with the result.
|
|
|
3561
3454
|
```ts
|
|
3562
3455
|
imul(a: BigNumber, b: BigNumber): BigNumber
|
|
3563
3456
|
```
|
|
3564
|
-
|
|
3565
3457
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3566
3458
|
|
|
3567
3459
|
Returns
|
|
@@ -3570,10 +3462,10 @@ Returns the modified 'a' after multiplication with 'b' in the reduction context.
|
|
|
3570
3462
|
|
|
3571
3463
|
Argument Details
|
|
3572
3464
|
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3465
|
+
+ **a**
|
|
3466
|
+
+ First BigNumber to multiply.
|
|
3467
|
+
+ **b**
|
|
3468
|
+
+ Second BigNumber to multiply.
|
|
3577
3469
|
|
|
3578
3470
|
Example
|
|
3579
3471
|
|
|
@@ -3590,7 +3482,6 @@ Calculates the multiplicative inverse of a BigNumber in the reduction context.
|
|
|
3590
3482
|
```ts
|
|
3591
3483
|
invm(a: BigNumber): BigNumber
|
|
3592
3484
|
```
|
|
3593
|
-
|
|
3594
3485
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3595
3486
|
|
|
3596
3487
|
Returns
|
|
@@ -3599,8 +3490,8 @@ Returns the multiplicative inverse of 'a' in the reduction context.
|
|
|
3599
3490
|
|
|
3600
3491
|
Argument Details
|
|
3601
3492
|
|
|
3602
|
-
|
|
3603
|
-
|
|
3493
|
+
+ **a**
|
|
3494
|
+
+ The BigNumber to find the multiplicative inverse of.
|
|
3604
3495
|
|
|
3605
3496
|
Example
|
|
3606
3497
|
|
|
@@ -3617,7 +3508,6 @@ modifying the original BigNumber with the result.
|
|
|
3617
3508
|
```ts
|
|
3618
3509
|
isqr(a: BigNumber): BigNumber
|
|
3619
3510
|
```
|
|
3620
|
-
|
|
3621
3511
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3622
3512
|
|
|
3623
3513
|
Returns
|
|
@@ -3626,8 +3516,8 @@ Returns the squared 'a' in the reduction context.
|
|
|
3626
3516
|
|
|
3627
3517
|
Argument Details
|
|
3628
3518
|
|
|
3629
|
-
|
|
3630
|
-
|
|
3519
|
+
+ **a**
|
|
3520
|
+
+ BigNumber to be squared.
|
|
3631
3521
|
|
|
3632
3522
|
Example
|
|
3633
3523
|
|
|
@@ -3645,7 +3535,6 @@ it modifies the first BigNumber with the result.
|
|
|
3645
3535
|
```ts
|
|
3646
3536
|
isub(a: BigNumber, b: BigNumber): BigNumber
|
|
3647
3537
|
```
|
|
3648
|
-
|
|
3649
3538
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3650
3539
|
|
|
3651
3540
|
Returns
|
|
@@ -3654,10 +3543,10 @@ Returns the modified 'a' after subtraction of 'b' in the reduction context.
|
|
|
3654
3543
|
|
|
3655
3544
|
Argument Details
|
|
3656
3545
|
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3546
|
+
+ **a**
|
|
3547
|
+
+ BigNumber to be subtracted from.
|
|
3548
|
+
+ **b**
|
|
3549
|
+
+ BigNumber to subtract.
|
|
3661
3550
|
|
|
3662
3551
|
Example
|
|
3663
3552
|
|
|
@@ -3674,7 +3563,6 @@ Multiplies two BigNumbers in the reduction context.
|
|
|
3674
3563
|
```ts
|
|
3675
3564
|
mul(a: BigNumber, b: BigNumber): BigNumber
|
|
3676
3565
|
```
|
|
3677
|
-
|
|
3678
3566
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3679
3567
|
|
|
3680
3568
|
Returns
|
|
@@ -3683,10 +3571,10 @@ Returns the result of 'a * b' in the reduction context.
|
|
|
3683
3571
|
|
|
3684
3572
|
Argument Details
|
|
3685
3573
|
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3574
|
+
+ **a**
|
|
3575
|
+
+ First BigNumber to multiply.
|
|
3576
|
+
+ **b**
|
|
3577
|
+
+ Second BigNumber to multiply.
|
|
3690
3578
|
|
|
3691
3579
|
Example
|
|
3692
3580
|
|
|
@@ -3702,7 +3590,6 @@ Negates a BigNumber in the context of the modulus.
|
|
|
3702
3590
|
```ts
|
|
3703
3591
|
neg(a: BigNumber): BigNumber
|
|
3704
3592
|
```
|
|
3705
|
-
|
|
3706
3593
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3707
3594
|
|
|
3708
3595
|
Returns
|
|
@@ -3711,8 +3598,8 @@ Returns the negation of 'a' in the reduction context.
|
|
|
3711
3598
|
|
|
3712
3599
|
Argument Details
|
|
3713
3600
|
|
|
3714
|
-
|
|
3715
|
-
|
|
3601
|
+
+ **a**
|
|
3602
|
+
+ BigNumber to negate.
|
|
3716
3603
|
|
|
3717
3604
|
Example
|
|
3718
3605
|
|
|
@@ -3728,7 +3615,6 @@ Raises a BigNumber to a power in the reduction context.
|
|
|
3728
3615
|
```ts
|
|
3729
3616
|
pow(a: BigNumber, num: BigNumber): BigNumber
|
|
3730
3617
|
```
|
|
3731
|
-
|
|
3732
3618
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3733
3619
|
|
|
3734
3620
|
Returns
|
|
@@ -3737,10 +3623,10 @@ Returns the result of 'a' raised to the power of 'num' in the reduction context.
|
|
|
3737
3623
|
|
|
3738
3624
|
Argument Details
|
|
3739
3625
|
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3626
|
+
+ **a**
|
|
3627
|
+
+ The BigNumber to be raised to a power.
|
|
3628
|
+
+ **num**
|
|
3629
|
+
+ The power to raise the BigNumber to.
|
|
3744
3630
|
|
|
3745
3631
|
Example
|
|
3746
3632
|
|
|
@@ -3756,7 +3642,6 @@ Performs bitwise shift left operation on a BigNumber in the reduction context.
|
|
|
3756
3642
|
```ts
|
|
3757
3643
|
shl(a: BigNumber, num: number): BigNumber
|
|
3758
3644
|
```
|
|
3759
|
-
|
|
3760
3645
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3761
3646
|
|
|
3762
3647
|
Returns
|
|
@@ -3765,10 +3650,10 @@ Returns the result of shifting 'a' left by 'num' positions in the reduction cont
|
|
|
3765
3650
|
|
|
3766
3651
|
Argument Details
|
|
3767
3652
|
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3653
|
+
+ **a**
|
|
3654
|
+
+ BigNumber to perform shift on.
|
|
3655
|
+
+ **num**
|
|
3656
|
+
+ The number of positions to shift.
|
|
3772
3657
|
|
|
3773
3658
|
Example
|
|
3774
3659
|
|
|
@@ -3784,7 +3669,6 @@ Calculates the square of a BigNumber in the reduction context.
|
|
|
3784
3669
|
```ts
|
|
3785
3670
|
sqr(a: BigNumber): BigNumber
|
|
3786
3671
|
```
|
|
3787
|
-
|
|
3788
3672
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3789
3673
|
|
|
3790
3674
|
Returns
|
|
@@ -3793,8 +3677,8 @@ Returns the result of 'a^2' in the reduction context.
|
|
|
3793
3677
|
|
|
3794
3678
|
Argument Details
|
|
3795
3679
|
|
|
3796
|
-
|
|
3797
|
-
|
|
3680
|
+
+ **a**
|
|
3681
|
+
+ BigNumber to be squared.
|
|
3798
3682
|
|
|
3799
3683
|
Example
|
|
3800
3684
|
|
|
@@ -3810,7 +3694,6 @@ Calculates the square root of a BigNumber in the reduction context.
|
|
|
3810
3694
|
```ts
|
|
3811
3695
|
sqrt(a: BigNumber): BigNumber
|
|
3812
3696
|
```
|
|
3813
|
-
|
|
3814
3697
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3815
3698
|
|
|
3816
3699
|
Returns
|
|
@@ -3819,8 +3702,8 @@ Returns the square root of 'a' in the reduction context.
|
|
|
3819
3702
|
|
|
3820
3703
|
Argument Details
|
|
3821
3704
|
|
|
3822
|
-
|
|
3823
|
-
|
|
3705
|
+
+ **a**
|
|
3706
|
+
+ The BigNumber to calculate the square root of.
|
|
3824
3707
|
|
|
3825
3708
|
Example
|
|
3826
3709
|
|
|
@@ -3836,7 +3719,6 @@ Subtracts one BigNumber from another BigNumber in the reduction context.
|
|
|
3836
3719
|
```ts
|
|
3837
3720
|
sub(a: BigNumber, b: BigNumber): BigNumber
|
|
3838
3721
|
```
|
|
3839
|
-
|
|
3840
3722
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3841
3723
|
|
|
3842
3724
|
Returns
|
|
@@ -3845,10 +3727,10 @@ Returns the result of 'a - b' in the reduction context.
|
|
|
3845
3727
|
|
|
3846
3728
|
Argument Details
|
|
3847
3729
|
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3730
|
+
+ **a**
|
|
3731
|
+
+ BigNumber to be subtracted from.
|
|
3732
|
+
+ **b**
|
|
3733
|
+
+ BigNumber to subtract.
|
|
3852
3734
|
|
|
3853
3735
|
Example
|
|
3854
3736
|
|
|
@@ -3865,13 +3747,12 @@ conditions are not met.
|
|
|
3865
3747
|
```ts
|
|
3866
3748
|
verify1(a: BigNumber): void
|
|
3867
3749
|
```
|
|
3868
|
-
|
|
3869
3750
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3870
3751
|
|
|
3871
3752
|
Argument Details
|
|
3872
3753
|
|
|
3873
|
-
|
|
3874
|
-
|
|
3754
|
+
+ **a**
|
|
3755
|
+
+ The BigNumber to be verified.
|
|
3875
3756
|
|
|
3876
3757
|
Example
|
|
3877
3758
|
|
|
@@ -3890,15 +3771,14 @@ conditions are not met.
|
|
|
3890
3771
|
```ts
|
|
3891
3772
|
verify2(a: BigNumber, b: BigNumber): void
|
|
3892
3773
|
```
|
|
3893
|
-
|
|
3894
3774
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
3895
3775
|
|
|
3896
3776
|
Argument Details
|
|
3897
3777
|
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3778
|
+
+ **a**
|
|
3779
|
+
+ The first BigNumber to be verified.
|
|
3780
|
+
+ **b**
|
|
3781
|
+
+ The second BigNumber to be verified.
|
|
3902
3782
|
|
|
3903
3783
|
Example
|
|
3904
3784
|
|
|
@@ -3911,7 +3791,6 @@ this.verify2(new BigNumber(10).toRed(this), new BigNumber(20)); //throws an Erro
|
|
|
3911
3791
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3912
3792
|
|
|
3913
3793
|
---
|
|
3914
|
-
|
|
3915
3794
|
### Class: SHA1
|
|
3916
3795
|
|
|
3917
3796
|
An implementation of SHA1 cryptographic hash function. Extends the BaseHash class.
|
|
@@ -3964,7 +3843,6 @@ k: number[]
|
|
|
3964
3843
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3965
3844
|
|
|
3966
3845
|
---
|
|
3967
|
-
|
|
3968
3846
|
### Class: SHA1HMAC
|
|
3969
3847
|
|
|
3970
3848
|
```ts
|
|
@@ -3984,7 +3862,6 @@ See also: [SHA1](./primitives.md#class-sha1)
|
|
|
3984
3862
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3985
3863
|
|
|
3986
3864
|
---
|
|
3987
|
-
|
|
3988
3865
|
### Class: SHA256
|
|
3989
3866
|
|
|
3990
3867
|
An implementation of SHA256 cryptographic hash function. Extends the BaseHash class.
|
|
@@ -4037,7 +3914,6 @@ k: number[]
|
|
|
4037
3914
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4038
3915
|
|
|
4039
3916
|
---
|
|
4040
|
-
|
|
4041
3917
|
### Class: SHA256HMAC
|
|
4042
3918
|
|
|
4043
3919
|
The `SHA256HMAC` class is used to create Hash-based Message Authentication Code (HMAC) using the SHA-256 cryptographic hash function.
|
|
@@ -4075,8 +3951,8 @@ constructor(key: number[] | string)
|
|
|
4075
3951
|
|
|
4076
3952
|
Argument Details
|
|
4077
3953
|
|
|
4078
|
-
|
|
4079
|
-
|
|
3954
|
+
+ **key**
|
|
3955
|
+
+ The key to use to create the HMAC. Can be a number array or a string in hexadecimal format.
|
|
4080
3956
|
|
|
4081
3957
|
Example
|
|
4082
3958
|
|
|
@@ -4099,7 +3975,6 @@ Represents the inner hash of SHA-256.
|
|
|
4099
3975
|
```ts
|
|
4100
3976
|
inner: SHA256
|
|
4101
3977
|
```
|
|
4102
|
-
|
|
4103
3978
|
See also: [SHA256](./primitives.md#class-sha256)
|
|
4104
3979
|
|
|
4105
3980
|
#### Property outSize
|
|
@@ -4117,7 +3992,6 @@ Represents the outer hash of SHA-256.
|
|
|
4117
3992
|
```ts
|
|
4118
3993
|
outer: SHA256
|
|
4119
3994
|
```
|
|
4120
|
-
|
|
4121
3995
|
See also: [SHA256](./primitives.md#class-sha256)
|
|
4122
3996
|
|
|
4123
3997
|
#### Method digest
|
|
@@ -4163,7 +4037,6 @@ Updates the `SHA256HMAC` object with part of the message to be hashed.
|
|
|
4163
4037
|
```ts
|
|
4164
4038
|
update(msg: number[] | string, enc?: "hex"): SHA256HMAC
|
|
4165
4039
|
```
|
|
4166
|
-
|
|
4167
4040
|
See also: [SHA256HMAC](./primitives.md#class-sha256hmac)
|
|
4168
4041
|
|
|
4169
4042
|
Returns
|
|
@@ -4172,10 +4045,10 @@ Returns the instance of `SHA256HMAC` for chaining calls.
|
|
|
4172
4045
|
|
|
4173
4046
|
Argument Details
|
|
4174
4047
|
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4048
|
+
+ **msg**
|
|
4049
|
+
+ Part of the message to hash. Can be a number array or a string.
|
|
4050
|
+
+ **enc**
|
|
4051
|
+
+ If 'hex', then the input is encoded as hexadecimal. If undefined or not 'hex', then no encoding is performed.
|
|
4179
4052
|
|
|
4180
4053
|
Example
|
|
4181
4054
|
|
|
@@ -4186,7 +4059,6 @@ myHMAC.update('deadbeef', 'hex');
|
|
|
4186
4059
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4187
4060
|
|
|
4188
4061
|
---
|
|
4189
|
-
|
|
4190
4062
|
### Class: SHA512
|
|
4191
4063
|
|
|
4192
4064
|
An implementation of SHA512 cryptographic hash function. Extends the BaseHash class.
|
|
@@ -4240,7 +4112,6 @@ k: number[]
|
|
|
4240
4112
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4241
4113
|
|
|
4242
4114
|
---
|
|
4243
|
-
|
|
4244
4115
|
### Class: SHA512HMAC
|
|
4245
4116
|
|
|
4246
4117
|
The `SHA512HMAC` class is used to create Hash-based Message Authentication Code (HMAC) using the SHA-512 cryptographic hash function.
|
|
@@ -4278,8 +4149,8 @@ constructor(key: number[] | string)
|
|
|
4278
4149
|
|
|
4279
4150
|
Argument Details
|
|
4280
4151
|
|
|
4281
|
-
|
|
4282
|
-
|
|
4152
|
+
+ **key**
|
|
4153
|
+
+ The key to use to create the HMAC. Can be a number array or a string in hexadecimal format.
|
|
4283
4154
|
|
|
4284
4155
|
Example
|
|
4285
4156
|
|
|
@@ -4302,7 +4173,6 @@ Represents the inner hash of SHA-512.
|
|
|
4302
4173
|
```ts
|
|
4303
4174
|
inner: SHA512
|
|
4304
4175
|
```
|
|
4305
|
-
|
|
4306
4176
|
See also: [SHA512](./primitives.md#class-sha512)
|
|
4307
4177
|
|
|
4308
4178
|
#### Property outSize
|
|
@@ -4320,7 +4190,6 @@ Represents the outer hash of SHA-512.
|
|
|
4320
4190
|
```ts
|
|
4321
4191
|
outer: SHA512
|
|
4322
4192
|
```
|
|
4323
|
-
|
|
4324
4193
|
See also: [SHA512](./primitives.md#class-sha512)
|
|
4325
4194
|
|
|
4326
4195
|
#### Method digest
|
|
@@ -4366,7 +4235,6 @@ Updates the `SHA512HMAC` object with part of the message to be hashed.
|
|
|
4366
4235
|
```ts
|
|
4367
4236
|
update(msg: number[] | string, enc?: "hex" | "utf8"): SHA512HMAC
|
|
4368
4237
|
```
|
|
4369
|
-
|
|
4370
4238
|
See also: [SHA512HMAC](./primitives.md#class-sha512hmac)
|
|
4371
4239
|
|
|
4372
4240
|
Returns
|
|
@@ -4375,10 +4243,10 @@ Returns the instance of `SHA512HMAC` for chaining calls.
|
|
|
4375
4243
|
|
|
4376
4244
|
Argument Details
|
|
4377
4245
|
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4246
|
+
+ **msg**
|
|
4247
|
+
+ Part of the message to hash. Can be a number array or a string.
|
|
4248
|
+
+ **enc**
|
|
4249
|
+
+ If 'hex', then the input is encoded as hexadecimal. If undefined or not 'hex', then no encoding is performed.
|
|
4382
4250
|
|
|
4383
4251
|
Example
|
|
4384
4252
|
|
|
@@ -4389,7 +4257,6 @@ myHMAC.update('deadbeef', 'hex');
|
|
|
4389
4257
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4390
4258
|
|
|
4391
4259
|
---
|
|
4392
|
-
|
|
4393
4260
|
### Class: Schnorr
|
|
4394
4261
|
|
|
4395
4262
|
Class representing the Schnorr Zero-Knowledge Proof (ZKP) protocol.
|
|
@@ -4399,7 +4266,6 @@ Specifically, it allows one party to prove to another that they know the private
|
|
|
4399
4266
|
and have correctly computed a shared secret, without disclosing the private key itself.
|
|
4400
4267
|
|
|
4401
4268
|
The protocol involves two main methods:
|
|
4402
|
-
|
|
4403
4269
|
- `generateProof`: Generates a proof linking a public key `A` and a shared secret `S`, proving knowledge of the corresponding private key `a`.
|
|
4404
4270
|
- `verifyProof`: Verifies the provided proof, ensuring its validity without revealing any secret information.
|
|
4405
4271
|
|
|
@@ -4422,7 +4288,6 @@ const proof = schnorr.generateProof(a, A, B, S);
|
|
|
4422
4288
|
const isValid = schnorr.verifyProof(A.point, B.point, S.point, proof);
|
|
4423
4289
|
console.log(`Proof is valid: ${isValid}`);
|
|
4424
4290
|
```
|
|
4425
|
-
|
|
4426
4291
|
```ts
|
|
4427
4292
|
export default class Schnorr {
|
|
4428
4293
|
constructor()
|
|
@@ -4452,7 +4317,6 @@ generateProof(aArg: PrivateKey, AArg: PublicKey, BArg: PublicKey, S: Point): {
|
|
|
4452
4317
|
z: BigNumber;
|
|
4453
4318
|
}
|
|
4454
4319
|
```
|
|
4455
|
-
|
|
4456
4320
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point), [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
4457
4321
|
|
|
4458
4322
|
Returns
|
|
@@ -4461,14 +4325,14 @@ Proof (R, S', z)
|
|
|
4461
4325
|
|
|
4462
4326
|
Argument Details
|
|
4463
4327
|
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4328
|
+
+ **a**
|
|
4329
|
+
+ Private key corresponding to public key A
|
|
4330
|
+
+ **A**
|
|
4331
|
+
+ Public key
|
|
4332
|
+
+ **B**
|
|
4333
|
+
+ Other party's public key
|
|
4334
|
+
+ **S**
|
|
4335
|
+
+ Shared secret
|
|
4472
4336
|
|
|
4473
4337
|
#### Method verifyProof
|
|
4474
4338
|
|
|
@@ -4481,7 +4345,6 @@ verifyProof(A: Point, B: Point, S: Point, proof: {
|
|
|
4481
4345
|
z: BigNumber;
|
|
4482
4346
|
}): boolean
|
|
4483
4347
|
```
|
|
4484
|
-
|
|
4485
4348
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
4486
4349
|
|
|
4487
4350
|
Returns
|
|
@@ -4490,19 +4353,18 @@ True if the proof is valid, false otherwise
|
|
|
4490
4353
|
|
|
4491
4354
|
Argument Details
|
|
4492
4355
|
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4356
|
+
+ **A**
|
|
4357
|
+
+ Public key
|
|
4358
|
+
+ **B**
|
|
4359
|
+
+ Other party's public key
|
|
4360
|
+
+ **S**
|
|
4361
|
+
+ Shared secret
|
|
4362
|
+
+ **proof**
|
|
4363
|
+
+ Proof (R, S', z)
|
|
4501
4364
|
|
|
4502
4365
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4503
4366
|
|
|
4504
4367
|
---
|
|
4505
|
-
|
|
4506
4368
|
### Class: Signature
|
|
4507
4369
|
|
|
4508
4370
|
Represents a digital signature.
|
|
@@ -4537,15 +4399,14 @@ Creates an instance of the Signature class.
|
|
|
4537
4399
|
```ts
|
|
4538
4400
|
constructor(r: BigNumber, s: BigNumber)
|
|
4539
4401
|
```
|
|
4540
|
-
|
|
4541
4402
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
4542
4403
|
|
|
4543
4404
|
Argument Details
|
|
4544
4405
|
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4406
|
+
+ **r**
|
|
4407
|
+
+ The R component of the signature.
|
|
4408
|
+
+ **s**
|
|
4409
|
+
+ The S component of the signature.
|
|
4549
4410
|
|
|
4550
4411
|
Example
|
|
4551
4412
|
|
|
@@ -4565,7 +4426,6 @@ The recovery factor is a number between 0 and 3.
|
|
|
4565
4426
|
```ts
|
|
4566
4427
|
CalculateRecoveryFactor(pubkey: PublicKey, msgHash: BigNumber): number
|
|
4567
4428
|
```
|
|
4568
|
-
|
|
4569
4429
|
See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey)
|
|
4570
4430
|
|
|
4571
4431
|
Returns
|
|
@@ -4575,8 +4435,8 @@ the recovery factor: number
|
|
|
4575
4435
|
|
|
4576
4436
|
Argument Details
|
|
4577
4437
|
|
|
4578
|
-
|
|
4579
|
-
|
|
4438
|
+
+ **msgHash**
|
|
4439
|
+
+ The message hash.
|
|
4580
4440
|
|
|
4581
4441
|
Example
|
|
4582
4442
|
|
|
@@ -4594,7 +4454,6 @@ The recovery factor is a number between 0 and 3.
|
|
|
4594
4454
|
```ts
|
|
4595
4455
|
RecoverPublicKey(recovery: number, e: BigNumber): PublicKey
|
|
4596
4456
|
```
|
|
4597
|
-
|
|
4598
4457
|
See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey)
|
|
4599
4458
|
|
|
4600
4459
|
Returns
|
|
@@ -4603,10 +4462,10 @@ The public key associated with the signature.
|
|
|
4603
4462
|
|
|
4604
4463
|
Argument Details
|
|
4605
4464
|
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4465
|
+
+ **recovery**
|
|
4466
|
+
+ The recovery factor.
|
|
4467
|
+
+ **e**
|
|
4468
|
+
+ The message hash.
|
|
4610
4469
|
|
|
4611
4470
|
Example
|
|
4612
4471
|
|
|
@@ -4627,7 +4486,6 @@ We could support recovery functions in future if there's demand.
|
|
|
4627
4486
|
```ts
|
|
4628
4487
|
static fromCompact(data: number[] | string, enc?: "hex" | "base64"): Signature
|
|
4629
4488
|
```
|
|
4630
|
-
|
|
4631
4489
|
See also: [Signature](./primitives.md#class-signature)
|
|
4632
4490
|
|
|
4633
4491
|
Returns
|
|
@@ -4636,10 +4494,10 @@ The decoded data in the form of Signature instance.
|
|
|
4636
4494
|
|
|
4637
4495
|
Argument Details
|
|
4638
4496
|
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4497
|
+
+ **data**
|
|
4498
|
+
+ The sequence to decode from Compact encoding.
|
|
4499
|
+
+ **enc**
|
|
4500
|
+
+ The encoding of the data string.
|
|
4643
4501
|
|
|
4644
4502
|
Example
|
|
4645
4503
|
|
|
@@ -4656,7 +4514,6 @@ If a string is provided, it is assumed to represent a hexadecimal sequence.
|
|
|
4656
4514
|
```ts
|
|
4657
4515
|
static fromDER(data: number[] | string, enc?: "hex" | "base64"): Signature
|
|
4658
4516
|
```
|
|
4659
|
-
|
|
4660
4517
|
See also: [Signature](./primitives.md#class-signature)
|
|
4661
4518
|
|
|
4662
4519
|
Returns
|
|
@@ -4665,10 +4522,10 @@ The decoded data in the form of Signature instance.
|
|
|
4665
4522
|
|
|
4666
4523
|
Argument Details
|
|
4667
4524
|
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4525
|
+
+ **data**
|
|
4526
|
+
+ The sequence to decode from DER encoding.
|
|
4527
|
+
+ **enc**
|
|
4528
|
+
+ The encoding of the data string.
|
|
4672
4529
|
|
|
4673
4530
|
Example
|
|
4674
4531
|
|
|
@@ -4694,8 +4551,8 @@ The current instance in DER encoding.
|
|
|
4694
4551
|
|
|
4695
4552
|
Argument Details
|
|
4696
4553
|
|
|
4697
|
-
|
|
4698
|
-
|
|
4554
|
+
+ **enc**
|
|
4555
|
+
+ The encoding to use for the output.
|
|
4699
4556
|
|
|
4700
4557
|
Example
|
|
4701
4558
|
|
|
@@ -4721,8 +4578,8 @@ The current instance in DER encoding.
|
|
|
4721
4578
|
|
|
4722
4579
|
Argument Details
|
|
4723
4580
|
|
|
4724
|
-
|
|
4725
|
-
|
|
4581
|
+
+ **enc**
|
|
4582
|
+
+ The encoding to use for the output.
|
|
4726
4583
|
|
|
4727
4584
|
Example
|
|
4728
4585
|
|
|
@@ -4751,8 +4608,8 @@ The current instance in DER encoding.
|
|
|
4751
4608
|
|
|
4752
4609
|
Argument Details
|
|
4753
4610
|
|
|
4754
|
-
|
|
4755
|
-
|
|
4611
|
+
+ **enc**
|
|
4612
|
+
+ The encoding to use for the output.
|
|
4756
4613
|
|
|
4757
4614
|
Example
|
|
4758
4615
|
|
|
@@ -4770,7 +4627,6 @@ If the data or key do not match the signature, the function returns false.
|
|
|
4770
4627
|
```ts
|
|
4771
4628
|
verify(msg: number[] | string, key: PublicKey, enc?: "hex"): boolean
|
|
4772
4629
|
```
|
|
4773
|
-
|
|
4774
4630
|
See also: [PublicKey](./primitives.md#class-publickey)
|
|
4775
4631
|
|
|
4776
4632
|
Returns
|
|
@@ -4779,12 +4635,12 @@ A boolean representing whether the signature is valid.
|
|
|
4779
4635
|
|
|
4780
4636
|
Argument Details
|
|
4781
4637
|
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4638
|
+
+ **msg**
|
|
4639
|
+
+ The message to verify.
|
|
4640
|
+
+ **key**
|
|
4641
|
+
+ The public key used to sign the original message.
|
|
4642
|
+
+ **enc**
|
|
4643
|
+
+ The encoding of the msg string.
|
|
4788
4644
|
|
|
4789
4645
|
Example
|
|
4790
4646
|
|
|
@@ -4797,7 +4653,6 @@ const isVerified = signature.verify(msg, publicKey);
|
|
|
4797
4653
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4798
4654
|
|
|
4799
4655
|
---
|
|
4800
|
-
|
|
4801
4656
|
### Class: SymmetricKey
|
|
4802
4657
|
|
|
4803
4658
|
`SymmetricKey` is a class that extends the `BigNumber` class and implements symmetric encryption and decryption methods.
|
|
@@ -4830,10 +4685,10 @@ Returns the decrypted message as a string or an array of numbers, depending on `
|
|
|
4830
4685
|
|
|
4831
4686
|
Argument Details
|
|
4832
4687
|
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4688
|
+
+ **msg**
|
|
4689
|
+
+ The encrypted message to be decrypted. It can be a string or an array of numbers.
|
|
4690
|
+
+ **enc**
|
|
4691
|
+
+ optional. The encoding of the message (if no encoding is provided, uses utf8 for strings, unless specified as hex).
|
|
4837
4692
|
|
|
4838
4693
|
Throws
|
|
4839
4694
|
|
|
@@ -4862,10 +4717,10 @@ Returns the encrypted message as a string or an array of numbers, depending on `
|
|
|
4862
4717
|
|
|
4863
4718
|
Argument Details
|
|
4864
4719
|
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4720
|
+
+ **msg**
|
|
4721
|
+
+ The message to be encrypted. It can be a string or an array of numbers.
|
|
4722
|
+
+ **enc**
|
|
4723
|
+
+ optional. The encoding of the message. If hex, the string is assumed to be hex, UTF-8 otherwise.
|
|
4869
4724
|
|
|
4870
4725
|
Example
|
|
4871
4726
|
|
|
@@ -4881,7 +4736,6 @@ Generates a symmetric key randomly.
|
|
|
4881
4736
|
```ts
|
|
4882
4737
|
static fromRandom(): SymmetricKey
|
|
4883
4738
|
```
|
|
4884
|
-
|
|
4885
4739
|
See also: [SymmetricKey](./primitives.md#class-symmetrickey)
|
|
4886
4740
|
|
|
4887
4741
|
Returns
|
|
@@ -4897,7 +4751,6 @@ const symmetricKey = SymmetricKey.fromRandom();
|
|
|
4897
4751
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4898
4752
|
|
|
4899
4753
|
---
|
|
4900
|
-
|
|
4901
4754
|
### Class: TransactionSignature
|
|
4902
4755
|
|
|
4903
4756
|
```ts
|
|
@@ -4943,7 +4796,6 @@ public hasLowS(): boolean
|
|
|
4943
4796
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4944
4797
|
|
|
4945
4798
|
---
|
|
4946
|
-
|
|
4947
4799
|
### Class: Writer
|
|
4948
4800
|
|
|
4949
4801
|
```ts
|
|
@@ -4979,7 +4831,6 @@ See also: [BigNumber](./primitives.md#class-bignumber), [toArray](./primitives.m
|
|
|
4979
4831
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4980
4832
|
|
|
4981
4833
|
---
|
|
4982
|
-
|
|
4983
4834
|
## Functions
|
|
4984
4835
|
|
|
4985
4836
|
| |
|
|
@@ -5005,7 +4856,6 @@ export function AES(input: number[], key: number[]): number[]
|
|
|
5005
4856
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5006
4857
|
|
|
5007
4858
|
---
|
|
5008
|
-
|
|
5009
4859
|
### Function: AESGCM
|
|
5010
4860
|
|
|
5011
4861
|
```ts
|
|
@@ -5018,7 +4868,6 @@ export function AESGCM(plainText: number[], additionalAuthenticatedData: number[
|
|
|
5018
4868
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5019
4869
|
|
|
5020
4870
|
---
|
|
5021
|
-
|
|
5022
4871
|
### Function: AESGCMDecrypt
|
|
5023
4872
|
|
|
5024
4873
|
```ts
|
|
@@ -5028,7 +4877,6 @@ export function AESGCMDecrypt(cipherText: number[], additionalAuthenticatedData:
|
|
|
5028
4877
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5029
4878
|
|
|
5030
4879
|
---
|
|
5031
|
-
|
|
5032
4880
|
### Function: ghash
|
|
5033
4881
|
|
|
5034
4882
|
```ts
|
|
@@ -5038,7 +4886,6 @@ export function ghash(input: number[], hashSubKey: number[]): number[]
|
|
|
5038
4886
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5039
4887
|
|
|
5040
4888
|
---
|
|
5041
|
-
|
|
5042
4889
|
### Function: pbkdf2
|
|
5043
4890
|
|
|
5044
4891
|
Limited SHA-512-only PBKDF2 function for use in deprecated BIP39 code.
|
|
@@ -5053,21 +4900,20 @@ The computed key
|
|
|
5053
4900
|
|
|
5054
4901
|
Argument Details
|
|
5055
4902
|
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
4903
|
+
+ **password**
|
|
4904
|
+
+ The PBKDF2 password
|
|
4905
|
+
+ **salt**
|
|
4906
|
+
+ The PBKDF2 salt
|
|
4907
|
+
+ **iterations**
|
|
4908
|
+
+ The number of of iterations to run
|
|
4909
|
+
+ **keylen**
|
|
4910
|
+
+ The length of the key
|
|
4911
|
+
+ **digest**
|
|
4912
|
+
+ The digest (must be sha512 for this implementation)
|
|
5066
4913
|
|
|
5067
4914
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5068
4915
|
|
|
5069
4916
|
---
|
|
5070
|
-
|
|
5071
4917
|
### Function: toArray
|
|
5072
4918
|
|
|
5073
4919
|
```ts
|
|
@@ -5080,13 +4926,12 @@ array of byte values from msg. If msg is an array, a copy is returned.
|
|
|
5080
4926
|
|
|
5081
4927
|
Argument Details
|
|
5082
4928
|
|
|
5083
|
-
|
|
5084
|
-
|
|
4929
|
+
+ **enc**
|
|
4930
|
+
+ Optional. Encoding to use if msg is string. Default is 'utf8'.
|
|
5085
4931
|
|
|
5086
4932
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5087
4933
|
|
|
5088
4934
|
---
|
|
5089
|
-
|
|
5090
4935
|
### Function: toBase64
|
|
5091
4936
|
|
|
5092
4937
|
Converts an array of bytes (each between 0 and 255) into a base64 encoded string.
|
|
@@ -5108,13 +4953,12 @@ The base64 encoded string.
|
|
|
5108
4953
|
|
|
5109
4954
|
Argument Details
|
|
5110
4955
|
|
|
5111
|
-
|
|
5112
|
-
|
|
4956
|
+
+ **byteArray**
|
|
4957
|
+
+ An array of numbers where each number is a byte (0-255).
|
|
5113
4958
|
|
|
5114
4959
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5115
4960
|
|
|
5116
4961
|
---
|
|
5117
|
-
|
|
5118
4962
|
## Types
|
|
5119
4963
|
|
|
5120
4964
|
## Enums
|
|
@@ -5148,7 +4992,6 @@ checkBit = function (byteArray: number[], byteIndex: number, bitIndex: number):
|
|
|
5148
4992
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5149
4993
|
|
|
5150
4994
|
---
|
|
5151
|
-
|
|
5152
4995
|
### Variable: encode
|
|
5153
4996
|
|
|
5154
4997
|
```ts
|
|
@@ -5169,7 +5012,6 @@ See also: [toHex](./primitives.md#variable-tohex), [toUTF8](./primitives.md#vari
|
|
|
5169
5012
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5170
5013
|
|
|
5171
5014
|
---
|
|
5172
|
-
|
|
5173
5015
|
### Variable: exclusiveOR
|
|
5174
5016
|
|
|
5175
5017
|
```ts
|
|
@@ -5186,7 +5028,6 @@ exclusiveOR = function (block0: number[], block1: number[]): number[] {
|
|
|
5186
5028
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5187
5029
|
|
|
5188
5030
|
---
|
|
5189
|
-
|
|
5190
5031
|
### Variable: fromBase58
|
|
5191
5032
|
|
|
5192
5033
|
```ts
|
|
@@ -5223,7 +5064,6 @@ fromBase58 = (str: string): number[] => {
|
|
|
5223
5064
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5224
5065
|
|
|
5225
5066
|
---
|
|
5226
|
-
|
|
5227
5067
|
### Variable: fromBase58Check
|
|
5228
5068
|
|
|
5229
5069
|
```ts
|
|
@@ -5254,7 +5094,6 @@ See also: [fromBase58](./primitives.md#variable-frombase58), [hash256](./primiti
|
|
|
5254
5094
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5255
5095
|
|
|
5256
5096
|
---
|
|
5257
|
-
|
|
5258
5097
|
### Variable: getBytes
|
|
5259
5098
|
|
|
5260
5099
|
```ts
|
|
@@ -5271,7 +5110,6 @@ getBytes = function (numericValue: number): number[] {
|
|
|
5271
5110
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5272
5111
|
|
|
5273
5112
|
---
|
|
5274
|
-
|
|
5275
5113
|
### Variable: hash160
|
|
5276
5114
|
|
|
5277
5115
|
```ts
|
|
@@ -5286,7 +5124,6 @@ See also: [RIPEMD160](./primitives.md#class-ripemd160), [SHA256](./primitives.md
|
|
|
5286
5124
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5287
5125
|
|
|
5288
5126
|
---
|
|
5289
|
-
|
|
5290
5127
|
### Variable: hash256
|
|
5291
5128
|
|
|
5292
5129
|
```ts
|
|
@@ -5301,7 +5138,6 @@ See also: [SHA256](./primitives.md#class-sha256)
|
|
|
5301
5138
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5302
5139
|
|
|
5303
5140
|
---
|
|
5304
|
-
|
|
5305
5141
|
### Variable: incrementLeastSignificantThirtyTwoBits
|
|
5306
5142
|
|
|
5307
5143
|
```ts
|
|
@@ -5324,7 +5160,6 @@ incrementLeastSignificantThirtyTwoBits = function (block: number[]): number[] {
|
|
|
5324
5160
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5325
5161
|
|
|
5326
5162
|
---
|
|
5327
|
-
|
|
5328
5163
|
### Variable: minimallyEncode
|
|
5329
5164
|
|
|
5330
5165
|
```ts
|
|
@@ -5361,7 +5196,6 @@ minimallyEncode = (buf: number[]): number[] => {
|
|
|
5361
5196
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5362
5197
|
|
|
5363
5198
|
---
|
|
5364
|
-
|
|
5365
5199
|
### Variable: multiply
|
|
5366
5200
|
|
|
5367
5201
|
```ts
|
|
@@ -5391,7 +5225,6 @@ See also: [rightShift](./primitives.md#variable-rightshift)
|
|
|
5391
5225
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5392
5226
|
|
|
5393
5227
|
---
|
|
5394
|
-
|
|
5395
5228
|
### Variable: rightShift
|
|
5396
5229
|
|
|
5397
5230
|
```ts
|
|
@@ -5414,7 +5247,6 @@ rightShift = function (block: number[]): number[] {
|
|
|
5414
5247
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5415
5248
|
|
|
5416
5249
|
---
|
|
5417
|
-
|
|
5418
5250
|
### Variable: ripemd160
|
|
5419
5251
|
|
|
5420
5252
|
```ts
|
|
@@ -5428,7 +5260,6 @@ See also: [RIPEMD160](./primitives.md#class-ripemd160)
|
|
|
5428
5260
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5429
5261
|
|
|
5430
5262
|
---
|
|
5431
|
-
|
|
5432
5263
|
### Variable: sha1
|
|
5433
5264
|
|
|
5434
5265
|
```ts
|
|
@@ -5442,7 +5273,6 @@ See also: [SHA1](./primitives.md#class-sha1)
|
|
|
5442
5273
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5443
5274
|
|
|
5444
5275
|
---
|
|
5445
|
-
|
|
5446
5276
|
### Variable: sha256
|
|
5447
5277
|
|
|
5448
5278
|
```ts
|
|
@@ -5456,7 +5286,6 @@ See also: [SHA256](./primitives.md#class-sha256)
|
|
|
5456
5286
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5457
5287
|
|
|
5458
5288
|
---
|
|
5459
|
-
|
|
5460
5289
|
### Variable: sha256hmac
|
|
5461
5290
|
|
|
5462
5291
|
```ts
|
|
@@ -5470,7 +5299,6 @@ See also: [SHA256HMAC](./primitives.md#class-sha256hmac)
|
|
|
5470
5299
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5471
5300
|
|
|
5472
5301
|
---
|
|
5473
|
-
|
|
5474
5302
|
### Variable: sha512
|
|
5475
5303
|
|
|
5476
5304
|
```ts
|
|
@@ -5484,7 +5312,6 @@ See also: [SHA512](./primitives.md#class-sha512)
|
|
|
5484
5312
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5485
5313
|
|
|
5486
5314
|
---
|
|
5487
|
-
|
|
5488
5315
|
### Variable: sha512hmac
|
|
5489
5316
|
|
|
5490
5317
|
```ts
|
|
@@ -5498,7 +5325,6 @@ See also: [SHA512HMAC](./primitives.md#class-sha512hmac)
|
|
|
5498
5325
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5499
5326
|
|
|
5500
5327
|
---
|
|
5501
|
-
|
|
5502
5328
|
### Variable: sign
|
|
5503
5329
|
|
|
5504
5330
|
```ts
|
|
@@ -5762,7 +5588,6 @@ See also: [BigNumber](./primitives.md#class-bignumber), [Curve](./primitives.md#
|
|
|
5762
5588
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5763
5589
|
|
|
5764
5590
|
---
|
|
5765
|
-
|
|
5766
5591
|
### Variable: toArray
|
|
5767
5592
|
|
|
5768
5593
|
```ts
|
|
@@ -5788,7 +5613,6 @@ toArray = (msg: any, enc?: "hex" | "utf8" | "base64"): any[] => {
|
|
|
5788
5613
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5789
5614
|
|
|
5790
5615
|
---
|
|
5791
|
-
|
|
5792
5616
|
### Variable: toBase58
|
|
5793
5617
|
|
|
5794
5618
|
```ts
|
|
@@ -5824,7 +5648,6 @@ toBase58 = (bin: number[]): string => {
|
|
|
5824
5648
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5825
5649
|
|
|
5826
5650
|
---
|
|
5827
|
-
|
|
5828
5651
|
### Variable: toBase58Check
|
|
5829
5652
|
|
|
5830
5653
|
```ts
|
|
@@ -5840,7 +5663,6 @@ See also: [hash256](./primitives.md#variable-hash256), [toBase58](./primitives.m
|
|
|
5840
5663
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5841
5664
|
|
|
5842
5665
|
---
|
|
5843
|
-
|
|
5844
5666
|
### Variable: toHex
|
|
5845
5667
|
|
|
5846
5668
|
```ts
|
|
@@ -5858,7 +5680,6 @@ See also: [zero2](./primitives.md#variable-zero2)
|
|
|
5858
5680
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5859
5681
|
|
|
5860
5682
|
---
|
|
5861
|
-
|
|
5862
5683
|
### Variable: toUTF8
|
|
5863
5684
|
|
|
5864
5685
|
```ts
|
|
@@ -5908,7 +5729,6 @@ toUTF8 = (arr: number[]): string => {
|
|
|
5908
5729
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5909
5730
|
|
|
5910
5731
|
---
|
|
5911
|
-
|
|
5912
5732
|
### Variable: verify
|
|
5913
5733
|
|
|
5914
5734
|
```ts
|
|
@@ -6078,7 +5898,6 @@ See also: [BigNumber](./primitives.md#class-bignumber), [Curve](./primitives.md#
|
|
|
6078
5898
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6079
5899
|
|
|
6080
5900
|
---
|
|
6081
|
-
|
|
6082
5901
|
### Variable: zero2
|
|
6083
5902
|
|
|
6084
5903
|
```ts
|