@openzeppelin/miden-multisig-client 0.12.6 → 0.12.8

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.
Files changed (89) hide show
  1. package/README.md +70 -75
  2. package/dist/account/builder.d.ts +0 -18
  3. package/dist/account/builder.d.ts.map +1 -1
  4. package/dist/account/builder.js +16 -24
  5. package/dist/account/builder.js.map +1 -1
  6. package/dist/account/masm.d.ts +2 -0
  7. package/dist/account/masm.d.ts.map +1 -1
  8. package/dist/account/masm.js +428 -1
  9. package/dist/account/masm.js.map +1 -1
  10. package/dist/account/storage.d.ts.map +1 -1
  11. package/dist/account/storage.js +5 -6
  12. package/dist/account/storage.js.map +1 -1
  13. package/dist/client.d.ts +5 -57
  14. package/dist/client.d.ts.map +1 -1
  15. package/dist/client.js +7 -53
  16. package/dist/client.js.map +1 -1
  17. package/dist/client.test.js +28 -0
  18. package/dist/client.test.js.map +1 -1
  19. package/dist/index.d.ts +3 -46
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +2 -45
  22. package/dist/index.js.map +1 -1
  23. package/dist/inspector.d.ts +4 -30
  24. package/dist/inspector.d.ts.map +1 -1
  25. package/dist/inspector.js +13 -43
  26. package/dist/inspector.js.map +1 -1
  27. package/dist/multisig/helpers.d.ts.map +1 -1
  28. package/dist/multisig/helpers.js.map +1 -1
  29. package/dist/multisig.d.ts +39 -161
  30. package/dist/multisig.d.ts.map +1 -1
  31. package/dist/multisig.js +190 -241
  32. package/dist/multisig.js.map +1 -1
  33. package/dist/multisig.test.js +41 -31
  34. package/dist/multisig.test.js.map +1 -1
  35. package/dist/procedures.d.ts +20 -47
  36. package/dist/procedures.d.ts.map +1 -1
  37. package/dist/procedures.js +17 -50
  38. package/dist/procedures.js.map +1 -1
  39. package/dist/signer.d.ts +11 -26
  40. package/dist/signer.d.ts.map +1 -1
  41. package/dist/signer.js +41 -26
  42. package/dist/signer.js.map +1 -1
  43. package/dist/transaction/options.d.ts +2 -0
  44. package/dist/transaction/options.d.ts.map +1 -1
  45. package/dist/transaction/updatePsm.d.ts.map +1 -1
  46. package/dist/transaction/updatePsm.js +21 -3
  47. package/dist/transaction/updatePsm.js.map +1 -1
  48. package/dist/transaction/updateSigners.d.ts.map +1 -1
  49. package/dist/transaction/updateSigners.js +21 -3
  50. package/dist/transaction/updateSigners.js.map +1 -1
  51. package/dist/transaction.d.ts.map +1 -1
  52. package/dist/transaction.js +0 -2
  53. package/dist/transaction.js.map +1 -1
  54. package/dist/transaction.test.js +5 -0
  55. package/dist/transaction.test.js.map +1 -1
  56. package/dist/types/proposal.d.ts +16 -8
  57. package/dist/types/proposal.d.ts.map +1 -1
  58. package/dist/types.d.ts +18 -14
  59. package/dist/types.d.ts.map +1 -1
  60. package/dist/utils/signature.d.ts +10 -2
  61. package/dist/utils/signature.d.ts.map +1 -1
  62. package/dist/utils/signature.js +77 -5
  63. package/dist/utils/signature.js.map +1 -1
  64. package/dist/utils/signature.test.js +16 -1
  65. package/dist/utils/signature.test.js.map +1 -1
  66. package/masm/multisig_ecdsa.masm +424 -0
  67. package/masm/psm_ecdsa.masm +179 -0
  68. package/package.json +2 -2
  69. package/src/account/builder.ts +18 -25
  70. package/src/account/masm.ts +433 -2
  71. package/src/account/storage.ts +5 -6
  72. package/src/client.test.ts +36 -0
  73. package/src/client.ts +10 -59
  74. package/src/index.ts +13 -62
  75. package/src/inspector.ts +15 -44
  76. package/src/multisig/helpers.ts +1 -2
  77. package/src/multisig.test.ts +45 -34
  78. package/src/multisig.ts +246 -273
  79. package/src/procedures.ts +21 -56
  80. package/src/signer.ts +48 -28
  81. package/src/transaction/options.ts +2 -0
  82. package/src/transaction/updatePsm.ts +24 -3
  83. package/src/transaction/updateSigners.ts +25 -3
  84. package/src/transaction.test.ts +6 -0
  85. package/src/transaction.ts +0 -2
  86. package/src/types/proposal.ts +15 -8
  87. package/src/types.ts +26 -16
  88. package/src/utils/signature.test.ts +24 -1
  89. package/src/utils/signature.ts +86 -4
