@openzeppelin/miden-multisig-client 0.13.0 → 0.13.2
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/README.md +98 -119
- package/dist/account/builder.d.ts +18 -0
- package/dist/account/builder.d.ts.map +1 -1
- package/dist/account/builder.js +59 -29
- package/dist/account/builder.js.map +1 -1
- package/dist/account/builder.test.d.ts +2 -0
- package/dist/account/builder.test.d.ts.map +1 -0
- package/dist/account/builder.test.js +115 -0
- package/dist/account/builder.test.js.map +1 -0
- package/dist/account/index.d.ts +1 -1
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +1 -1
- package/dist/account/index.js.map +1 -1
- package/dist/account/masm/account-components/auth.d.ts +5 -0
- package/dist/account/masm/account-components/auth.d.ts.map +1 -0
- package/dist/account/masm/account-components/auth.js +67 -0
- package/dist/account/masm/account-components/auth.js.map +1 -0
- package/dist/account/masm/auth.d.ts +5 -0
- package/dist/account/masm/auth.d.ts.map +1 -0
- package/dist/account/masm/auth.js +1395 -0
- package/dist/account/masm/auth.js.map +1 -0
- package/dist/account/masm/index.d.ts +3 -0
- package/dist/account/masm/index.d.ts.map +1 -0
- package/dist/account/masm/index.js +5 -0
- package/dist/account/masm/index.js.map +1 -0
- package/dist/account/masm.d.ts +1 -4
- package/dist/account/masm.d.ts.map +1 -1
- package/dist/account/masm.js +3 -1034
- package/dist/account/masm.js.map +1 -1
- package/dist/account/storage.d.ts +2 -2
- package/dist/account/storage.d.ts.map +1 -1
- package/dist/account/storage.js +18 -16
- package/dist/account/storage.js.map +1 -1
- package/dist/client.d.ts +67 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +73 -22
- package/dist/client.js.map +1 -1
- package/dist/client.test.js +31 -32
- package/dist/client.test.js.map +1 -1
- package/dist/index.d.ts +54 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -9
- package/dist/index.js.map +1 -1
- package/dist/inspector.d.ts +32 -6
- package/dist/inspector.d.ts.map +1 -1
- package/dist/inspector.js +58 -23
- package/dist/inspector.js.map +1 -1
- package/dist/inspector.test.js +18 -18
- package/dist/inspector.test.js.map +1 -1
- package/dist/multisig/proposal/execution.d.ts +6 -5
- package/dist/multisig/proposal/execution.d.ts.map +1 -1
- package/dist/multisig/proposal/execution.js +49 -27
- package/dist/multisig/proposal/execution.js.map +1 -1
- package/dist/multisig/proposal/parser.d.ts +3 -3
- package/dist/multisig/proposal/parser.d.ts.map +1 -1
- package/dist/multisig/proposal/parser.js +23 -23
- package/dist/multisig/proposal/parser.js.map +1 -1
- package/dist/multisig/signing.d.ts +3 -3
- package/dist/multisig/signing.d.ts.map +1 -1
- package/dist/multisig/signing.js +3 -3
- package/dist/multisig/signing.js.map +1 -1
- package/dist/multisig.d.ts +187 -46
- package/dist/multisig.d.ts.map +1 -1
- package/dist/multisig.js +650 -289
- package/dist/multisig.js.map +1 -1
- package/dist/multisig.test.js +1680 -241
- package/dist/multisig.test.js.map +1 -1
- package/dist/procedures.d.ts +46 -24
- package/dist/procedures.d.ts.map +1 -1
- package/dist/procedures.js +46 -21
- package/dist/procedures.js.map +1 -1
- package/dist/proposal/factory.d.ts +18 -0
- package/dist/proposal/factory.d.ts.map +1 -0
- package/dist/proposal/factory.js +99 -0
- package/dist/proposal/factory.js.map +1 -0
- package/dist/proposal/metadata.d.ts +8 -0
- package/dist/proposal/metadata.d.ts.map +1 -0
- package/dist/proposal/metadata.js +156 -0
- package/dist/proposal/metadata.js.map +1 -0
- package/dist/proposal/signatures.d.ts +10 -0
- package/dist/proposal/signatures.d.ts.map +1 -0
- package/dist/proposal/signatures.js +54 -0
- package/dist/proposal/signatures.js.map +1 -0
- package/dist/signer.d.ts +2 -0
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +2 -0
- package/dist/signer.js.map +1 -1
- package/dist/signers/ecdsa.d.ts +3 -0
- package/dist/signers/ecdsa.d.ts.map +1 -1
- package/dist/signers/ecdsa.js +8 -4
- package/dist/signers/ecdsa.js.map +1 -1
- package/dist/signers/ecdsa.test.d.ts +2 -0
- package/dist/signers/ecdsa.test.d.ts.map +1 -0
- package/dist/signers/ecdsa.test.js +65 -0
- package/dist/signers/ecdsa.test.js.map +1 -0
- package/dist/signers/falcon.d.ts +3 -0
- package/dist/signers/falcon.d.ts.map +1 -1
- package/dist/signers/falcon.js +8 -4
- package/dist/signers/falcon.js.map +1 -1
- package/dist/signers/falcon.test.js +12 -0
- package/dist/signers/falcon.test.js.map +1 -1
- package/dist/signers/miden-wallet.d.ts +3 -1
- package/dist/signers/miden-wallet.d.ts.map +1 -1
- package/dist/signers/miden-wallet.js +11 -2
- package/dist/signers/miden-wallet.js.map +1 -1
- package/dist/signers/miden-wallet.test.js +26 -0
- package/dist/signers/miden-wallet.test.js.map +1 -1
- package/dist/signers/para.d.ts +3 -3
- package/dist/signers/para.d.ts.map +1 -1
- package/dist/signers/para.js +15 -6
- package/dist/signers/para.js.map +1 -1
- package/dist/signers/para.test.js +39 -0
- package/dist/signers/para.test.js.map +1 -1
- package/dist/transaction/consumeNotes.d.ts.map +1 -1
- package/dist/transaction/consumeNotes.js +1 -0
- package/dist/transaction/consumeNotes.js.map +1 -1
- package/dist/transaction/index.d.ts +2 -1
- package/dist/transaction/index.d.ts.map +1 -1
- package/dist/transaction/index.js +2 -1
- package/dist/transaction/index.js.map +1 -1
- package/dist/transaction/options.d.ts +1 -1
- package/dist/transaction/options.d.ts.map +1 -1
- package/dist/transaction/p2id.d.ts +1 -0
- package/dist/transaction/p2id.d.ts.map +1 -1
- package/dist/transaction/p2id.js +9 -3
- package/dist/transaction/p2id.js.map +1 -1
- package/dist/transaction/p2id.test.d.ts +2 -0
- package/dist/transaction/p2id.test.d.ts.map +1 -0
- package/dist/transaction/p2id.test.js +138 -0
- package/dist/transaction/p2id.test.js.map +1 -0
- package/dist/transaction/rpoRandomCoin.d.ts +7 -0
- package/dist/transaction/rpoRandomCoin.d.ts.map +1 -0
- package/dist/transaction/rpoRandomCoin.js +17 -0
- package/dist/transaction/rpoRandomCoin.js.map +1 -0
- package/dist/transaction/rpoRandomCoin.test.d.ts +2 -0
- package/dist/transaction/rpoRandomCoin.test.d.ts.map +1 -0
- package/dist/transaction/rpoRandomCoin.test.js +52 -0
- package/dist/transaction/rpoRandomCoin.test.js.map +1 -0
- package/dist/transaction/updateGuardian.d.ts +7 -0
- package/dist/transaction/updateGuardian.d.ts.map +1 -0
- package/dist/transaction/{updatePsm.js → updateGuardian.js} +15 -29
- package/dist/transaction/updateGuardian.js.map +1 -0
- package/dist/transaction/updateProcedureThreshold.d.ts +9 -0
- package/dist/transaction/updateProcedureThreshold.d.ts.map +1 -0
- package/dist/transaction/updateProcedureThreshold.js +55 -0
- package/dist/transaction/updateProcedureThreshold.js.map +1 -0
- package/dist/transaction/updateSigners.d.ts.map +1 -1
- package/dist/transaction/updateSigners.js +5 -23
- package/dist/transaction/updateSigners.js.map +1 -1
- package/dist/transaction.d.ts +2 -1
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +2 -1
- package/dist/transaction.js.map +1 -1
- package/dist/types/proposal.d.ts +32 -15
- package/dist/types/proposal.d.ts.map +1 -1
- package/dist/types.d.ts +24 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/digest.d.ts +5 -0
- package/dist/utils/digest.d.ts.map +1 -1
- package/dist/utils/digest.js +34 -1
- package/dist/utils/digest.js.map +1 -1
- package/dist/utils/digest.test.d.ts +2 -0
- package/dist/utils/digest.test.d.ts.map +1 -0
- package/dist/utils/digest.test.js +48 -0
- package/dist/utils/digest.test.js.map +1 -0
- package/dist/utils/signature.d.ts +3 -1
- package/dist/utils/signature.d.ts.map +1 -1
- package/dist/utils/signature.js +31 -6
- package/dist/utils/signature.js.map +1 -1
- package/dist/utils/word.test.js +1 -52
- package/dist/utils/word.test.js.map +1 -1
- package/masm/account_components/auth/multisig.masm +13 -0
- package/masm/account_components/auth/multisig_ecdsa.masm +13 -0
- package/masm/account_components/auth/multisig_guardian.masm +17 -0
- package/masm/account_components/auth/multisig_guardian_ecdsa.masm +17 -0
- package/masm/auth/guardian.masm +177 -0
- package/masm/auth/guardian_ecdsa.masm +178 -0
- package/masm/{multisig.masm → auth/multisig.masm} +149 -55
- package/masm/{multisig_ecdsa.masm → auth/multisig_ecdsa.masm} +148 -56
- package/package.json +11 -9
- package/src/account/builder.test.ts +165 -0
- package/src/account/builder.ts +71 -34
- package/src/account/index.ts +1 -1
- package/src/account/masm/account-components/auth.ts +70 -0
- package/src/account/masm/auth.ts +1398 -0
- package/src/account/masm/index.ts +5 -0
- package/src/account/masm.ts +3 -1040
- package/src/account/storage.ts +18 -16
- package/src/client.test.ts +31 -35
- package/src/client.ts +98 -26
- package/src/index.ts +84 -22
- package/src/inspector.test.ts +17 -17
- package/src/inspector.ts +63 -29
- package/src/multisig/proposal/execution.ts +102 -41
- package/src/multisig/proposal/parser.ts +26 -26
- package/src/multisig/signing.ts +4 -4
- package/src/multisig.test.ts +2097 -248
- package/src/multisig.ts +882 -365
- package/src/procedures.ts +50 -26
- package/src/proposal/factory.ts +171 -0
- package/src/proposal/metadata.ts +165 -0
- package/src/proposal/signatures.ts +68 -0
- package/src/signer.ts +2 -0
- package/src/signers/ecdsa.test.ts +80 -0
- package/src/signers/ecdsa.ts +15 -4
- package/src/signers/falcon.test.ts +19 -0
- package/src/signers/falcon.ts +16 -5
- package/src/signers/miden-wallet.test.ts +47 -0
- package/src/signers/miden-wallet.ts +18 -1
- package/src/signers/para.test.ts +57 -0
- package/src/signers/para.ts +26 -7
- package/src/transaction/consumeNotes.ts +1 -0
- package/src/transaction/index.ts +2 -2
- package/src/transaction/options.ts +1 -2
- package/src/transaction/p2id.test.ts +190 -0
- package/src/transaction/p2id.ts +11 -5
- package/src/transaction/rpoRandomCoin.test.ts +64 -0
- package/src/transaction/rpoRandomCoin.ts +24 -0
- package/src/transaction/{updatePsm.ts → updateGuardian.ts} +19 -32
- package/src/transaction/updateProcedureThreshold.ts +97 -0
- package/src/transaction/updateSigners.ts +12 -27
- package/src/transaction.ts +5 -3
- package/src/types/proposal.ts +43 -11
- package/src/types.ts +29 -11
- package/src/utils/digest.test.ts +55 -0
- package/src/utils/digest.ts +51 -1
- package/src/utils/signature.ts +47 -9
- package/src/utils/word.test.ts +1 -55
- package/dist/account.d.ts +0 -104
- package/dist/account.d.ts.map +0 -1
- package/dist/account.js +0 -136
- package/dist/account.js.map +0 -1
- package/dist/builder.d.ts +0 -54
- package/dist/builder.d.ts.map +0 -1
- package/dist/builder.js +0 -78
- package/dist/builder.js.map +0 -1
- package/dist/http.d.ts +0 -64
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -162
- package/dist/http.js.map +0 -1
- package/dist/keystore.d.ts +0 -65
- package/dist/keystore.d.ts.map +0 -1
- package/dist/keystore.js +0 -121
- package/dist/keystore.js.map +0 -1
- package/dist/miden.d.ts +0 -9
- package/dist/miden.d.ts.map +0 -1
- package/dist/miden.js +0 -26
- package/dist/miden.js.map +0 -1
- package/dist/multisig/metadata.d.ts +0 -18
- package/dist/multisig/metadata.d.ts.map +0 -1
- package/dist/multisig/metadata.js +0 -100
- package/dist/multisig/metadata.js.map +0 -1
- package/dist/multisig/metadata.test.d.ts +0 -2
- package/dist/multisig/metadata.test.d.ts.map +0 -1
- package/dist/multisig/metadata.test.js +0 -323
- package/dist/multisig/metadata.test.js.map +0 -1
- package/dist/signer.test.d.ts +0 -2
- package/dist/signer.test.d.ts.map +0 -1
- package/dist/signer.test.js +0 -117
- package/dist/signer.test.js.map +0 -1
- package/dist/transaction/updatePsm.d.ts +0 -7
- package/dist/transaction/updatePsm.d.ts.map +0 -1
- package/dist/transaction/updatePsm.js.map +0 -1
- package/dist/transport/http.d.ts +0 -64
- package/dist/transport/http.d.ts.map +0 -1
- package/dist/transport/http.js +0 -162
- package/dist/transport/http.js.map +0 -1
- package/dist/transport/index.d.ts +0 -5
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js +0 -5
- package/dist/transport/index.js.map +0 -1
- package/masm/psm.masm +0 -178
- package/masm/psm_ecdsa.masm +0 -179
package/src/account/builder.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account builder for creating multisig accounts with GUARDIAN authentication.
|
|
3
|
+
*
|
|
4
|
+
* This module provides functionality to create multisig accounts.
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import {
|
|
2
8
|
AccountBuilder,
|
|
3
9
|
AccountComponent,
|
|
@@ -6,38 +12,63 @@ import {
|
|
|
6
12
|
type WebClient,
|
|
7
13
|
} from '@miden-sdk/miden-sdk';
|
|
8
14
|
import type { MultisigConfig, CreateAccountResult } from '../types.js';
|
|
9
|
-
import { buildMultisigStorageSlots,
|
|
10
|
-
import {
|
|
15
|
+
import { buildMultisigStorageSlots, buildGuardianStorageSlots } from './storage.js';
|
|
16
|
+
import {
|
|
17
|
+
MULTISIG_ECDSA_MASM,
|
|
18
|
+
MULTISIG_MASM,
|
|
19
|
+
GUARDIAN_ECDSA_MASM,
|
|
20
|
+
GUARDIAN_MASM,
|
|
21
|
+
} from './masm/auth.js';
|
|
22
|
+
import {
|
|
23
|
+
MULTISIG_GUARDIAN_ACCOUNT_COMPONENT_MASM,
|
|
24
|
+
MULTISIG_GUARDIAN_ECDSA_ACCOUNT_COMPONENT_MASM,
|
|
25
|
+
} from './masm/account-components/auth.js';
|
|
26
|
+
import { normalizeSignerCommitment } from '../utils/signature.js';
|
|
11
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Creates a multisig account with GUARDIAN authentication.
|
|
30
|
+
*
|
|
31
|
+
* @param webClient - Initialized Miden WebClient
|
|
32
|
+
* @param config - Multisig configuration
|
|
33
|
+
* @returns The created account and seed
|
|
34
|
+
*/
|
|
12
35
|
export async function createMultisigAccount(
|
|
13
36
|
webClient: WebClient,
|
|
14
37
|
config: MultisigConfig
|
|
15
38
|
): Promise<CreateAccountResult> {
|
|
16
39
|
validateMultisigConfig(config);
|
|
17
|
-
|
|
18
40
|
const signatureScheme = config.signatureScheme ?? 'falcon';
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const psmCode = psmBuilder.compileAccountComponentCode(psmMasm);
|
|
25
|
-
const psmComponent = AccountComponent
|
|
26
|
-
.compile(psmCode, psmSlots)
|
|
27
|
-
.withSupportsAllTypes();
|
|
28
|
-
|
|
41
|
+
const authSlots = [
|
|
42
|
+
...buildMultisigStorageSlots(config),
|
|
43
|
+
...buildGuardianStorageSlots(config),
|
|
44
|
+
];
|
|
45
|
+
const guardianMasm = signatureScheme === 'ecdsa' ? GUARDIAN_ECDSA_MASM : GUARDIAN_MASM;
|
|
29
46
|
const multisigMasm = signatureScheme === 'ecdsa' ? MULTISIG_ECDSA_MASM : MULTISIG_MASM;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
const authComponentMasm = signatureScheme === 'ecdsa'
|
|
48
|
+
? MULTISIG_GUARDIAN_ECDSA_ACCOUNT_COMPONENT_MASM
|
|
49
|
+
: MULTISIG_GUARDIAN_ACCOUNT_COMPONENT_MASM;
|
|
50
|
+
const guardianLibraryPath = signatureScheme === 'ecdsa'
|
|
51
|
+
? 'openzeppelin::auth::guardian_ecdsa'
|
|
52
|
+
: 'openzeppelin::auth::guardian';
|
|
53
|
+
const multisigLibraryPath = signatureScheme === 'ecdsa'
|
|
54
|
+
? 'openzeppelin::auth::multisig_ecdsa'
|
|
55
|
+
: 'openzeppelin::auth::multisig';
|
|
56
|
+
|
|
57
|
+
const authBuilder = webClient.createCodeBuilder();
|
|
58
|
+
const guardianLib = authBuilder.buildLibrary(guardianLibraryPath, guardianMasm);
|
|
59
|
+
authBuilder.linkStaticLibrary(guardianLib);
|
|
60
|
+
const multisigLib = authBuilder.buildLibrary(multisigLibraryPath, multisigMasm);
|
|
61
|
+
authBuilder.linkStaticLibrary(multisigLib);
|
|
62
|
+
const authCode = authBuilder.compileAccountComponentCode(authComponentMasm);
|
|
63
|
+
const authComponent = AccountComponent
|
|
64
|
+
.compile(authCode, authSlots)
|
|
37
65
|
.withSupportsAllTypes();
|
|
38
66
|
|
|
39
|
-
|
|
40
|
-
|
|
67
|
+
let seed = config.seed;
|
|
68
|
+
// Generate random seed if not provided
|
|
69
|
+
if (!seed) {
|
|
70
|
+
seed = crypto.getRandomValues(new Uint8Array(32));
|
|
71
|
+
}
|
|
41
72
|
|
|
42
73
|
const storageMode = config.storageMode === 'public'
|
|
43
74
|
? AccountStorageMode.public()
|
|
@@ -46,8 +77,7 @@ export async function createMultisigAccount(
|
|
|
46
77
|
const accountBuilder = new AccountBuilder(seed)
|
|
47
78
|
.accountType(AccountType.RegularAccountUpdatableCode)
|
|
48
79
|
.storageMode(storageMode)
|
|
49
|
-
.withAuthComponent(
|
|
50
|
-
.withComponent(psmComponent)
|
|
80
|
+
.withAuthComponent(authComponent)
|
|
51
81
|
.withBasicWalletComponent();
|
|
52
82
|
|
|
53
83
|
const result = accountBuilder.build();
|
|
@@ -60,6 +90,12 @@ export async function createMultisigAccount(
|
|
|
60
90
|
};
|
|
61
91
|
}
|
|
62
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Validates a multisig configuration.
|
|
95
|
+
*
|
|
96
|
+
* @param config - The configuration to validate
|
|
97
|
+
* @throws Error if configuration is invalid
|
|
98
|
+
*/
|
|
63
99
|
export function validateMultisigConfig(config: MultisigConfig): void {
|
|
64
100
|
if (config.threshold === 0) {
|
|
65
101
|
throw new Error('threshold must be greater than 0');
|
|
@@ -67,25 +103,26 @@ export function validateMultisigConfig(config: MultisigConfig): void {
|
|
|
67
103
|
if (config.signerCommitments.length === 0) {
|
|
68
104
|
throw new Error('at least one signer commitment is required');
|
|
69
105
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (
|
|
75
|
-
throw new Error(
|
|
76
|
-
`signerCommitments must be 32-byte commitment hex (64 chars), got ${stripped.length} chars`
|
|
77
|
-
);
|
|
106
|
+
|
|
107
|
+
const signerCommitments = new Set<string>();
|
|
108
|
+
for (const signerCommitment of config.signerCommitments) {
|
|
109
|
+
const normalizedCommitment = normalizeSignerCommitment(signerCommitment);
|
|
110
|
+
if (signerCommitments.has(normalizedCommitment)) {
|
|
111
|
+
throw new Error(`duplicate signer commitment: ${normalizedCommitment}`);
|
|
78
112
|
}
|
|
113
|
+
signerCommitments.add(normalizedCommitment);
|
|
79
114
|
}
|
|
115
|
+
|
|
80
116
|
if (config.threshold > config.signerCommitments.length) {
|
|
81
117
|
throw new Error(
|
|
82
118
|
`threshold (${config.threshold}) cannot exceed number of signers (${config.signerCommitments.length})`
|
|
83
119
|
);
|
|
84
120
|
}
|
|
85
|
-
if (!config.
|
|
86
|
-
throw new Error('
|
|
121
|
+
if (!config.guardianCommitment) {
|
|
122
|
+
throw new Error('GUARDIAN commitment is required');
|
|
87
123
|
}
|
|
88
124
|
|
|
125
|
+
// Validate procedure thresholds if provided
|
|
89
126
|
if (config.procedureThresholds) {
|
|
90
127
|
const seen = new Set<string>();
|
|
91
128
|
for (const pt of config.procedureThresholds) {
|
package/src/account/index.ts
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// This file is generated by scripts/generate-masm.mjs from the MASM contract sources.
|
|
2
|
+
// Do not edit it by hand.
|
|
3
|
+
|
|
4
|
+
export const MULTISIG_ACCOUNT_COMPONENT_MASM = `# Multi-Signature RPO Falcon 512 Authentication Component
|
|
5
|
+
|
|
6
|
+
use openzeppelin::auth::multisig
|
|
7
|
+
|
|
8
|
+
type BeWord = struct @bigendian { a: felt, b: felt, c: felt, d: felt }
|
|
9
|
+
|
|
10
|
+
pub use multisig::update_signers_and_threshold
|
|
11
|
+
pub use multisig::update_procedure_threshold
|
|
12
|
+
|
|
13
|
+
pub proc auth_tx_multisig(salt: BeWord)
|
|
14
|
+
exec.multisig::auth_tx
|
|
15
|
+
exec.multisig::assert_new_tx
|
|
16
|
+
end
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const MULTISIG_GUARDIAN_ACCOUNT_COMPONENT_MASM = `# Multi-Signature RPO Falcon 512 Authentication Component With GUARDIAN
|
|
20
|
+
|
|
21
|
+
use openzeppelin::auth::multisig
|
|
22
|
+
use openzeppelin::auth::guardian
|
|
23
|
+
|
|
24
|
+
type BeWord = struct @bigendian { a: felt, b: felt, c: felt, d: felt }
|
|
25
|
+
|
|
26
|
+
pub use multisig::update_signers_and_threshold
|
|
27
|
+
pub use multisig::update_procedure_threshold
|
|
28
|
+
pub use guardian::update_guardian_public_key
|
|
29
|
+
pub use guardian::verify_guardian_signature
|
|
30
|
+
|
|
31
|
+
pub proc auth_tx_multisig_guardian(salt: BeWord)
|
|
32
|
+
exec.multisig::auth_tx
|
|
33
|
+
exec.guardian::verify_guardian_signature
|
|
34
|
+
exec.multisig::assert_new_tx
|
|
35
|
+
end
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
export const MULTISIG_ECDSA_ACCOUNT_COMPONENT_MASM = `# Multi-Signature ECDSA secp256k1 Authentication Component
|
|
39
|
+
|
|
40
|
+
use openzeppelin::auth::multisig_ecdsa
|
|
41
|
+
|
|
42
|
+
type BeWord = struct @bigendian { a: felt, b: felt, c: felt, d: felt }
|
|
43
|
+
|
|
44
|
+
pub use multisig_ecdsa::update_signers_and_threshold
|
|
45
|
+
pub use multisig_ecdsa::update_procedure_threshold
|
|
46
|
+
|
|
47
|
+
pub proc auth_tx_multisig_ecdsa(salt: BeWord)
|
|
48
|
+
exec.multisig_ecdsa::auth_tx
|
|
49
|
+
exec.multisig_ecdsa::assert_new_tx
|
|
50
|
+
end
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
export const MULTISIG_GUARDIAN_ECDSA_ACCOUNT_COMPONENT_MASM = `# Multi-Signature ECDSA secp256k1 Authentication Component With GUARDIAN
|
|
54
|
+
|
|
55
|
+
use openzeppelin::auth::multisig_ecdsa
|
|
56
|
+
use openzeppelin::auth::guardian_ecdsa
|
|
57
|
+
|
|
58
|
+
type BeWord = struct @bigendian { a: felt, b: felt, c: felt, d: felt }
|
|
59
|
+
|
|
60
|
+
pub use multisig_ecdsa::update_signers_and_threshold
|
|
61
|
+
pub use multisig_ecdsa::update_procedure_threshold
|
|
62
|
+
pub use guardian_ecdsa::update_guardian_public_key
|
|
63
|
+
pub use guardian_ecdsa::verify_guardian_signature
|
|
64
|
+
|
|
65
|
+
pub proc auth_tx_multisig_guardian_ecdsa(salt: BeWord)
|
|
66
|
+
exec.multisig_ecdsa::auth_tx
|
|
67
|
+
exec.guardian_ecdsa::verify_guardian_signature
|
|
68
|
+
exec.multisig_ecdsa::assert_new_tx
|
|
69
|
+
end
|
|
70
|
+
`;
|