@@ -1,4 +1,3 @@
1
- // Embedded MASM constants - content from masm/*.masm files
2
1
  export const MULTISIG_MASM = `# Multi-Signature RPO Falcon 512 Authentication Component
3
2
  #
4
3
  # This component provides multi-signature authentication for accounts.
@@ -423,6 +422,431 @@ pub proc auth_tx_rpo_falcon512_multisig.1(salt: BeWord)
423
422
  exec.assert_new_tx
424
423
  end
425
424
  `;
425
+ export const MULTISIG_ECDSA_MASM = `# Multi-Signature ECDSA secp256k1 Authentication Component
426
+ #
427
+ # This component provides multi-signature authentication for accounts using
428
+ # ECDSA secp256k1 (k256/keccak) signatures instead of RPO Falcon 512.
429
+ # It integrates with the PSM component for optional PSM signature verification.
430
+
431
+ use miden::active_account
432
+ use miden::native_account
433
+ use miden::auth
434
+ use openzeppelin::psm_ecdsa
435
+
436
+ # Type definitions for v0.12 syntax
437
+ type BeWord = struct @bigendian { a: felt, b: felt, c: felt, d: felt }
438
+
439
+ # CONSTANTS
440
+ # =================================================================================================
441
+
442
+ # Auth Request Constants
443
+
444
+ # The event emitted when a signature is not found for a required signer.
445
+ const AUTH_UNAUTHORIZED_EVENT = event("miden::auth::unauthorized")
446
+
447
+ # Storage Layout Constants
448
+ #
449
+ # +-------------------------------+----------+--------------+-------------------+
450
+ # | THRESHOLD & APPROVERS CONFIG | PUB KEYS | EXECUTED TXS | PROC THRESHOLDS |
451
+ # | (slot) | (map) | (map) | (map) |
452
+ # +-------------------------------+----------+--------------+-------------------+
453
+ # | 0 | 1 | 2 | 3 |
454
+ # +-------------------------------+----------+--------------+-------------------+
455
+
456
+ # The slot in this component's storage layout where the default signature threshold and
457
+ # number of approvers are stored as:
458
+ # [default_threshold, num_approvers, 0, 0].
459
+ # The threshold is guaranteed to be less than or equal to num_approvers.
460
+ const THRESHOLD_CONFIG_SLOT = 0
461
+
462
+ # The slot in this component's storage layout where the public keys map is stored.
463
+ # Map entries: [key_index, 0, 0, 0] => APPROVER_PUBLIC_KEY
464
+ const PUBLIC_KEYS_MAP_SLOT = 1
465
+
466
+ # The slot in this component's storage layout where executed transactions are stored.
467
+ # Map entries: transaction_message => [is_executed, 0, 0, 0]
468
+ const EXECUTED_TXS_SLOT = 2
469
+
470
+ # The slot in this component's storage layout where procedure thresholds are stored.
471
+ # Map entries: PROC_ROOT => [proc_threshold, 0, 0, 0]
472
+ const PROC_THRESHOLD_ROOTS_SLOT = 3
473
+
474
+ # Executed Transaction Flag Constant
475
+ const IS_EXECUTED_FLAG = [1, 0, 0, 0]
476
+
477
+ # ERRORS
478
+ const ERR_TX_ALREADY_EXECUTED = "failed to approve multisig transaction as it was already executed"
479
+
480
+ const ERR_MALFORMED_MULTISIG_CONFIG = "number of approvers must be equal to or greater than threshold"
481
+
482
+ const ERR_ZERO_IN_MULTISIG_CONFIG = "number of approvers or threshold must not be zero"
483
+
484
+ # MULTISIG PROCEDURES
485
+ # =================================================================================================
486
+
487
+ #! Check if transaction has already been executed and add it to executed transactions for replay protection.
488
+ #!
489
+ #! Inputs: [MSG]
490
+ #! Outputs: []
491
+ #!
492
+ #! Panics if:
493
+ #! - the same transaction has already been executed
494
+ proc assert_new_tx(msg: BeWord)
495
+ push.IS_EXECUTED_FLAG
496
+ # => [[0, 0, 0, is_executed], MSG]
497
+
498
+ swapw
499
+ # => [MSG, IS_EXECUTED_FLAG]
500
+
501
+ push.EXECUTED_TXS_SLOT
502
+ # => [index, MSG, IS_EXECUTED_FLAG]
503
+
504
+ # Set the key value pair in the map to mark transaction as executed
505
+ exec.native_account::set_map_item
506
+ # => [OLD_MAP_ROOT, [0, 0, 0, is_executed]]
507
+
508
+ dropw drop drop drop
509
+ # => [is_executed]
510
+
511
+ assertz.err=ERR_TX_ALREADY_EXECUTED
512
+ # => []
513
+ end
514
+
515
+ #! Remove old approver public keys from the approver public key mapping.
516
+ #!
517
+ #! This procedure cleans up the storage by removing public keys of approvers that are no longer
518
+ #! part of the multisig configuration. This procedure assumes that init_num_of_approvers and
519
+ #! new_num_of_approvers are u32 values.
520
+ #!
521
+ #! Inputs: [init_num_of_approvers, new_num_of_approvers]
522
+ #! Outputs: []
523
+ #!
524
+ #! Where:
525
+ #! - init_num_of_approvers is the original number of approvers before the update
526
+ #! - new_num_of_approvers is the new number of approvers after the update
527
+ proc cleanup_pubkey_mapping(init_num_of_approvers: u32, new_num_of_approvers: u32)
528
+ dup.1 dup.1
529
+ u32assert2 u32lt
530
+ # => [should_loop, i = init_num_of_approvers, new_num_of_approvers]
531
+
532
+ while.true
533
+ # => [i, new_num_of_approvers]
534
+
535
+ sub.1
536
+ # => [i-1, new_num_of_approvers]
537
+
538
+ dup
539
+ # => [i-1, i-1, new_num_of_approvers]
540
+
541
+ push.0.0.0
542
+ # => [[0, 0, 0, i-1], i-1, new_num_of_approvers]
543
+
544
+ padw swapw
545
+ # => [[0, 0, 0, i-1], EMPTY_WORD, i-1, new_num_of_approvers]
546
+
547
+ push.PUBLIC_KEYS_MAP_SLOT
548
+ # => [pub_key_slot_idx, [0, 0, 0, i-1], EMPTY_WORD, i-1, new_num_of_approvers]
549
+
550
+ exec.native_account::set_map_item
551
+ # => [OLD_MAP_ROOT, OLD_MAP_VALUE, i-1, new_num_of_approvers]
552
+
553
+ dropw dropw
554
+ # => [i-1, new_num_of_approvers]
555
+
556
+ dup.1 dup.1
557
+ u32lt
558
+ # => [should_loop, i-1, new_num_of_approvers]
559
+ end
560
+
561
+ drop drop
562
+ # => []
563
+ end
564
+
565
+ #! Update threshold config and add / remove approvers
566
+ #!
567
+ #! Inputs:
568
+ #! Operand stack: [MULTISIG_CONFIG_HASH, pad(12)]
569
+ #! Advice map: {
570
+ #! MULTISIG_CONFIG_HASH => [CONFIG, PUB_KEY_N, PUB_KEY_N-1, ..., PUB_KEY_0]
571
+ #! }
572
+ #! Outputs:
573
+ #! Operand stack: []
574
+ #!
575
+ #! Where:
576
+ #! - MULTISIG_CONFIG_HASH is the hash of the threshold and new public key vector
577
+ #! - MULTISIG_CONFIG is [threshold, num_approvers, 0, 0]
578
+ #! - PUB_KEY_i is the public key of the i-th signer
579
+ #!
580
+ #! Locals:
581
+ #! 0: new_num_of_approvers
582
+ #! 1: init_num_of_approvers
583
+ pub proc update_signers_and_threshold.2(multisig_config_hash: BeWord)
584
+ adv.push_mapval
585
+ # => [MULTISIG_CONFIG_HASH, pad(12)]
586
+
587
+ adv_loadw
588
+ # => [MULTISIG_CONFIG, pad(12)]
589
+
590
+ # store new_num_of_approvers for later
591
+ dup.2 loc_store.0
592
+ # => [MULTISIG_CONFIG, pad(12)]
593
+
594
+ dup.3 dup.3
595
+ # => [num_approvers, threshold, MULTISIG_CONFIG, pad(12)]
596
+
597
+ # make sure that the threshold is smaller than the number of approvers
598
+ u32assert2.err=ERR_MALFORMED_MULTISIG_CONFIG
599
+ u32gt assertz.err=ERR_MALFORMED_MULTISIG_CONFIG
600
+ # => [MULTISIG_CONFIG, pad(12)]
601
+
602
+ dup.3 dup.3
603
+ # => [num_approvers, threshold, MULTISIG_CONFIG, pad(12)]
604
+
605
+ # make sure that threshold or num_approvers are not zero
606
+ eq.0 assertz.err=ERR_ZERO_IN_MULTISIG_CONFIG
607
+ eq.0 assertz.err=ERR_ZERO_IN_MULTISIG_CONFIG
608
+ # => [MULTISIG_CONFIG, pad(12)]
609
+
610
+ push.THRESHOLD_CONFIG_SLOT
611
+ # => [slot, MULTISIG_CONFIG, pad(12)]
612
+
613
+ exec.native_account::set_item
614
+ # => [OLD_THRESHOLD_CONFIG, pad(12)]
615
+
616
+ # store init_num_of_approvers for later
617
+ drop drop loc_store.1 drop
618
+ # => [pad(12)]
619
+
620
+ loc_load.0
621
+ # => [num_approvers]
622
+
623
+ dup neq.0
624
+ while.true
625
+ sub.1
626
+ # => [i-1, pad(12)]
627
+
628
+ dup push.0.0.0
629
+ # => [[0, 0, 0, i-1], i-1, pad(12)]
630
+
631
+ padw adv_loadw
632
+ # => [PUB_KEY, [0, 0, 0, i-1], i-1, pad(12)]
633
+
634
+ swapw
635
+ # => [[0, 0, 0, i-1], PUB_KEY, i-1, pad(12)]
636
+
637
+ push.PUBLIC_KEYS_MAP_SLOT
638
+ # => [pub_key_slot_idx, [0, 0, 0, i-1], PUB_KEY, i-1, pad(12)]
639
+
640
+ exec.native_account::set_map_item
641
+ # => [OLD_MAP_ROOT, OLD_MAP_VALUE, i-1, pad(12)]
642
+
643
+ dropw dropw
644
+ # => [i-1, pad(12)]
645
+
646
+ dup neq.0
647
+ # => [is_non_zero, i-1, pad(12)]
648
+ end
649
+ # => [pad(13)]
650
+
651
+ drop
652
+ # => [pad(12)]
653
+
654
+ # compare initial vs current multisig config
655
+
656
+ # load init_num_of_approvers & new_num_of_approvers
657
+ loc_load.0 loc_load.1
658
+ # => [init_num_of_approvers, new_num_of_approvers, pad(12)]
659
+
660
+ exec.cleanup_pubkey_mapping
661
+ # => [pad(12)]
662
+ end
663
+
664
+ # Computes the effective transaction threshold based on called procedures and per-procedure
665
+ # overrides stored in PROC_THRESHOLD_ROOTS_SLOT. Falls back to default_threshold if no
666
+ # overrides apply.
667
+ #
668
+ #! Inputs: [default_threshold]
669
+ #! Outputs: [transaction_threshold]
670
+ proc compute_transaction_threshold.1(default_threshold: u32) -> u32
671
+ # 1. initialize transaction_threshold = 0
672
+ # 2. iterate through all account procedures
673
+ # a. check if the procedure was called during the transaction
674
+ # b. if called, get the override threshold of that procedure from the config map
675
+ # c. if proc_threshold > transaction_threshold, set transaction_threshold = proc_threshold
676
+ # 3. if transaction_threshold == 0 at the end, revert to using default_threshold
677
+
678
+ # store default_threshold for later
679
+ loc_store.0
680
+ # => []
681
+
682
+ # 1. initialize transaction_threshold = 0
683
+ push.0
684
+ # => [transaction_threshold]
685
+
686
+ # get the number of account procedures
687
+ exec.active_account::get_num_procedures
688
+ # => [num_procedures, transaction_threshold]
689
+
690
+ # 2. iterate through all account procedures
691
+ dup neq.0
692
+ # => [should_continue, num_procedures, transaction_threshold]
693
+ while.true
694
+ sub.1 dup
695
+ # => [num_procedures-1, num_procedures-1, transaction_threshold]
696
+
697
+ # get procedure root of the procedure with index i
698
+ exec.active_account::get_procedure_root dupw
699
+ # => [PROC_ROOT, PROC_ROOT, num_procedures-1, transaction_threshold]
700
+
701
+ # 2a. check if this procedure has been called in the transaction
702
+ exec.native_account::was_procedure_called
703
+ # => [was_called, PROC_ROOT, num_procedures-1, transaction_threshold]
704
+
705
+ # if it has been called, get the override threshold of that procedure
706
+ if.true
707
+ # => [PROC_ROOT, num_procedures-1, transaction_threshold]
708
+
709
+ push.PROC_THRESHOLD_ROOTS_SLOT
710
+ # => [PROC_THRESHOLD_ROOTS_SLOT, PROC_ROOT, num_procedures-1, transaction_threshold]
711
+
712
+ # 2b. get the override proc_threshold of that procedure
713
+ # if the procedure has no override threshold, the returned map item will be [0, 0, 0, 0]
714
+ exec.active_account::get_initial_map_item
715
+ # => [[0, 0, 0, proc_threshold], num_procedures-1, transaction_threshold]
716
+
717
+ drop drop drop dup dup.3
718
+ # => [transaction_threshold, proc_threshold, proc_threshold, num_procedures-1, transaction_threshold]
719
+
720
+ u32assert2.err="transaction threshold or procedure threshold are not u32"
721
+ u32gt
722
+ # => [is_gt, proc_threshold, num_procedures-1, transaction_threshold]
723
+ # 2c. if proc_threshold > transaction_threshold, update transaction_threshold
724
+ movup.2 movdn.3
725
+ # => [is_gt, proc_threshold, transaction_threshold, num_procedures-1]
726
+ cdrop
727
+ # => [updated_transaction_threshold, num_procedures-1]
728
+ swap
729
+ # => [num_procedures-1, updated_transaction_threshold]
730
+ # if it has not been called during this transaction, nothing to do, move to the next procedure
731
+ else
732
+ dropw
733
+ # => [num_procedures-1, transaction_threshold]
734
+ end
735
+
736
+ dup neq.0
737
+ # => [should_continue, num_procedures-1, transaction_threshold]
738
+ end
739
+
740
+ drop
741
+ # => [transaction_threshold]
742
+
743
+ loc_load.0
744
+ # => [default_threshold, transaction_threshold]
745
+
746
+ # 3. if transaction_threshold == 0 at the end, revert to using default_threshold
747
+ dup.1 eq.0
748
+ # => [is_zero, default_threshold, transaction_threshold]
749
+
750
+ cdrop
751
+ # => [effective_transaction_threshold]
752
+ end
753
+
754
+ #! Authenticate a transaction using ECDSA secp256k1 with multi-signature support.
755
+ #!
756
+ #! This procedure implements multi-signature authentication by:
757
+ #! 1. Computing the transaction summary message that needs to be signed
758
+ #! 2. Verifying ECDSA signatures from multiple required signers against their public keys
759
+ #! 3. Ensuring the minimum threshold of valid signatures is met
760
+ #! 4. Implementing replay protection by tracking executed transactions
761
+ #! 5. Verifying PSM signature if PSM selector is enabled (via PSM component)
762
+ #!
763
+ #! Inputs:
764
+ #! Operand stack: [SALT]
765
+ #! Advice map: {
766
+ #! h(PUB_KEY_0, MSG): SIG_0,
767
+ #! h(PUB_KEY_1, MSG): SIG_1,
768
+ #! h(PUB_KEY_n, MSG): SIG_n
769
+ #! }
770
+ #! Outputs:
771
+ #! Operand stack: []
772
+ #!
773
+ #! Where:
774
+ #! - SALT is a cryptographically random nonce that enables multiple concurrent
775
+ #! multisig transactions while maintaining replay protection. Each transaction
776
+ #! must use a unique SALT value to ensure transaction uniqueness.
777
+ #! - SIG_i is the ECDSA signature from the i-th signer.
778
+ #! - MSG is the transaction message being signed.
779
+ #! - h(PUB_KEY_i, MSG) is the hash of the public key and message used as the advice map key.
780
+ #!
781
+ #! Panics if:
782
+ #! - insufficient number of valid signatures (below threshold).
783
+ #! - the same transaction has already been executed (replay protection).
784
+ #! - PSM signature verification fails (if PSM is enabled).
785
+ #!
786
+ #! Invocation: call
787
+ pub proc auth_tx_ecdsa_multisig.1(salt: BeWord)
788
+ exec.native_account::incr_nonce drop
789
+ # => [SALT]
790
+
791
+ # ------ Computing transaction summary ------
792
+
793
+ exec.auth::create_tx_summary
794
+ # => [SALT, OUTPUT_NOTES_COMMITMENT, INPUT_NOTES_COMMITMENT, ACCOUNT_DELTA_COMMITMENT]
795
+
796
+ # to build a tx_summary in the host, we need these four words in the advice provider
797
+ exec.auth::adv_insert_hqword
798
+ # => [SALT, OUTPUT_NOTES_COMMITMENT, INPUT_NOTES_COMMITMENT, ACCOUNT_DELTA_COMMITMENT]
799
+
800
+ # the commitment to the tx summary is the message that is signed
801
+ exec.auth::hash_tx_summary
802
+ # => [TX_SUMMARY_COMMITMENT]
803
+
804
+ # ------ Verifying approver signatures ------
805
+
806
+ push.THRESHOLD_CONFIG_SLOT
807
+ # => [index, TX_SUMMARY_COMMITMENT]
808
+
809
+ exec.active_account::get_initial_item
810
+ # => [0, 0, num_of_approvers, default_threshold, TX_SUMMARY_COMMITMENT]
811
+
812
+ drop drop
813
+ # => [num_of_approvers, default_threshold, TX_SUMMARY_COMMITMENT]
814
+
815
+ swap movdn.5
816
+ # => [num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]
817
+
818
+ push.PUBLIC_KEYS_MAP_SLOT
819
+ # => [pub_key_slot_idx, num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]
820
+
821
+ exec.::miden::auth::ecdsa_k256_keccak::verify_signatures
822
+ # => [num_verified_signatures, TX_SUMMARY_COMMITMENT, default_threshold]
823
+
824
+ # ------ Checking threshold is >= num_verified_signatures ------
825
+
826
+ movup.5
827
+ # => [default_threshold, num_verified_signatures, TX_SUMMARY_COMMITMENT]
828
+
829
+ exec.compute_transaction_threshold
830
+ # => [transaction_threshold, num_verified_signatures, TX_SUMMARY_COMMITMENT]
831
+
832
+ u32assert2 u32lt
833
+ # => [is_unauthorized, TX_SUMMARY_COMMITMENT]
834
+
835
+ # If signatures are non-existent the tx will fail here.
836
+ if.true
837
+ emit.AUTH_UNAUTHORIZED_EVENT
838
+ push.0 assert.err="insufficient number of signatures"
839
+ end
840
+
841
+ # ------ Verifying PSM Signature ------
842
+ # => [TX_SUMMARY_COMMITMENT]
843
+ call.psm_ecdsa::verify_psm_signature
844
+
845
+ # ------ Writing executed transaction MSG to map ------
846
+ # => [TX_SUMMARY_COMMITMENT]
847
+ exec.assert_new_tx
848
+ end
849
+ `;
426
850
  export const PSM_MASM = `# Private State Manager (PSM) Authentication Component
427
851
  #
428
852
  # This component provides PSM signature verification for accounts.
@@ -602,4 +1026,7 @@ pub proc verify_psm_signature(msg: BeWord)
602
1026
  exec.enable_psm
603
1027
  end
604
1028
  `;
1029
+ export const PSM_ECDSA_MASM = PSM_MASM
1030
+ .replaceAll('RPO Falcon 512', 'ECDSA secp256k1')
1031
+ .replace('exec.::miden::auth::rpo_falcon512::verify_signatures', 'exec.::miden::auth::ecdsa_k256_keccak::verify_signatures');
605
1032
  //# sourceMappingURL=masm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"masm.js","sourceRoot":"","sources":["../../src/account/masm.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAua5B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkLvB,CAAC"}
1
+ {"version":3,"file":"masm.js","sourceRoot":"","sources":["../../src/account/masm.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkLvB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ;KACnC,UAAU,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KAC/C,OAAO,CACN,sDAAsD,EACtD,0DAA0D,CAC3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/account/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAoB,MAAM,uBAAuB,CAAC;AAItE,qBAAa,oBAAoB;IAC/B,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE;IAsCzD,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE;CAarD;AAID,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE,CAE/E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE,CAE1E;AAED,eAAO,MAAM,oBAAoB,sBAAwB,CAAC"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/account/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAoB,MAAM,uBAAuB,CAAC;AAItE,qBAAa,oBAAoB;IAC/B,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE;IAqCzD,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE;CAarD;AAID,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE,CAE/E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE,CAE1E;AAED,eAAO,MAAM,oBAAoB,sBAAwB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { StorageSlot, StorageMap, Word } from '@demox-labs/miden-sdk';
2
- import { ensureHexPrefix } from '../utils/encoding.js';
2
+ import { normalizeHexWord } from '../utils/encoding.js';
3
3
  import { getProcedureRoot } from '../procedures.js';
4
4
  export class StorageLayoutBuilder {
5
5
  buildMultisigSlots(config) {
@@ -14,17 +14,16 @@ export class StorageLayoutBuilder {
14
14
  const signersMap = new StorageMap();
15
15
  config.signerCommitments.forEach((commitment, index) => {
16
16
  const key = new Word(new BigUint64Array([BigInt(index), 0n, 0n, 0n]));
17
- const value = Word.fromHex(ensureHexPrefix(commitment));
17
+ const value = Word.fromHex(normalizeHexWord(commitment));
18
18
  signersMap.insert(key, value);
19
19
  });
20
20
  const slot1 = StorageSlot.map(signersMap);
21
21
  const slot2 = StorageSlot.map(new StorageMap());
22
- // Map entries: PROC_ROOT => [proc_threshold, 0, 0, 0]
23
- // Use SDK's Word.fromHex to match how account code procedure roots are represented
24
22
  const procThresholdMap = new StorageMap();
25
23
  if (config.procedureThresholds) {
24
+ const signatureScheme = config.signatureScheme ?? 'falcon';
26
25
  for (const pt of config.procedureThresholds) {
27
- const rootHex = getProcedureRoot(pt.procedure);
26
+ const rootHex = getProcedureRoot(pt.procedure, signatureScheme);
28
27
  const key = Word.fromHex(rootHex);
29
28
  const value = new Word(new BigUint64Array([BigInt(pt.threshold), 0n, 0n, 0n]));
30
29
  procThresholdMap.insert(key, value);
@@ -39,7 +38,7 @@ export class StorageLayoutBuilder {
39
38
  const slot0 = StorageSlot.fromValue(selectorWord);
40
39
  const psmKeyMap = new StorageMap();
41
40
  const zeroKey = new Word(new BigUint64Array([0n, 0n, 0n, 0n]));
42
- const psmKey = Word.fromHex(ensureHexPrefix(config.psmCommitment));
41
+ const psmKey = Word.fromHex(normalizeHexWord(config.psmCommitment));
43
42
  psmKeyMap.insert(zeroKey, psmKey);
44
43
  const slot1 = StorageSlot.map(psmKeyMap);
45
44
  return [slot0, slot1];
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/account/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,OAAO,oBAAoB;IAC/B,kBAAkB,CAAC,MAAsB;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC;QACnD,MAAM,SAAS,GAAG,IAAI,IAAI,CACxB,IAAI,cAAc,CAAC;YACjB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;YACxB,MAAM,CAAC,UAAU,CAAC;YAClB,EAAE;YACF,EAAE;SACH,CAAC,CACH,CAAC;QACF,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAE/C,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;QACpC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,cAAc,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;YACtE,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;YACxD,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE1C,M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B;IACzD,OAAO,qBAAqB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC"}
package/dist/client.d.ts CHANGED
@@ -1,73 +1,21 @@
1
- /**
2
- * MultisigClient - Factory for creating and loading multisig accounts.
3
- *
4
- * This is the main entry point for the multisig SDK. It provides methods
5
- * to create new multisig accounts and load existing ones.
6
- */
7
1
  import { type WebClient } from '@demox-labs/miden-sdk';
8
- import { PsmHttpClient } from '@openzeppelin/psm-client';
2
+ import { PsmHttpClient, type SignatureScheme } from '@openzeppelin/psm-client';
9
3
  import { Multisig } from './multisig.js';
10
4
  import type { MultisigConfig, Signer } from './types.js';
11
- /**
12
- * Configuration for MultisigClient.
13
- */
14
5
  export interface MultisigClientConfig {
15
- /** PSM server endpoint */
16
6
  psmEndpoint?: string;
17
7
  }
18
- /**
19
- * Client for creating and loading multisig accounts.
20
- *
21
- * @example
22
- * ```typescript
23
- * import { MultisigClient, FalconSigner } from '@openzeppelin/miden-multisig-client';
24
- * import { WebClient, SecretKey } from '@demox-labs/miden-sdk';
25
- *
26
- * // Initialize
27
- * const webClient = await WebClient.createClient('https://rpc.testnet.miden.io:443');
28
- * const secretKey = SecretKey.rpoFalconWithRNG(seed);
29
- * const signer = new FalconSigner(secretKey);
30
- *
31
- * // Create client
32
- * const client = new MultisigClient(webClient, { psmEndpoint: 'http://localhost:3000' });
33
- *
34
- * // Get PSM pubkey for config
35
- * const psmCommitment = await client.psmClient.getPubkey();
36
- *
37
- * // Create multisig
38
- * const config = { threshold: 2, signerCommitments: [...], psmCommitment };
39
- * const multisig = await client.create(config, signer);
40
- * ```
41
- */
42
8
  export declare class MultisigClient {
43
9
  private readonly webClient;
44
10
  private _psmClient;
45
11
  constructor(webClient: WebClient, config?: MultisigClientConfig);
46
- /**
47
- * Change the PSM endpoint.
48
- *
49
- * @param endpoint - The new PSM server endpoint URL
50
- */
51
12
  setPsmEndpoint(endpoint: string): void;
52
- /**
53
- * Access the internal PSM client.
54
- */
13
+ initialize(scheme?: SignatureScheme): Promise<{
14
+ psmCommitment: string;
15
+ psmPublicKey?: string;
16
+ }>;
55
17
  get psmClient(): PsmHttpClient;
56
- /**
57
- * Create a new multisig account.
58
- *
59
- * @param config - Multisig configuration (threshold, signers, PSM commitment)
60
- * @param signer - The signer for this client (one of the cosigners)
61
- * @returns A Multisig instance wrapping the created account
62
- */
63
18
  create(config: MultisigConfig, signer: Signer): Promise<Multisig>;
64
- /**
65
- * Load an existing multisig account from PSM.
66
- *
67
- * @param accountId - The account ID to load
68
- * @param signer - The signer for this client
69
- * @returns A Multisig instance for the loaded account
70
- */
71
19
  load(accountId: string, signer: Signer): Promise<Multisig>;
72
20
  }
73
21
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,UAAU,CAAgB;gBAEtB,SAAS,EAAE,SAAS,EAAE,MAAM,GAAE,oBAAyB;IAKnE;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAItC;;OAEG;IACH,IAAI,SAAS,IAAI,aAAa,CAE7B;IAED;;;;;;OAM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