@openzeppelin/miden-multisig-client 0.16.1 → 0.17.0-rc.1
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 +192 -11
- package/dist/account/builder.d.ts.map +1 -1
- package/dist/account/builder.js +32 -25
- package/dist/account/builder.js.map +1 -1
- package/dist/account/builder.test.js +73 -21
- package/dist/account/builder.test.js.map +1 -1
- package/dist/account/layout.d.ts +31 -0
- package/dist/account/layout.d.ts.map +1 -0
- package/dist/account/layout.js +31 -0
- package/dist/account/layout.js.map +1 -0
- package/dist/account/masm/account-components/auth.d.ts +1 -4
- package/dist/account/masm/account-components/auth.d.ts.map +1 -1
- package/dist/account/masm/account-components/auth.js +36 -53
- package/dist/account/masm/account-components/auth.js.map +1 -1
- package/dist/account/masm/index.d.ts +0 -1
- package/dist/account/masm/index.d.ts.map +1 -1
- package/dist/account/masm/index.js +0 -1
- package/dist/account/masm/index.js.map +1 -1
- package/dist/account/storage.d.ts +4 -0
- package/dist/account/storage.d.ts.map +1 -1
- package/dist/account/storage.js +9 -20
- package/dist/account/storage.js.map +1 -1
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -5
- package/dist/client.js.map +1 -1
- package/dist/client.test.js +74 -16
- package/dist/client.test.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/inspector.d.ts +59 -1
- package/dist/inspector.d.ts.map +1 -1
- package/dist/inspector.js +157 -29
- package/dist/inspector.js.map +1 -1
- package/dist/inspector.test.js +246 -37
- package/dist/inspector.test.js.map +1 -1
- package/dist/multisig.d.ts +109 -33
- package/dist/multisig.d.ts.map +1 -1
- package/dist/multisig.js +307 -104
- package/dist/multisig.js.map +1 -1
- package/dist/multisig.test.js +582 -58
- package/dist/multisig.test.js.map +1 -1
- package/dist/procedures.d.ts +6 -7
- package/dist/procedures.d.ts.map +1 -1
- package/dist/procedures.js +6 -7
- package/dist/procedures.js.map +1 -1
- package/dist/proposal/metadata.d.ts.map +1 -1
- package/dist/proposal/metadata.js +13 -2
- package/dist/proposal/metadata.js.map +1 -1
- package/dist/proposal/metadata.test.js +57 -0
- package/dist/proposal/metadata.test.js.map +1 -1
- package/dist/prover/errors.d.ts +5 -0
- package/dist/prover/errors.d.ts.map +1 -1
- package/dist/prover/errors.js +7 -155
- package/dist/prover/errors.js.map +1 -1
- package/dist/prover/errors.test.js +5 -0
- package/dist/prover/errors.test.js.map +1 -1
- package/dist/prover/retry.d.ts +1 -6
- package/dist/prover/retry.d.ts.map +1 -1
- package/dist/prover/retry.js +5 -28
- package/dist/prover/retry.js.map +1 -1
- package/dist/prover/retry.test.js +1 -1
- package/dist/prover/retry.test.js.map +1 -1
- package/dist/prover/workflow.d.ts +4 -3
- package/dist/prover/workflow.d.ts.map +1 -1
- package/dist/prover/workflow.js +5 -2
- package/dist/prover/workflow.js.map +1 -1
- package/dist/prover/workflow.test.js +28 -3
- package/dist/prover/workflow.test.js.map +1 -1
- package/dist/retry/classify.d.ts +16 -0
- package/dist/retry/classify.d.ts.map +1 -0
- package/dist/retry/classify.js +187 -0
- package/dist/retry/classify.js.map +1 -0
- package/dist/retry/runtime.d.ts +13 -0
- package/dist/retry/runtime.d.ts.map +1 -0
- package/dist/retry/runtime.js +33 -0
- package/dist/retry/runtime.js.map +1 -0
- package/dist/rpc/config.d.ts +11 -0
- package/dist/rpc/config.d.ts.map +1 -0
- package/dist/rpc/config.js +17 -0
- package/dist/rpc/config.js.map +1 -0
- package/dist/rpc/config.test.d.ts +2 -0
- package/dist/rpc/config.test.d.ts.map +1 -0
- package/dist/rpc/config.test.js +24 -0
- package/dist/rpc/config.test.js.map +1 -0
- package/dist/rpc/errors.d.ts +2 -0
- package/dist/rpc/errors.d.ts.map +1 -0
- package/dist/rpc/errors.js +11 -0
- package/dist/rpc/errors.js.map +1 -0
- package/dist/rpc/errors.test.d.ts +2 -0
- package/dist/rpc/errors.test.d.ts.map +1 -0
- package/dist/rpc/errors.test.js +34 -0
- package/dist/rpc/errors.test.js.map +1 -0
- package/dist/rpc/retry.d.ts +4 -0
- package/dist/rpc/retry.d.ts.map +1 -0
- package/dist/rpc/retry.js +6 -0
- package/dist/rpc/retry.js.map +1 -0
- package/dist/rpc/retry.test.d.ts +2 -0
- package/dist/rpc/retry.test.d.ts.map +1 -0
- package/dist/rpc/retry.test.js +98 -0
- package/dist/rpc/retry.test.js.map +1 -0
- package/dist/transaction/index.d.ts +1 -1
- package/dist/transaction/index.d.ts.map +1 -1
- package/dist/transaction/index.js +1 -1
- package/dist/transaction/index.js.map +1 -1
- package/dist/transaction/p2id.d.ts +17 -6
- package/dist/transaction/p2id.d.ts.map +1 -1
- package/dist/transaction/p2id.js +22 -31
- package/dist/transaction/p2id.js.map +1 -1
- package/dist/transaction/p2id.test.js +62 -24
- package/dist/transaction/p2id.test.js.map +1 -1
- package/dist/transaction/summary.d.ts +45 -2
- package/dist/transaction/summary.d.ts.map +1 -1
- package/dist/transaction/summary.js +42 -2
- package/dist/transaction/summary.js.map +1 -1
- package/dist/transaction/summary.test.d.ts +2 -0
- package/dist/transaction/summary.test.d.ts.map +1 -0
- package/dist/transaction/summary.test.js +26 -0
- package/dist/transaction/summary.test.js.map +1 -0
- package/dist/transaction/updateGuardian.d.ts.map +1 -1
- package/dist/transaction/updateGuardian.js +16 -18
- package/dist/transaction/updateGuardian.js.map +1 -1
- package/dist/transaction/updateProcedureThreshold.d.ts.map +1 -1
- package/dist/transaction/updateProcedureThreshold.js +15 -17
- package/dist/transaction/updateProcedureThreshold.js.map +1 -1
- package/dist/transaction/updateSigners.d.ts +6 -1
- package/dist/transaction/updateSigners.d.ts.map +1 -1
- package/dist/transaction/updateSigners.js +20 -17
- package/dist/transaction/updateSigners.js.map +1 -1
- package/dist/transaction.d.ts +2 -2
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +1 -1
- package/dist/transaction.js.map +1 -1
- package/dist/types/proposal.d.ts +28 -4
- package/dist/types/proposal.d.ts.map +1 -1
- package/dist/types/proposal.js +18 -0
- package/dist/types/proposal.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/signature.d.ts +11 -7
- package/dist/utils/signature.d.ts.map +1 -1
- package/dist/utils/signature.js +24 -58
- package/dist/utils/signature.js.map +1 -1
- package/dist/utils/word.d.ts +7 -0
- package/dist/utils/word.d.ts.map +1 -1
- package/dist/utils/word.js +15 -0
- package/dist/utils/word.js.map +1 -1
- package/masm/account_components/auth/guarded_multisig.masm +42 -0
- package/package.json +7 -4
- package/src/account/builder.test.ts +111 -45
- package/src/account/builder.ts +45 -33
- package/src/account/layout.ts +33 -0
- package/src/account/masm/account-components/auth.ts +36 -56
- package/src/account/masm/index.ts +0 -1
- package/src/account/storage.ts +9 -22
- package/src/client.test.ts +87 -16
- package/src/client.ts +16 -3
- package/src/index.ts +27 -1
- package/src/inspector.test.ts +330 -38
- package/src/inspector.ts +196 -33
- package/src/multisig.test.ts +680 -63
- package/src/multisig.ts +400 -115
- package/src/procedures.ts +6 -7
- package/src/proposal/metadata.test.ts +76 -0
- package/src/proposal/metadata.ts +13 -2
- package/src/prover/errors.test.ts +8 -0
- package/src/prover/errors.ts +7 -175
- package/src/prover/retry.test.ts +1 -1
- package/src/prover/retry.ts +10 -35
- package/src/prover/workflow.test.ts +40 -4
- package/src/prover/workflow.ts +16 -4
- package/src/retry/classify.ts +220 -0
- package/src/retry/runtime.ts +45 -0
- package/src/rpc/config.test.ts +45 -0
- package/src/rpc/config.ts +30 -0
- package/src/rpc/errors.test.ts +69 -0
- package/src/rpc/errors.ts +12 -0
- package/src/rpc/retry.test.ts +144 -0
- package/src/rpc/retry.ts +12 -0
- package/src/transaction/index.ts +7 -1
- package/src/transaction/p2id.test.ts +112 -31
- package/src/transaction/p2id.ts +39 -38
- package/src/transaction/summary.test.ts +32 -0
- package/src/transaction/summary.ts +83 -4
- package/src/transaction/updateGuardian.ts +15 -25
- package/src/transaction/updateProcedureThreshold.ts +13 -29
- package/src/transaction/updateSigners.ts +38 -30
- package/src/transaction.ts +8 -1
- package/src/types/proposal.ts +43 -4
- package/src/types.ts +0 -1
- package/src/utils/signature.ts +32 -65
- package/src/utils/word.ts +17 -0
- package/dist/account/masm/auth.d.ts +0 -5
- package/dist/account/masm/auth.d.ts.map +0 -1
- package/dist/account/masm/auth.js +0 -1509
- package/dist/account/masm/auth.js.map +0 -1
- package/masm/account_components/auth/multisig.masm +0 -12
- package/masm/account_components/auth/multisig_ecdsa.masm +0 -12
- package/masm/account_components/auth/multisig_guardian.masm +0 -16
- package/masm/account_components/auth/multisig_guardian_ecdsa.masm +0 -16
- package/masm/auth/guardian.masm +0 -199
- package/masm/auth/guardian_ecdsa.masm +0 -195
- package/masm/auth/multisig.masm +0 -554
- package/masm/auth/multisig_ecdsa.masm +0 -554
- package/src/account/masm/auth.ts +0 -1512
|
@@ -10,16 +10,11 @@ import {
|
|
|
10
10
|
Word,
|
|
11
11
|
Word as WordType,
|
|
12
12
|
} from '@miden-sdk/miden-sdk';
|
|
13
|
-
import {
|
|
14
|
-
MULTISIG_ECDSA_MASM,
|
|
15
|
-
MULTISIG_MASM,
|
|
16
|
-
} from '../account/masm/auth.js';
|
|
17
13
|
import { getProcedureRoot, type ProcedureName } from '../procedures.js';
|
|
18
14
|
import { compileTxScript } from '../raw-client.js';
|
|
19
15
|
import { normalizeHexWord } from '../utils/encoding.js';
|
|
20
16
|
import { randomWord } from '../utils/random.js';
|
|
21
17
|
import type { MidenClientSignatureOptions, SignatureOptions } from './options.js';
|
|
22
|
-
import type { SignatureScheme } from '../types.js';
|
|
23
18
|
|
|
24
19
|
function buildProcedureThresholdFelts(procedure: ProcedureName, threshold: number): Felt[] {
|
|
25
20
|
const procedureRoot = WordType.fromHex(normalizeHexWord(getProcedureRoot(procedure)));
|
|
@@ -32,48 +27,39 @@ function buildProcedureThresholdFelts(procedure: ProcedureName, threshold: numbe
|
|
|
32
27
|
];
|
|
33
28
|
}
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const configHash = Poseidon2.hashElements(
|
|
30
|
+
/**
|
|
31
|
+
* `set_procedure_threshold` reads its `[proc_threshold, PROC_ROOT]` inputs from the operand stack
|
|
32
|
+
* (pushed by the script), so no advice-map entry is attached; this hash is returned only for
|
|
33
|
+
* caller bookkeeping.
|
|
34
|
+
*/
|
|
35
|
+
function buildProcedureThresholdConfigHash(procedure: ProcedureName, threshold: number): Word {
|
|
36
|
+
return Poseidon2.hashElements(
|
|
43
37
|
new FeltArray(buildProcedureThresholdFelts(procedure, threshold)),
|
|
44
38
|
);
|
|
45
|
-
const payload = new FeltArray(buildProcedureThresholdFelts(procedure, threshold));
|
|
46
|
-
return { configHash, payload };
|
|
47
39
|
}
|
|
48
40
|
|
|
49
41
|
async function buildUpdateProcedureThresholdScript(
|
|
50
42
|
client: MidenClient | WasmWebClient,
|
|
51
43
|
procedure: ProcedureName,
|
|
52
44
|
threshold: number,
|
|
53
|
-
signatureScheme: SignatureScheme,
|
|
54
45
|
midenRpcEndpoint?: string,
|
|
55
46
|
): Promise<TransactionScript> {
|
|
56
|
-
const multisigMasm = signatureScheme === 'ecdsa' ? MULTISIG_ECDSA_MASM : MULTISIG_MASM;
|
|
57
47
|
const procedureRoot = normalizeHexWord(getProcedureRoot(procedure));
|
|
58
48
|
|
|
59
49
|
const scriptSource = `
|
|
60
|
-
use
|
|
50
|
+
use miden::standards::auth::multisig
|
|
61
51
|
|
|
62
|
-
|
|
52
|
+
@transaction_script
|
|
53
|
+
pub proc main
|
|
63
54
|
push.${procedureRoot}
|
|
64
55
|
push.${threshold}
|
|
65
|
-
call.multisig::
|
|
56
|
+
call.multisig::set_procedure_threshold
|
|
66
57
|
dropw
|
|
67
58
|
drop
|
|
68
59
|
end
|
|
69
60
|
`;
|
|
70
61
|
|
|
71
|
-
return compileTxScript(
|
|
72
|
-
client,
|
|
73
|
-
scriptSource,
|
|
74
|
-
[{ namespace: 'oz_multisig::multisig', code: multisigMasm }],
|
|
75
|
-
midenRpcEndpoint,
|
|
76
|
-
);
|
|
62
|
+
return compileTxScript(client, scriptSource, [], midenRpcEndpoint);
|
|
77
63
|
}
|
|
78
64
|
|
|
79
65
|
export function buildUpdateProcedureThresholdTransactionRequest(
|
|
@@ -94,14 +80,12 @@ export async function buildUpdateProcedureThresholdTransactionRequest(
|
|
|
94
80
|
threshold: number,
|
|
95
81
|
options: SignatureOptions = {},
|
|
96
82
|
): Promise<{ request: TransactionRequest; salt: Word; configHash: Word }> {
|
|
97
|
-
const
|
|
98
|
-
const { configHash } = buildProcedureThresholdAdvice(procedure, threshold);
|
|
83
|
+
const configHash = buildProcedureThresholdConfigHash(procedure, threshold);
|
|
99
84
|
|
|
100
85
|
const script = await buildUpdateProcedureThresholdScript(
|
|
101
86
|
client,
|
|
102
87
|
procedure,
|
|
103
88
|
threshold,
|
|
104
|
-
signatureScheme,
|
|
105
89
|
options.midenRpcEndpoint,
|
|
106
90
|
);
|
|
107
91
|
const authSaltHex = options.salt ? options.salt.toHex() : randomWord().toHex();
|
|
@@ -11,66 +11,66 @@ import {
|
|
|
11
11
|
Word,
|
|
12
12
|
Word as WordType,
|
|
13
13
|
} from '@miden-sdk/miden-sdk';
|
|
14
|
-
import {
|
|
15
|
-
MULTISIG_ECDSA_MASM,
|
|
16
|
-
MULTISIG_MASM,
|
|
17
|
-
} from '../account/masm/auth.js';
|
|
18
14
|
import { compileTxScript } from '../raw-client.js';
|
|
19
15
|
import { normalizeHexWord } from '../utils/encoding.js';
|
|
20
16
|
import { randomWord } from '../utils/random.js';
|
|
17
|
+
import { authSchemeId } from '../utils/signature.js';
|
|
21
18
|
import type { MidenClientSignatureOptions, SignatureOptions } from './options.js';
|
|
22
19
|
import type { SignatureScheme } from '../types.js';
|
|
23
20
|
|
|
24
|
-
function buildMultisigConfigFelts(
|
|
21
|
+
function buildMultisigConfigFelts(
|
|
22
|
+
threshold: number,
|
|
23
|
+
signerCommitments: string[],
|
|
24
|
+
signatureScheme: SignatureScheme,
|
|
25
|
+
): Felt[] {
|
|
25
26
|
const numApprovers = signerCommitments.length;
|
|
27
|
+
const schemeId = authSchemeId(signatureScheme);
|
|
26
28
|
const felts: Felt[] = [
|
|
27
29
|
new Felt(BigInt(threshold)),
|
|
28
30
|
new Felt(BigInt(numApprovers)),
|
|
29
31
|
new Felt(0n),
|
|
30
32
|
new Felt(0n),
|
|
31
33
|
];
|
|
34
|
+
// Interleave [PUB_KEY, SCHEME_ID] per approver, in reverse index order.
|
|
32
35
|
for (const commitment of [...signerCommitments].reverse()) {
|
|
33
36
|
const word = WordType.fromHex(normalizeHexWord(commitment));
|
|
34
37
|
felts.push(...word.toFelts());
|
|
38
|
+
felts.push(new Felt(BigInt(schemeId)), new Felt(0n), new Felt(0n), new Felt(0n));
|
|
35
39
|
}
|
|
36
40
|
return felts;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
function buildMultisigConfigAdvice(
|
|
43
|
+
export function buildMultisigConfigAdvice(
|
|
40
44
|
threshold: number,
|
|
41
45
|
signerCommitments: string[],
|
|
46
|
+
signatureScheme: SignatureScheme,
|
|
42
47
|
): { configHash: Word; payload: FeltArray } {
|
|
43
|
-
// `Poseidon2.hashElements` consumes (frees) its `FeltArray` by value, so the
|
|
44
|
-
//
|
|
45
|
-
//
|
|
48
|
+
// `Poseidon2.hashElements` consumes (frees) its `FeltArray` by value, so the advice payload
|
|
49
|
+
// must be a separately built array — reusing the hashed array surfaces as "null pointer
|
|
50
|
+
// passed to rust" at the later `advice.insert`.
|
|
46
51
|
const configHash = Poseidon2.hashElements(
|
|
47
|
-
new FeltArray(buildMultisigConfigFelts(threshold, signerCommitments)),
|
|
52
|
+
new FeltArray(buildMultisigConfigFelts(threshold, signerCommitments, signatureScheme)),
|
|
53
|
+
);
|
|
54
|
+
const payload = new FeltArray(
|
|
55
|
+
buildMultisigConfigFelts(threshold, signerCommitments, signatureScheme),
|
|
48
56
|
);
|
|
49
|
-
const payload = new FeltArray(buildMultisigConfigFelts(threshold, signerCommitments));
|
|
50
57
|
return { configHash, payload };
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
async function buildUpdateSignersScript(
|
|
54
61
|
client: MidenClient | WasmWebClient,
|
|
55
|
-
signatureScheme: SignatureScheme,
|
|
56
62
|
midenRpcEndpoint?: string,
|
|
57
63
|
): Promise<TransactionScript> {
|
|
58
|
-
const multisigMasm = signatureScheme === 'ecdsa' ? MULTISIG_ECDSA_MASM : MULTISIG_MASM;
|
|
59
|
-
|
|
60
64
|
const scriptSource = `
|
|
61
|
-
use
|
|
65
|
+
use miden::standards::auth::multisig
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
@transaction_script
|
|
68
|
+
pub proc main
|
|
64
69
|
call.multisig::update_signers_and_threshold
|
|
65
70
|
end
|
|
66
71
|
`;
|
|
67
72
|
|
|
68
|
-
return compileTxScript(
|
|
69
|
-
client,
|
|
70
|
-
scriptSource,
|
|
71
|
-
[{ namespace: 'oz_multisig::multisig', code: multisigMasm }],
|
|
72
|
-
midenRpcEndpoint,
|
|
73
|
-
);
|
|
73
|
+
return compileTxScript(client, scriptSource, [], midenRpcEndpoint);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export function buildUpdateSignersTransactionRequest(
|
|
@@ -92,20 +92,28 @@ export async function buildUpdateSignersTransactionRequest(
|
|
|
92
92
|
options: SignatureOptions = {},
|
|
93
93
|
): Promise<{ request: TransactionRequest; salt: Word; configHash: Word }> {
|
|
94
94
|
const signatureScheme = options.signatureScheme ?? 'falcon';
|
|
95
|
-
const { configHash: configHashForAdvice, payload } = buildMultisigConfigAdvice(
|
|
95
|
+
const { configHash: configHashForAdvice, payload } = buildMultisigConfigAdvice(
|
|
96
|
+
threshold,
|
|
97
|
+
signerCommitments,
|
|
98
|
+
signatureScheme,
|
|
99
|
+
);
|
|
96
100
|
|
|
97
|
-
const { configHash: configHashForScript } = buildMultisigConfigAdvice(
|
|
101
|
+
const { configHash: configHashForScript } = buildMultisigConfigAdvice(
|
|
102
|
+
threshold,
|
|
103
|
+
signerCommitments,
|
|
104
|
+
signatureScheme,
|
|
105
|
+
);
|
|
98
106
|
|
|
99
|
-
const { configHash: configHashForReturn } = buildMultisigConfigAdvice(
|
|
107
|
+
const { configHash: configHashForReturn } = buildMultisigConfigAdvice(
|
|
108
|
+
threshold,
|
|
109
|
+
signerCommitments,
|
|
110
|
+
signatureScheme,
|
|
111
|
+
);
|
|
100
112
|
|
|
101
113
|
const advice = new AdviceMap();
|
|
102
114
|
advice.insert(configHashForAdvice, payload);
|
|
103
115
|
|
|
104
|
-
const script = await buildUpdateSignersScript(
|
|
105
|
-
client,
|
|
106
|
-
signatureScheme,
|
|
107
|
-
options.midenRpcEndpoint,
|
|
108
|
-
);
|
|
116
|
+
const script = await buildUpdateSignersScript(client, options.midenRpcEndpoint);
|
|
109
117
|
|
|
110
118
|
const authSaltHex = options.salt ? options.salt.toHex() : randomWord().toHex();
|
|
111
119
|
|
package/src/transaction.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export {
|
|
2
2
|
buildConsumeNotesTransactionRequest,
|
|
3
3
|
} from './transaction/consumeNotes.js';
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
chainAnchorFromBase64,
|
|
6
|
+
chainAnchorToBase64,
|
|
7
|
+
executeForSummary,
|
|
8
|
+
executeForSummaryAt,
|
|
9
|
+
summarySalt,
|
|
10
|
+
} from './transaction/summary.js';
|
|
5
11
|
export {
|
|
6
12
|
buildP2idNoteFromMetadata,
|
|
7
13
|
buildP2idTransactionRequest,
|
|
8
14
|
parseP2idNoteType,
|
|
9
15
|
p2idNoteTypeToMetadata,
|
|
10
16
|
type P2idTransactionOptions,
|
|
17
|
+
type P2ideHeightOptions,
|
|
11
18
|
} from './transaction/p2id.js';
|
|
12
19
|
export {
|
|
13
20
|
buildUpdateGuardianTransactionRequest,
|
package/src/types/proposal.ts
CHANGED
|
@@ -37,6 +37,14 @@ interface BaseProposalMetadata {
|
|
|
37
37
|
description: string;
|
|
38
38
|
saltHex?: string;
|
|
39
39
|
requiredSignatures?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Base64-serialized Miden `ChainAnchor` pinning the reference block the
|
|
42
|
+
* proposal's transaction summary was built at. Required to verify or
|
|
43
|
+
* execute the proposal: since protocol 0.16 the signed summary binds the
|
|
44
|
+
* reference block commitment, so it only reproduces when re-executed at
|
|
45
|
+
* that block.
|
|
46
|
+
*/
|
|
47
|
+
chainAnchor?: string;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
export interface UpdateSignersProposalMetadata extends BaseProposalMetadata {
|
|
@@ -89,6 +97,31 @@ export function isP2idNoteVisibility(value: string): value is P2idNoteVisibility
|
|
|
89
97
|
return value === 'public' || value === 'private';
|
|
90
98
|
}
|
|
91
99
|
|
|
100
|
+
/** Maximum P2IDE block height: heights are `u32` on-chain (`BlockNumber`). */
|
|
101
|
+
export const MAX_P2IDE_BLOCK_HEIGHT = 0xffff_ffff;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Validates a P2IDE reclaim/timelock height (issue #366). Heights are `u32`
|
|
105
|
+
* block numbers; `0` is rejected because it is the on-chain encoding for "no
|
|
106
|
+
* constraint", so accepting it would silently build an unconstrained note.
|
|
107
|
+
* An invalid value throws rather than being dropped, which would rebuild a
|
|
108
|
+
* note that could never match the signed tx_summary commitment.
|
|
109
|
+
*/
|
|
110
|
+
export function parseP2ideHeight(
|
|
111
|
+
field: 'reclaimHeight' | 'timelockHeight',
|
|
112
|
+
value: number | undefined,
|
|
113
|
+
): number | undefined {
|
|
114
|
+
if (value === undefined) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
if (!Number.isInteger(value) || value < 1 || value > MAX_P2IDE_BLOCK_HEIGHT) {
|
|
118
|
+
throw new Error(
|
|
119
|
+
`unsupported ${field} '${value}': expected an integer between 1 and ${MAX_P2IDE_BLOCK_HEIGHT}`,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
|
|
92
125
|
export interface P2IdProposalMetadata extends BaseProposalMetadata {
|
|
93
126
|
proposalType: 'p2id';
|
|
94
127
|
recipientId: string;
|
|
@@ -96,14 +129,20 @@ export interface P2IdProposalMetadata extends BaseProposalMetadata {
|
|
|
96
129
|
amount: string;
|
|
97
130
|
/** Visibility of the created note. Absent on the wire => 'public' (pre-#322 proposals). */
|
|
98
131
|
noteType?: P2idNoteVisibility;
|
|
132
|
+
/**
|
|
133
|
+
* Absolute block height at which the sender may reclaim the note (issue
|
|
134
|
+
* #366). Presence of either height means the proposal creates a P2IDE note
|
|
135
|
+
* instead of a plain P2ID note; both absent => plain P2ID (pre-#366
|
|
136
|
+
* proposals).
|
|
137
|
+
*/
|
|
138
|
+
reclaimHeight?: number;
|
|
139
|
+
/** Absolute block height before which the note cannot be consumed. */
|
|
140
|
+
timelockHeight?: number;
|
|
99
141
|
}
|
|
100
142
|
|
|
101
143
|
export interface CustomProposalMetadata extends BaseProposalMetadata {
|
|
102
144
|
proposalType: 'custom';
|
|
103
|
-
/** Original server-defined proposal label,
|
|
104
|
-
* Rust `ProposalMetadata.proposal_type`; it is what lets a custom proposal
|
|
105
|
-
* round-trip back to GUARDIAN/export, so it is required in the domain model.
|
|
106
|
-
* Any wire-level optionality is resolved in the parser/codec boundary. */
|
|
145
|
+
/** Original server-defined proposal label, preserved during round trips. */
|
|
107
146
|
rawProposalType: string;
|
|
108
147
|
}
|
|
109
148
|
|
package/src/types.ts
CHANGED
|
@@ -80,7 +80,6 @@ export interface MultisigConfig {
|
|
|
80
80
|
signerCommitments: string[];
|
|
81
81
|
guardianCommitment: string;
|
|
82
82
|
guardianPublicKey?: string;
|
|
83
|
-
guardianEnabled?: boolean;
|
|
84
83
|
storageMode?: 'private' | 'public';
|
|
85
84
|
procedureThresholds?: ProcedureThreshold[];
|
|
86
85
|
signatureScheme?: SignatureScheme;
|
package/src/utils/signature.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { AdviceMap, Felt, FeltArray, Poseidon2, Signature, Word } from '@miden-sdk/miden-sdk';
|
|
2
2
|
import * as midenSdk from '@miden-sdk/miden-sdk';
|
|
3
|
+
import { EcdsaFormat } from './ecdsa.js';
|
|
3
4
|
import { hexToBytes, normalizeHexWord } from './encoding.js';
|
|
4
5
|
import type { ProposalSignatureEntry, SignatureScheme } from '../types.js';
|
|
5
6
|
|
|
6
7
|
export const ECDSA_AUTH_SCHEME_ID = 1;
|
|
7
8
|
export const FALCON_AUTH_SCHEME_ID = 2;
|
|
8
9
|
|
|
9
|
-
function authSchemeId(scheme: SignatureScheme): number {
|
|
10
|
+
export function authSchemeId(scheme: SignatureScheme): number {
|
|
10
11
|
return scheme === 'ecdsa' ? ECDSA_AUTH_SCHEME_ID : FALCON_AUTH_SCHEME_ID;
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -21,31 +22,17 @@ export function signatureHexToBytes(
|
|
|
21
22
|
return withPrefix;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
felts.push(new Felt(BigInt(packed >>> 0)));
|
|
32
|
-
}
|
|
33
|
-
return felts;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function encodeEcdsaSignatureFelts(pubkeyBytes: Uint8Array, sigBytes: Uint8Array): Felt[] {
|
|
37
|
-
const pkFelts = bytesToPackedU32Felts(pubkeyBytes);
|
|
38
|
-
const sigFelts = bytesToPackedU32Felts(sigBytes);
|
|
39
|
-
return [...pkFelts, ...sigFelts];
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
25
|
+
/**
|
|
26
|
+
* `toPreparedSignature` is the SDK binding for the Rust
|
|
27
|
+
* `Signature::to_encoded_signature`, so both Falcon and ECDSA advice payloads
|
|
28
|
+
* come from upstream rather than being packed here. For ECDSA it emits
|
|
29
|
+
* `QX[8] || QY[8] || SIG_R[8] || SIG_S[8]` and recovers the public key from the
|
|
30
|
+
* message, which is why the signature must carry its recovery byte.
|
|
31
|
+
*/
|
|
43
32
|
export function buildSignatureAdviceEntry(
|
|
44
33
|
pubkeyCommitment: Word,
|
|
45
34
|
message: Word,
|
|
46
35
|
signature: Signature,
|
|
47
|
-
ecdsaPubkeyHex?: string,
|
|
48
|
-
ecdsaSigHex?: string,
|
|
49
36
|
): { key: Word; values: Felt[] } {
|
|
50
37
|
const elements = new FeltArray([
|
|
51
38
|
...pubkeyCommitment.toFelts(),
|
|
@@ -53,16 +40,31 @@ export function buildSignatureAdviceEntry(
|
|
|
53
40
|
]);
|
|
54
41
|
const key = Poseidon2.hashElements(elements);
|
|
55
42
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
return { key, values: signature.toPreparedSignature(message) };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Rejects unrecoverable ECDSA signatures before entering WASM. */
|
|
47
|
+
export function assertEcdsaSignatureRecoverable(
|
|
48
|
+
signatureHex: string,
|
|
49
|
+
messageHex: string,
|
|
50
|
+
expectedPublicKeyHex: string,
|
|
51
|
+
): void {
|
|
52
|
+
let recovered: string;
|
|
53
|
+
try {
|
|
54
|
+
recovered = EcdsaFormat.recoverCompressedPublicKeyHex(
|
|
55
|
+
hexToBytes(messageHex),
|
|
56
|
+
hexToBytes(signatureHex),
|
|
57
|
+
);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
throw new Error(`ECDSA signature does not recover a public key: ${String(error)}`);
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
|
|
62
|
+
const expected = EcdsaFormat.compressPublicKey(expectedPublicKeyHex);
|
|
63
|
+
if (recovered.toLowerCase() !== expected.toLowerCase()) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`ECDSA signature recovers public key ${recovered}, which does not match the expected ${expected}`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export function tryComputeEcdsaCommitmentHex(pubkeyHex: string): string | null {
|
|
@@ -87,41 +89,6 @@ export function tryComputeCommitmentHex(
|
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
export function verifyEcdsaCommitment(
|
|
91
|
-
pubkeyHex: string,
|
|
92
|
-
expectedCommitmentHex: string,
|
|
93
|
-
): { match: boolean; computedHex: string; packedFelts: string[]; error?: string } {
|
|
94
|
-
try {
|
|
95
|
-
const bytes = hexToBytes(pubkeyHex);
|
|
96
|
-
const packedU32Values: number[] = [];
|
|
97
|
-
for (let i = 0; i < bytes.length; i += 4) {
|
|
98
|
-
let packed = 0;
|
|
99
|
-
for (let j = 0; j < 4 && i + j < bytes.length; j += 1) {
|
|
100
|
-
packed |= bytes[i + j] << (j * 8);
|
|
101
|
-
}
|
|
102
|
-
packedU32Values.push(packed >>> 0);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const packedFelts = bytesToPackedU32Felts(bytes);
|
|
106
|
-
const feltArray = new FeltArray(packedFelts);
|
|
107
|
-
const computed = Poseidon2.hashElements(feltArray);
|
|
108
|
-
const computedHex = normalizeHexWord(computed.toHex());
|
|
109
|
-
const expectedNorm = normalizeHexWord(expectedCommitmentHex);
|
|
110
|
-
return {
|
|
111
|
-
match: computedHex === expectedNorm,
|
|
112
|
-
computedHex,
|
|
113
|
-
packedFelts: packedU32Values.map((value) => value.toString()),
|
|
114
|
-
};
|
|
115
|
-
} catch (error) {
|
|
116
|
-
return {
|
|
117
|
-
match: false,
|
|
118
|
-
computedHex: `ERROR: ${error}`,
|
|
119
|
-
packedFelts: [],
|
|
120
|
-
error: String(error),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
92
|
export function mergeSignatureAdviceMaps(
|
|
126
93
|
advice: AdviceMap,
|
|
127
94
|
entries: Array<{ key: Word; values: Felt[] }>,
|
package/src/utils/word.ts
CHANGED
|
@@ -15,6 +15,23 @@ export function wordElementToBigInt(word: Word, index: number): bigint {
|
|
|
15
15
|
return index < elements.length ? elements[index] : 0n;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* True when every element of the word is zero. The SDK's storage-map reads
|
|
20
|
+
* return `Word::empty()` for a key with no entry (`StorageMap::get` is
|
|
21
|
+
* `unwrap_or_default()` in miden-protocol), so readers use this to detect
|
|
22
|
+
* absent entries.
|
|
23
|
+
*/
|
|
24
|
+
export function isEmptyWord(word: Word): boolean {
|
|
25
|
+
const elements: BigUint64Array | bigint[] =
|
|
26
|
+
typeof word.toU64s === 'function' ? word.toU64s() : word.toFelts().map(f => f.asInt());
|
|
27
|
+
for (const element of elements) {
|
|
28
|
+
if (element !== 0n) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
18
35
|
export function wordToBytes(word: { toFelts: () => Array<{ asInt: () => bigint }> }): Uint8Array {
|
|
19
36
|
const felts = word.toFelts();
|
|
20
37
|
const buf = new Uint8Array(32);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const MULTISIG_MASM = "# Multi-Signature RPO Falcon 512 Authentication Core Library\n#\n# This library provides the reusable multisig procedures used by account wrappers.\n\nuse miden::protocol::active_account\nuse miden::protocol::auth::AUTH_UNAUTHORIZED_EVENT\nuse miden::protocol::native_account\nuse miden::standards::auth\n\n# CONSTANTS\n# =================================================================================================\n\n# Auth Request Constants\n\n# Storage Layout Constants\n#\n# +-------------------------------+----------+------------+--------------+-------------------+\n# | THRESHOLD & APPROVERS CONFIG | PUB KEYS | SCHEME IDS | EXECUTED TXS | PROC THRESHOLDS |\n# | (slot) | (map) | (map) | (map) | (map) |\n# +-------------------------------+----------+------------+--------------+-------------------+\n# | 0 | 1 | 2 | 3 | 4 |\n# +-------------------------------+----------+------------+--------------+-------------------+\n\n# The slot in this component's storage layout where the default signature threshold and\n# number of approvers are stored as:\n# [default_threshold, num_approvers, 0, 0].\n# The threshold is guaranteed to be less than or equal to num_approvers.\nconst THRESHOLD_CONFIG_SLOT=word(\"openzeppelin::multisig::threshold_config\")\n\n# The slot in this component's storage layout where the public keys map is stored.\n# Map entries: [key_index, 0, 0, 0] => APPROVER_PUBLIC_KEY\nconst PUBLIC_KEYS_MAP_SLOT=word(\"openzeppelin::multisig::signer_public_keys\")\n\n# The slot in this component's storage layout where signer scheme IDs are stored.\n# Map entries: [key_index, 0, 0, 0] => [scheme_id, 0, 0, 0]\nconst APPROVER_SCHEME_ID_SLOT=word(\"openzeppelin::multisig::signer_scheme_ids\")\n\n# The slot in this component's storage layout where executed transactions are stored.\n# Map entries: transaction_message => [is_executed, 0, 0, 0]\nconst EXECUTED_TXS_SLOT=word(\"openzeppelin::multisig::executed_transactions\")\n\n# The slot in this component's storage layout where procedure thresholds are stored.\n# Map entries: PROC_ROOT => [proc_threshold, 0, 0, 0]\nconst PROC_THRESHOLD_ROOTS_SLOT=word(\"openzeppelin::multisig::procedure_thresholds\")\n\n# Executed Transaction Flag Constant\nconst IS_EXECUTED_FLAG=[1, 0, 0, 0]\nconst FALCON_512_POSEIDON2_SCHEME_WORD=[2, 0, 0, 0]\n\n# ERRORS\nconst ERR_TX_ALREADY_EXECUTED=\"failed to approve multisig transaction as it was already executed\"\n\nconst ERR_MALFORMED_MULTISIG_CONFIG=\"number of approvers must be equal to or greater than threshold\"\n\nconst ERR_ZERO_IN_MULTISIG_CONFIG=\"number of approvers or threshold must not be zero\"\n\nconst ERR_PROC_THRESHOLD_NOT_U32=\"procedure threshold must be a u32 value\"\n\nconst ERR_NUM_APPROVERS_OR_PROC_THRESHOLD_NOT_U32=\"number of approvers and procedure threshold must be u32\"\n\nconst ERR_PROC_THRESHOLD_EXCEEDS_NUM_APPROVERS=\"procedure threshold exceeds number of approvers\"\n\n# MULTISIG PROCEDURES\n# =================================================================================================\n\n#! Check if transaction has already been executed and add it to executed transactions for replay protection.\n#!\n#! Inputs: [MSG]\n#! Outputs: []\n#!\n#! Panics if:\n#! - the same transaction has already been executed\npub proc assert_new_tx(msg: word)\n push.IS_EXECUTED_FLAG\n # => [[0, 0, 0, is_executed], MSG]\n\n swapw\n # => [MSG, IS_EXECUTED_FLAG]\n\n push.EXECUTED_TXS_SLOT[0..2]\n # => [txs_slot_prefix, txs_slot_suffix, MSG, IS_EXECUTED_FLAG]\n\n # Set the key value pair in the map to mark transaction as executed\n exec.native_account::set_map_item\n # => [[0, 0, 0, is_executed]]\n\n drop drop drop\n # => [is_executed]\n\n assertz.err=ERR_TX_ALREADY_EXECUTED\n # => []\nend\n\n#! Remove old approver public keys from the approver public key mapping.\n#!\n#! This procedure cleans up the storage by removing public keys of approvers that are no longer\n#! part of the multisig configuration. This procedure assumes that init_num_of_approvers and\n#! new_num_of_approvers are u32 values.\n#!\n#! Inputs: [init_num_of_approvers, new_num_of_approvers]\n#! Outputs: []\n#!\n#! Where:\n#! - init_num_of_approvers is the original number of approvers before the update\n#! - new_num_of_approvers is the new number of approvers after the update\nproc cleanup_pubkey_mapping(init_num_of_approvers: u32, new_num_of_approvers: u32)\n dup.1 dup.1\n u32assert2 u32lt\n # => [should_loop, i = init_num_of_approvers, new_num_of_approvers]\n\n while.true\n # => [i, new_num_of_approvers]\n\n sub.1\n # => [i-1, new_num_of_approvers]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, new_num_of_approvers]\n\n padw swapw\n # => [APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n push.PUBLIC_KEYS_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE, i-1, new_num_of_approvers]\n\n dropw\n # => [i-1, new_num_of_approvers]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, new_num_of_approvers]\n\n padw swapw\n # => [APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n push.APPROVER_SCHEME_ID_SLOT[0..2]\n # => [scheme_slot_prefix, scheme_slot_suffix, APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE, i-1, new_num_of_approvers]\n\n dropw\n # => [i-1, new_num_of_approvers]\n\n dup.1 dup.1\n u32lt\n # => [should_loop, i-1, new_num_of_approvers]\n end\n\n drop drop\n # => []\nend\n\nproc create_approver_map_key\n push.0.0.0 movup.3\n # => [APPROVER_MAP_KEY]\nend\n\nproc get_threshold_and_num_approvers\n push.THRESHOLD_CONFIG_SLOT[0..2]\n exec.active_account::get_initial_item\n # => [threshold, num_approvers]\n\n movup.2 drop movup.2 drop\n # => [threshold, num_approvers]\nend\n\nproc assert_proc_thresholds_lte_num_approvers(num_approvers: u32)\n exec.active_account::get_num_procedures\n # => [num_procedures, num_approvers]\n\n dup neq.0\n # => [should_continue, num_procedures, num_approvers]\n while.true\n sub.1 dup\n # => [proc_index, proc_index, num_approvers]\n\n exec.active_account::get_procedure_root\n # => [PROC_ROOT, proc_index, num_approvers]\n\n push.PROC_THRESHOLD_ROOTS_SLOT[0..2]\n # => [proc_roots_slot_prefix, proc_roots_slot_suffix, PROC_ROOT, proc_index, num_approvers]\n\n exec.active_account::get_map_item\n # => [[proc_threshold, 0, 0, 0], proc_index, num_approvers]\n\n movdn.3 drop drop drop\n # => [proc_threshold, proc_index, num_approvers]\n\n dup.2\n # => [num_approvers, proc_threshold, proc_index, num_approvers]\n\n u32assert2.err=ERR_PROC_THRESHOLD_NOT_U32\n u32gt assertz.err=ERR_PROC_THRESHOLD_EXCEEDS_NUM_APPROVERS\n # => [proc_index, num_approvers]\n\n dup neq.0\n # => [should_continue, proc_index, num_approvers]\n end\n\n drop drop\n # => []\nend\n\n# Internal storage helper used by the public `update_procedure_threshold`\n# entrypoint after it receives direct stack arguments.\nproc set_procedure_threshold(proc_threshold: u32, proc_root: word)\n exec.get_threshold_and_num_approvers\n # => [threshold, num_approvers, proc_threshold, PROC_ROOT]\n\n drop\n # => [num_approvers, proc_threshold, PROC_ROOT]\n\n dup.1 swap\n # => [num_approvers, proc_threshold, proc_threshold, PROC_ROOT]\n\n u32assert2.err=ERR_NUM_APPROVERS_OR_PROC_THRESHOLD_NOT_U32\n u32gt assertz.err=ERR_PROC_THRESHOLD_EXCEEDS_NUM_APPROVERS\n # => [proc_threshold, PROC_ROOT]\n\n push.0.0.0\n movup.3\n swapw\n # => [PROC_ROOT, PROC_THRESHOLD_WORD]\n\n push.PROC_THRESHOLD_ROOTS_SLOT[0..2]\n # => [proc_roots_slot_prefix, proc_roots_slot_suffix, PROC_ROOT, PROC_THRESHOLD_WORD]\n\n exec.native_account::set_map_item\n # => [OLD_VALUE]\n\n dropw\n # => []\nend\n\n#! Update threshold config and add / remove approvers\n#!\n#! Inputs:\n#! Operand stack: [MULTISIG_CONFIG_HASH, pad(12)]\n#! Advice map: {\n#! MULTISIG_CONFIG_HASH => [CONFIG, PUB_KEY_N, PUB_KEY_N-1, ..., PUB_KEY_0]\n#! }\n#! Outputs:\n#! Operand stack: [TX_SUMMARY_COMMITMENT]\n#!\n#! Where:\n#! - MULTISIG_CONFIG_HASH is the hash of the threshold and new public key vector\n#! - MULTISIG_CONFIG is [threshold, num_approvers, 0, 0]\n#! - PUB_KEY_i is the public key of the i-th signer\n#!\n#! Locals:\n#! 0: new_num_of_approvers\n#! 1: init_num_of_approvers\n@locals(2)\npub proc update_signers_and_threshold(multisig_config_hash: word)\n adv.push_mapval\n # => [MULTISIG_CONFIG_HASH, pad(12)]\n\n adv_loadw\n # => [MULTISIG_CONFIG, pad(12)]\n\n # store new_num_of_approvers for later\n dup.1 loc_store.0\n # => [MULTISIG_CONFIG, pad(12)]\n\n dup dup.2\n # => [num_approvers, threshold, MULTISIG_CONFIG, pad(12)]\n\n # make sure that the threshold is smaller than the number of approvers\n u32assert2.err=ERR_MALFORMED_MULTISIG_CONFIG\n u32gt assertz.err=ERR_MALFORMED_MULTISIG_CONFIG\n # => [MULTISIG_CONFIG, pad(12)]\n\n dup dup.2\n # => [num_approvers, threshold, MULTISIG_CONFIG, pad(12)]\n\n # make sure that threshold or num_approvers are not zero\n eq.0 assertz.err=ERR_ZERO_IN_MULTISIG_CONFIG\n eq.0 assertz.err=ERR_ZERO_IN_MULTISIG_CONFIG\n # => [MULTISIG_CONFIG, pad(12)]\n\n loc_load.0\n # => [num_approvers, MULTISIG_CONFIG, pad(12)]\n\n exec.assert_proc_thresholds_lte_num_approvers\n # => [MULTISIG_CONFIG, pad(12)]\n\n push.THRESHOLD_CONFIG_SLOT[0..2]\n # => [config_slot_prefix, config_slot_suffix, MULTISIG_CONFIG, pad(12)]\n\n exec.native_account::set_item\n # => [OLD_THRESHOLD_CONFIG, pad(12)]\n\n # store init_num_of_approvers for later\n drop loc_store.1 drop drop\n # => [pad(12)]\n\n loc_load.0\n # => [num_approvers]\n\n dup neq.0\n while.true\n sub.1\n # => [i-1, pad(12)]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, pad(12)]\n\n padw adv_loadw\n # => [PUB_KEY, APPROVER_MAP_KEY, i-1, pad(12)]\n\n swapw\n # => [APPROVER_MAP_KEY, PUB_KEY, i-1, pad(12)]\n\n push.PUBLIC_KEYS_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, APPROVER_MAP_KEY, PUB_KEY, i-1, pad(12)]\n\n exec.native_account::set_map_item\n # => [OLD_VALUE, i-1, pad(12)]\n\n dropw\n # => [i-1, pad(12)]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, pad(12)]\n\n push.FALCON_512_POSEIDON2_SCHEME_WORD\n # => [SCHEME_ID_WORD, APPROVER_MAP_KEY, i-1, pad(12)]\n\n swapw\n # => [APPROVER_MAP_KEY, [2, 0, 0, 0], i-1, pad(12)]\n\n push.APPROVER_SCHEME_ID_SLOT[0..2]\n # => [scheme_slot_prefix, scheme_slot_suffix, APPROVER_MAP_KEY, [2, 0, 0, 0], i-1, pad(12)]\n\n exec.native_account::set_map_item\n # => [OLD_VALUE, i-1, pad(12)]\n\n dropw\n # => [i-1, pad(12)]\n\n dup neq.0\n # => [is_non_zero, i-1, pad(12)]\n end\n # => [pad(13)]\n\n drop\n # => [pad(12)]\n\n loc_load.0 loc_load.1\n # => [init_num_of_approvers, new_num_of_approvers, pad(12)]\n\n dup.1 dup.1\n u32assert2 u32lt\n # => [should_cleanup, init_num_of_approvers, new_num_of_approvers, pad(12)]\n\n if.true\n exec.cleanup_pubkey_mapping\n # => [pad(12)]\n else\n drop drop\n # => [pad(12)]\n end\nend\n\n#! Update or clear the threshold override for a specific procedure.\n#!\n#! Inputs:\n#! Operand stack: [proc_threshold, PROC_ROOT]\n#! Outputs:\n#! Operand stack: []\n#! Invocation: call\npub proc update_procedure_threshold(proc_threshold: u32, proc_root: word)\n exec.set_procedure_threshold\nend\n\n# Computes the effective transaction threshold based on called procedures and per-procedure\n# overrides stored in PROC_THRESHOLD_ROOTS_SLOT. Falls back to default_threshold if no\n# overrides apply.\n#\n#! Inputs: [default_threshold]\n#! Outputs: [transaction_threshold]\n@locals(1)\nproc compute_transaction_threshold(default_threshold: u32) -> u32\n # 1. initialize transaction_threshold = 0\n # 2. iterate through all account procedures\n # a. check if the procedure was called during the transaction\n # b. if called, get the override threshold of that procedure from the config map\n # c. if proc_threshold > transaction_threshold, set transaction_threshold = proc_threshold\n # 3. if transaction_threshold == 0 at the end, revert to using default_threshold\n\n # store default_threshold for later\n loc_store.0\n # => []\n\n # 1. initialize transaction_threshold = 0\n push.0\n # => [transaction_threshold]\n\n # get the number of account procedures\n exec.active_account::get_num_procedures\n # => [num_procedures, transaction_threshold]\n\n # 2. iterate through all account procedures\n dup neq.0\n # => [should_continue, num_procedures, transaction_threshold]\n while.true\n sub.1 dup\n # => [num_procedures-1, num_procedures-1, transaction_threshold]\n\n # get procedure root of the procedure with index i\n exec.active_account::get_procedure_root dupw\n # => [PROC_ROOT, PROC_ROOT, num_procedures-1, transaction_threshold]\n\n # 2a. check if this procedure has been called in the transaction\n exec.native_account::was_procedure_called\n # => [was_called, PROC_ROOT, num_procedures-1, transaction_threshold]\n\n # if it has been called, get the override threshold of that procedure\n if.true\n # => [PROC_ROOT, num_procedures-1, transaction_threshold]\n\n push.PROC_THRESHOLD_ROOTS_SLOT[0..2]\n # => [PROC_THRESHOLD_ROOTS_SLOT_prefix, PROC_THRESHOLD_ROOTS_SLOT_suffix, PROC_ROOT, num_procedures-1, transaction_threshold]\n\n # 2b. get the override proc_threshold of that procedure\n # if the procedure has no override threshold, the returned map item will be [0, 0, 0, 0]\n exec.active_account::get_initial_map_item\n # => [[proc_threshold, 0, 0, 0], num_procedures-1, transaction_threshold]\n\n movdn.3 drop drop drop dup dup.3\n # => [transaction_threshold, proc_threshold, proc_threshold, num_procedures-1, transaction_threshold]\n\n u32assert2.err=\"transaction threshold or procedure threshold are not u32\"\n u32gt\n # => [is_gt, proc_threshold, num_procedures-1, transaction_threshold]\n # 2c. if proc_threshold > transaction_threshold, update transaction_threshold\n movup.2 movdn.3\n # => [is_gt, proc_threshold, transaction_threshold, num_procedures-1]\n cdrop\n # => [updated_transaction_threshold, num_procedures-1]\n swap\n # => [num_procedures-1, updated_transaction_threshold]\n # if it has not been called during this transaction, nothing to do, move to the next procedure\n else\n dropw\n # => [num_procedures-1, transaction_threshold]\n end\n\n dup neq.0\n # => [should_continue, num_procedures-1, transaction_threshold]\n end\n\n drop\n # => [transaction_threshold]\n\n loc_load.0\n # => [default_threshold, transaction_threshold]\n\n # 3. if transaction_threshold == 0 at the end, revert to using default_threshold\n dup.1 eq.0\n # => [is_zero, default_threshold, transaction_threshold]\n\n cdrop\n # => [effective_transaction_threshold]\nend\n\n#! Authenticate a transaction using the Falcon signature scheme with multi-signature support.\n#!\n#! This procedure implements multi-signature authentication by:\n#! 1. Computing the transaction summary message that needs to be signed\n#! 2. Verifying signatures from multiple required signers against their public keys\n#! 3. Ensuring the minimum threshold of valid signatures is met\n#! 4. Returning the transaction summary commitment for higher-level wrappers.\n#!\n#! Inputs:\n#! Operand stack: [SALT]\n#! Advice map: {\n#! h(SIG_0, MSG): SIG_0,\n#! h(SIG_1, MSG): SIG_1,\n#! h(SIG_n, MSG): SIG_n\n#! }\n#! Outputs:\n#! Operand stack: []\n#!\n#! Where:\n#! - SALT is a cryptographically random nonce that enables multiple concurrent\n#! multisig transactions while maintaining replay protection. Each transaction\n#! must use a unique SALT value to ensure transaction uniqueness.\n#! - SIG_i is the signature from the i-th signer.\n#! - MSG is the transaction message being signed.\n#! - h(SIG_i, MSG) is the hash of the signature and message used as the advice map key.\n#!\n#! Panics if:\n#! - insufficient number of valid signatures (below threshold).\n#! - insufficient number of valid signatures (below threshold).\n#!\n#! Invocation: exec\n@locals(1)\npub proc auth_tx(salt: word)\n exec.native_account::incr_nonce drop\n # => [SALT]\n\n # ------ Computing transaction summary ------\n\n exec.auth::create_tx_summary\n # => [ACCOUNT_DELTA_COMMITMENT, INPUT_NOTES_COMMITMENT, OUTPUT_NOTES_COMMITMENT, SALT]\n\n # to build a tx_summary in the host, we need these four words in the advice provider\n adv.insert_hqword\n # => [ACCOUNT_DELTA_COMMITMENT, INPUT_NOTES_COMMITMENT, OUTPUT_NOTES_COMMITMENT, SALT]\n\n # the commitment to the tx summary is the message that is signed\n exec.auth::hash_tx_summary\n # => [TX_SUMMARY_COMMITMENT]\n\n # ------ Verifying approver signatures ------\n\n exec.get_threshold_and_num_approvers\n # => [default_threshold, num_of_approvers, TX_SUMMARY_COMMITMENT]\n\n movdn.5\n # => [num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]\n\n push.PUBLIC_KEYS_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]\n\n push.APPROVER_SCHEME_ID_SLOT[0..2]\n # => [scheme_id_slot_prefix, scheme_id_slot_suffix, pub_key_slot_prefix, pub_key_slot_suffix, num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]\n\n exec.::miden::standards::auth::signature::verify_signatures\n # => [num_verified_signatures, TX_SUMMARY_COMMITMENT, default_threshold]\n\n # ------ Checking threshold is >= num_verified_signatures ------\n\n movup.5\n # => [default_threshold, num_verified_signatures, TX_SUMMARY_COMMITMENT]\n\n exec.compute_transaction_threshold\n # => [transaction_threshold, num_verified_signatures, TX_SUMMARY_COMMITMENT]\n\n u32assert2 u32lt\n # => [is_unauthorized, TX_SUMMARY_COMMITMENT]\n\n # If signatures are non-existent the tx will fail here.\n if.true\n emit.AUTH_UNAUTHORIZED_EVENT\n push.0 assert.err=\"insufficient number of signatures\"\n end\n\n # => [TX_SUMMARY_COMMITMENT]\nend\n";
|
|
2
|
-
export declare const MULTISIG_ECDSA_MASM = "# Multi-Signature ECDSA secp256k1 Authentication Core Library\n#\n# This library provides the reusable multisig procedures used by account wrappers.\n\nuse miden::protocol::active_account\nuse miden::protocol::auth::AUTH_UNAUTHORIZED_EVENT\nuse miden::protocol::native_account\nuse miden::standards::auth\n\n# CONSTANTS\n# =================================================================================================\n\n# Auth Request Constants\n\n# Storage Layout Constants\n#\n# +-------------------------------+----------+------------+--------------+-------------------+\n# | THRESHOLD & APPROVERS CONFIG | PUB KEYS | SCHEME IDS | EXECUTED TXS | PROC THRESHOLDS |\n# | (slot) | (map) | (map) | (map) | (map) |\n# +-------------------------------+----------+------------+--------------+-------------------+\n# | 0 | 1 | 2 | 3 | 4 |\n# +-------------------------------+----------+------------+--------------+-------------------+\n\n# The slot in this component's storage layout where the default signature threshold and\n# number of approvers are stored as:\n# [default_threshold, num_approvers, 0, 0].\n# The threshold is guaranteed to be less than or equal to num_approvers.\nconst THRESHOLD_CONFIG_SLOT=word(\"openzeppelin::multisig::threshold_config\")\n\n# The slot in this component's storage layout where the public keys map is stored.\n# Map entries: [key_index, 0, 0, 0] => APPROVER_PUBLIC_KEY\nconst PUBLIC_KEYS_MAP_SLOT=word(\"openzeppelin::multisig::signer_public_keys\")\n\n# The slot in this component's storage layout where signer scheme IDs are stored.\n# Map entries: [key_index, 0, 0, 0] => [scheme_id, 0, 0, 0]\nconst APPROVER_SCHEME_ID_SLOT=word(\"openzeppelin::multisig::signer_scheme_ids\")\n\n# The slot in this component's storage layout where executed transactions are stored.\n# Map entries: transaction_message => [is_executed, 0, 0, 0]\nconst EXECUTED_TXS_SLOT=word(\"openzeppelin::multisig::executed_transactions\")\n\n# The slot in this component's storage layout where procedure thresholds are stored.\n# Map entries: PROC_ROOT => [proc_threshold, 0, 0, 0]\nconst PROC_THRESHOLD_ROOTS_SLOT=word(\"openzeppelin::multisig::procedure_thresholds\")\n\n# Executed Transaction Flag Constant\nconst IS_EXECUTED_FLAG=[1, 0, 0, 0]\nconst ECDSA_K256_KECCAK_SCHEME_WORD=[1, 0, 0, 0]\n\n# ERRORS\nconst ERR_TX_ALREADY_EXECUTED=\"failed to approve multisig transaction as it was already executed\"\n\nconst ERR_MALFORMED_MULTISIG_CONFIG=\"number of approvers must be equal to or greater than threshold\"\n\nconst ERR_ZERO_IN_MULTISIG_CONFIG=\"number of approvers or threshold must not be zero\"\n\nconst ERR_PROC_THRESHOLD_NOT_U32=\"procedure threshold must be a u32 value\"\n\nconst ERR_NUM_APPROVERS_OR_PROC_THRESHOLD_NOT_U32=\"number of approvers and procedure threshold must be u32\"\n\nconst ERR_PROC_THRESHOLD_EXCEEDS_NUM_APPROVERS=\"procedure threshold exceeds number of approvers\"\n\n# MULTISIG PROCEDURES\n# =================================================================================================\n\n#! Check if transaction has already been executed and add it to executed transactions for replay protection.\n#!\n#! Inputs: [MSG]\n#! Outputs: []\n#!\n#! Panics if:\n#! - the same transaction has already been executed\npub proc assert_new_tx(msg: word)\n push.IS_EXECUTED_FLAG\n # => [[0, 0, 0, is_executed], MSG]\n\n swapw\n # => [MSG, IS_EXECUTED_FLAG]\n\n push.EXECUTED_TXS_SLOT[0..2]\n # => [txs_slot_prefix, txs_slot_suffix, MSG, IS_EXECUTED_FLAG]\n\n # Set the key value pair in the map to mark transaction as executed\n exec.native_account::set_map_item\n # => [[0, 0, 0, is_executed]]\n\n drop drop drop\n # => [is_executed]\n\n assertz.err=ERR_TX_ALREADY_EXECUTED\n # => []\nend\n\n#! Remove old approver public keys from the approver public key mapping.\n#!\n#! This procedure cleans up the storage by removing public keys of approvers that are no longer\n#! part of the multisig configuration. This procedure assumes that init_num_of_approvers and\n#! new_num_of_approvers are u32 values.\n#!\n#! Inputs: [init_num_of_approvers, new_num_of_approvers]\n#! Outputs: []\n#!\n#! Where:\n#! - init_num_of_approvers is the original number of approvers before the update\n#! - new_num_of_approvers is the new number of approvers after the update\nproc cleanup_pubkey_mapping(init_num_of_approvers: u32, new_num_of_approvers: u32)\n dup.1 dup.1\n u32assert2 u32lt\n # => [should_loop, i = init_num_of_approvers, new_num_of_approvers]\n\n while.true\n # => [i, new_num_of_approvers]\n\n sub.1\n # => [i-1, new_num_of_approvers]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, new_num_of_approvers]\n\n padw swapw\n # => [APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n push.PUBLIC_KEYS_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE, i-1, new_num_of_approvers]\n\n dropw\n # => [i-1, new_num_of_approvers]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, new_num_of_approvers]\n\n padw swapw\n # => [APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n push.APPROVER_SCHEME_ID_SLOT[0..2]\n # => [scheme_slot_prefix, scheme_slot_suffix, APPROVER_MAP_KEY, EMPTY_WORD, i-1, new_num_of_approvers]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE, i-1, new_num_of_approvers]\n\n dropw\n # => [i-1, new_num_of_approvers]\n\n dup.1 dup.1\n u32lt\n # => [should_loop, i-1, new_num_of_approvers]\n end\n\n drop drop\n # => []\nend\n\nproc create_approver_map_key\n push.0.0.0 movup.3\n # => [APPROVER_MAP_KEY]\nend\n\nproc get_threshold_and_num_approvers\n push.THRESHOLD_CONFIG_SLOT[0..2]\n exec.active_account::get_initial_item\n # => [threshold, num_approvers]\n\n movup.2 drop movup.2 drop\n # => [threshold, num_approvers]\nend\n\nproc assert_proc_thresholds_lte_num_approvers(num_approvers: u32)\n exec.active_account::get_num_procedures\n # => [num_procedures, num_approvers]\n\n dup neq.0\n # => [should_continue, num_procedures, num_approvers]\n while.true\n sub.1 dup\n # => [proc_index, proc_index, num_approvers]\n\n exec.active_account::get_procedure_root\n # => [PROC_ROOT, proc_index, num_approvers]\n\n push.PROC_THRESHOLD_ROOTS_SLOT[0..2]\n # => [proc_roots_slot_prefix, proc_roots_slot_suffix, PROC_ROOT, proc_index, num_approvers]\n\n exec.active_account::get_map_item\n # => [[proc_threshold, 0, 0, 0], proc_index, num_approvers]\n\n movdn.3 drop drop drop\n # => [proc_threshold, proc_index, num_approvers]\n\n dup.2\n # => [num_approvers, proc_threshold, proc_index, num_approvers]\n\n u32assert2.err=ERR_PROC_THRESHOLD_NOT_U32\n u32gt assertz.err=ERR_PROC_THRESHOLD_EXCEEDS_NUM_APPROVERS\n # => [proc_index, num_approvers]\n\n dup neq.0\n # => [should_continue, proc_index, num_approvers]\n end\n\n drop drop\n # => []\nend\n\n# Internal storage helper used by the public `update_procedure_threshold`\n# entrypoint after it receives direct stack arguments.\nproc set_procedure_threshold(proc_threshold: u32, proc_root: word)\n exec.get_threshold_and_num_approvers\n # => [threshold, num_approvers, proc_threshold, PROC_ROOT]\n\n drop\n # => [num_approvers, proc_threshold, PROC_ROOT]\n\n dup.1 swap\n # => [num_approvers, proc_threshold, proc_threshold, PROC_ROOT]\n\n u32assert2.err=ERR_NUM_APPROVERS_OR_PROC_THRESHOLD_NOT_U32\n u32gt assertz.err=ERR_PROC_THRESHOLD_EXCEEDS_NUM_APPROVERS\n # => [proc_threshold, PROC_ROOT]\n\n push.0.0.0\n movup.3\n swapw\n # => [PROC_ROOT, PROC_THRESHOLD_WORD]\n\n push.PROC_THRESHOLD_ROOTS_SLOT[0..2]\n # => [proc_roots_slot_prefix, proc_roots_slot_suffix, PROC_ROOT, PROC_THRESHOLD_WORD]\n\n exec.native_account::set_map_item\n # => [OLD_VALUE]\n\n dropw\n # => []\nend\n\n#! Update threshold config and add / remove approvers\n#!\n#! Inputs:\n#! Operand stack: [MULTISIG_CONFIG_HASH, pad(12)]\n#! Advice map: {\n#! MULTISIG_CONFIG_HASH => [CONFIG, PUB_KEY_N, PUB_KEY_N-1, ..., PUB_KEY_0]\n#! }\n#! Outputs:\n#! Operand stack: []\n#!\n#! Where:\n#! - MULTISIG_CONFIG_HASH is the hash of the threshold and new public key vector\n#! - MULTISIG_CONFIG is [threshold, num_approvers, 0, 0]\n#! - PUB_KEY_i is the public key of the i-th signer\n#!\n#! Locals:\n#! 0: new_num_of_approvers\n#! 1: init_num_of_approvers\n@locals(2)\npub proc update_signers_and_threshold(multisig_config_hash: word)\n adv.push_mapval\n # => [MULTISIG_CONFIG_HASH, pad(12)]\n\n adv_loadw\n # => [MULTISIG_CONFIG, pad(12)]\n\n # store new_num_of_approvers for later\n dup.1 loc_store.0\n # => [MULTISIG_CONFIG, pad(12)]\n\n dup dup.2\n # => [num_approvers, threshold, MULTISIG_CONFIG, pad(12)]\n\n # make sure that the threshold is smaller than the number of approvers\n u32assert2.err=ERR_MALFORMED_MULTISIG_CONFIG\n u32gt assertz.err=ERR_MALFORMED_MULTISIG_CONFIG\n # => [MULTISIG_CONFIG, pad(12)]\n\n dup dup.2\n # => [num_approvers, threshold, MULTISIG_CONFIG, pad(12)]\n\n # make sure that threshold or num_approvers are not zero\n eq.0 assertz.err=ERR_ZERO_IN_MULTISIG_CONFIG\n eq.0 assertz.err=ERR_ZERO_IN_MULTISIG_CONFIG\n # => [MULTISIG_CONFIG, pad(12)]\n\n loc_load.0\n # => [num_approvers, MULTISIG_CONFIG, pad(12)]\n\n exec.assert_proc_thresholds_lte_num_approvers\n # => [MULTISIG_CONFIG, pad(12)]\n\n push.THRESHOLD_CONFIG_SLOT[0..2]\n # => [config_slot_prefix, config_slot_suffix, MULTISIG_CONFIG, pad(12)]\n\n exec.native_account::set_item\n # => [OLD_THRESHOLD_CONFIG, pad(12)]\n\n # store init_num_of_approvers for later\n drop loc_store.1 drop drop\n # => [pad(12)]\n\n loc_load.0\n # => [num_approvers]\n\n dup neq.0\n while.true\n sub.1\n # => [i-1, pad(12)]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, pad(12)]\n\n padw adv_loadw\n # => [PUB_KEY, APPROVER_MAP_KEY, i-1, pad(12)]\n\n swapw\n # => [APPROVER_MAP_KEY, PUB_KEY, i-1, pad(12)]\n\n push.PUBLIC_KEYS_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, APPROVER_MAP_KEY, PUB_KEY, i-1, pad(12)]\n\n exec.native_account::set_map_item\n # => [OLD_VALUE, i-1, pad(12)]\n\n dropw\n # => [i-1, pad(12)]\n\n dup exec.create_approver_map_key\n # => [APPROVER_MAP_KEY, i-1, pad(12)]\n\n push.ECDSA_K256_KECCAK_SCHEME_WORD\n # => [SCHEME_ID_WORD, APPROVER_MAP_KEY, i-1, pad(12)]\n\n swapw\n # => [APPROVER_MAP_KEY, [1, 0, 0, 0], i-1, pad(12)]\n\n push.APPROVER_SCHEME_ID_SLOT[0..2]\n # => [scheme_slot_prefix, scheme_slot_suffix, APPROVER_MAP_KEY, [1, 0, 0, 0], i-1, pad(12)]\n\n exec.native_account::set_map_item\n # => [OLD_VALUE, i-1, pad(12)]\n\n dropw\n # => [i-1, pad(12)]\n\n dup neq.0\n # => [is_non_zero, i-1, pad(12)]\n end\n # => [pad(13)]\n\n drop\n # => [pad(12)]\n\n loc_load.0 loc_load.1\n # => [init_num_of_approvers, new_num_of_approvers, pad(12)]\n\n dup.1 dup.1\n u32assert2 u32lt\n # => [should_cleanup, init_num_of_approvers, new_num_of_approvers, pad(12)]\n\n if.true\n exec.cleanup_pubkey_mapping\n # => [pad(12)]\n else\n drop drop\n # => [pad(12)]\n end\nend\n\n#! Update or clear the threshold override for a specific procedure.\n#!\n#! Inputs:\n#! Operand stack: [proc_threshold, PROC_ROOT]\n#! Outputs:\n#! Operand stack: []\n#! Invocation: call\npub proc update_procedure_threshold(proc_threshold: u32, proc_root: word)\n exec.set_procedure_threshold\nend\n\n# Computes the effective transaction threshold based on called procedures and per-procedure\n# overrides stored in PROC_THRESHOLD_ROOTS_SLOT. Falls back to default_threshold if no\n# overrides apply.\n#\n#! Inputs: [default_threshold]\n#! Outputs: [transaction_threshold]\n@locals(1)\nproc compute_transaction_threshold(default_threshold: u32) -> u32\n # 1. initialize transaction_threshold = 0\n # 2. iterate through all account procedures\n # a. check if the procedure was called during the transaction\n # b. if called, get the override threshold of that procedure from the config map\n # c. if proc_threshold > transaction_threshold, set transaction_threshold = proc_threshold\n # 3. if transaction_threshold == 0 at the end, revert to using default_threshold\n\n # store default_threshold for later\n loc_store.0\n # => []\n\n # 1. initialize transaction_threshold = 0\n push.0\n # => [transaction_threshold]\n\n # get the number of account procedures\n exec.active_account::get_num_procedures\n # => [num_procedures, transaction_threshold]\n\n # 2. iterate through all account procedures\n dup neq.0\n # => [should_continue, num_procedures, transaction_threshold]\n while.true\n sub.1 dup\n # => [num_procedures-1, num_procedures-1, transaction_threshold]\n\n # get procedure root of the procedure with index i\n exec.active_account::get_procedure_root dupw\n # => [PROC_ROOT, PROC_ROOT, num_procedures-1, transaction_threshold]\n\n # 2a. check if this procedure has been called in the transaction\n exec.native_account::was_procedure_called\n # => [was_called, PROC_ROOT, num_procedures-1, transaction_threshold]\n\n # if it has been called, get the override threshold of that procedure\n if.true\n # => [PROC_ROOT, num_procedures-1, transaction_threshold]\n\n push.PROC_THRESHOLD_ROOTS_SLOT[0..2]\n # => [PROC_THRESHOLD_ROOTS_SLOT_prefix, PROC_THRESHOLD_ROOTS_SLOT_suffix, PROC_ROOT, num_procedures-1, transaction_threshold]\n\n # 2b. get the override proc_threshold of that procedure\n # if the procedure has no override threshold, the returned map item will be [0, 0, 0, 0]\n exec.active_account::get_initial_map_item\n # => [[proc_threshold, 0, 0, 0], num_procedures-1, transaction_threshold]\n\n movdn.3 drop drop drop dup dup.3\n # => [transaction_threshold, proc_threshold, proc_threshold, num_procedures-1, transaction_threshold]\n\n u32assert2.err=\"transaction threshold or procedure threshold are not u32\"\n u32gt\n # => [is_gt, proc_threshold, num_procedures-1, transaction_threshold]\n # 2c. if proc_threshold > transaction_threshold, update transaction_threshold\n movup.2 movdn.3\n # => [is_gt, proc_threshold, transaction_threshold, num_procedures-1]\n cdrop\n # => [updated_transaction_threshold, num_procedures-1]\n swap\n # => [num_procedures-1, updated_transaction_threshold]\n # if it has not been called during this transaction, nothing to do, move to the next procedure\n else\n dropw\n # => [num_procedures-1, transaction_threshold]\n end\n\n dup neq.0\n # => [should_continue, num_procedures-1, transaction_threshold]\n end\n\n drop\n # => [transaction_threshold]\n\n loc_load.0\n # => [default_threshold, transaction_threshold]\n\n # 3. if transaction_threshold == 0 at the end, revert to using default_threshold\n dup.1 eq.0\n # => [is_zero, default_threshold, transaction_threshold]\n\n cdrop\n # => [effective_transaction_threshold]\nend\n\n#! Authenticate a transaction using ECDSA secp256k1 with multi-signature support.\n#!\n#! This procedure implements multi-signature authentication by:\n#! 1. Computing the transaction summary message that needs to be signed\n#! 2. Verifying ECDSA signatures from multiple required signers against their public keys\n#! 3. Ensuring the minimum threshold of valid signatures is met\n#! 4. Returning the transaction summary commitment for higher-level wrappers.\n#!\n#! Inputs:\n#! Operand stack: [SALT]\n#! Advice map: {\n#! h(PUB_KEY_0, MSG): SIG_0,\n#! h(PUB_KEY_1, MSG): SIG_1,\n#! h(PUB_KEY_n, MSG): SIG_n\n#! }\n#! Outputs:\n#! Operand stack: [TX_SUMMARY_COMMITMENT]\n#!\n#! Where:\n#! - SALT is a cryptographically random nonce that enables multiple concurrent\n#! multisig transactions while maintaining replay protection. Each transaction\n#! must use a unique SALT value to ensure transaction uniqueness.\n#! - SIG_i is the ECDSA signature from the i-th signer.\n#! - MSG is the transaction message being signed.\n#! - h(PUB_KEY_i, MSG) is the hash of the public key and message used as the advice map key.\n#!\n#! Panics if:\n#! - insufficient number of valid signatures (below threshold).\n#! - insufficient number of valid signatures (below threshold).\n#!\n#! Invocation: exec\n@locals(1)\npub proc auth_tx(salt: word)\n exec.native_account::incr_nonce drop\n # => [SALT]\n\n # ------ Computing transaction summary ------\n\n exec.auth::create_tx_summary\n # => [ACCOUNT_DELTA_COMMITMENT, INPUT_NOTES_COMMITMENT, OUTPUT_NOTES_COMMITMENT, SALT]\n\n # to build a tx_summary in the host, we need these four words in the advice provider\n adv.insert_hqword\n # => [ACCOUNT_DELTA_COMMITMENT, INPUT_NOTES_COMMITMENT, OUTPUT_NOTES_COMMITMENT, SALT]\n\n # the commitment to the tx summary is the message that is signed\n exec.auth::hash_tx_summary\n # => [TX_SUMMARY_COMMITMENT]\n\n # ------ Verifying approver signatures ------\n\n exec.get_threshold_and_num_approvers\n # => [default_threshold, num_of_approvers, TX_SUMMARY_COMMITMENT]\n\n movdn.5\n # => [num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]\n\n push.PUBLIC_KEYS_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]\n\n push.APPROVER_SCHEME_ID_SLOT[0..2]\n # => [scheme_id_slot_prefix, scheme_id_slot_suffix, pub_key_slot_prefix, pub_key_slot_suffix, num_of_approvers, TX_SUMMARY_COMMITMENT, default_threshold]\n\n exec.::miden::standards::auth::signature::verify_signatures\n # => [num_verified_signatures, TX_SUMMARY_COMMITMENT, default_threshold]\n\n # ------ Checking threshold is >= num_verified_signatures ------\n\n movup.5\n # => [default_threshold, num_verified_signatures, TX_SUMMARY_COMMITMENT]\n\n exec.compute_transaction_threshold\n # => [transaction_threshold, num_verified_signatures, TX_SUMMARY_COMMITMENT]\n\n u32assert2 u32lt\n # => [is_unauthorized, TX_SUMMARY_COMMITMENT]\n\n # If signatures are non-existent the tx will fail here.\n if.true\n emit.AUTH_UNAUTHORIZED_EVENT\n push.0 assert.err=\"insufficient number of signatures\"\n end\n\n # => [TX_SUMMARY_COMMITMENT]\nend\n";
|
|
3
|
-
export declare const GUARDIAN_MASM = "# Guardian Authentication Component\n#\n# This component provides GUARDIAN signature verification for accounts.\n# It can be used standalone or in conjunction with other auth components like multisig.\n\nuse miden::protocol::active_account\nuse miden::protocol::auth::AUTH_UNAUTHORIZED_EVENT\nuse miden::protocol::native_account\n\n# IMPORTANT SECURITY NOTES\n# --------------------------------------------------------------------------------\n# - The selector in `GUARDIAN_SELECTOR_SLOT` controls whether the extra GUARDIAN signature\n# is enforced:\n# * GUARDIAN_ON => exactly one valid GUARDIAN signature is required.\n# * GUARDIAN_OFF => GUARDIAN signature is skipped for that call.\n#\n# - `verify_guardian_signature` reads the selector from initial storage state.\n# This means changes made during the same transaction won't affect the check.\n#\n# - `enable_guardian` / `disable_guardian` procedures allow explicit control over GUARDIAN state.\n#\n# - `update_guardian_public_key`:\n# * Installs a new GUARDIAN public key in the map at `GUARDIAN_PUBLIC_KEY_MAP_SLOT`.\n# * Does not itself perform any signature checks.\n# * To update the key without requiring GUARDIAN signature, ensure selector is OFF.\n#\n# Storage Layout\n# --------------------------------------------------------------------------------\n#\n# +---------------------+---------------+\n# | DESCRIPTION | SLOT |\n# +---------------------+---------------+\n# | GUARDIAN SELECTOR (word) | 0 |\n# | GUARDIAN PUBLIC KEY MAP | 1 |\n# | GUARDIAN SCHEME ID MAP | 2 |\n# +---------------------+---------------+\n#\n# - GUARDIAN_SELECTOR_SLOT (0):\n# * Stores a word that is compared against [1, 0, 0, 0] (GUARDIAN_ON).\n# * Any value != GUARDIAN_ON is treated as GUARDIAN_OFF.\n#\n# - GUARDIAN_PUBLIC_KEY_MAP_SLOT (1):\n# * A map from a fixed key [0, 0, 0, 0] to the single GUARDIAN public key:\n# [0, 0, 0, 0] => GUARDIAN_PUBLIC_KEY\n# * GUARDIAN_PUBLIC_KEY is a Falcon Poseidon2 public key represented as a word.\n\n# CONSTANTS\n# =================================================================================================\n\n# Slot where the GUARDIAN selector flag is stored (using word() for named slot access):\n# - GUARDIAN_ON => GUARDIAN signature required\n# - GUARDIAN_OFF => GUARDIAN signature skipped\nconst GUARDIAN_SELECTOR_SLOT=word(\"openzeppelin::guardian::selector\")\n\n# Map slot for GUARDIAN public key\n# Uses exactly one GUARDIAN public key at index [0, 0, 0, 0]\n# [0, 0, 0, 0] => GUARDIAN_PUBLIC_KEY\nconst GUARDIAN_PUBLIC_KEY_MAP_SLOT=word(\"openzeppelin::guardian::public_key\")\n\n# Map slot for GUARDIAN signature scheme IDs\n# Uses exactly one scheme ID entry at index [0, 0, 0, 0]\n# [0, 0, 0, 0] => [scheme_id, 0, 0, 0]\nconst GUARDIAN_SCHEME_ID_MAP_SLOT=word(\"openzeppelin::guardian::scheme_id\")\n\n# Selector flag values\nconst GUARDIAN_ON=[1, 0, 0, 0]\nconst GUARDIAN_OFF=[0, 0, 0, 0]\nconst FALCON_512_POSEIDON2_SCHEME_WORD=[2, 0, 0, 0]\n\n# GUARDIAN PROCEDURES\n# =================================================================================================\n\n#! Enable GUARDIAN verification by setting the selector to ON.\n#!\n#! Operand stack inputs: []\n#! Outputs: []\n#!\n#! Notes:\n#! - Sets GUARDIAN_SELECTOR_SLOT to GUARDIAN_ON (1)\n#! - After this, transactions will require GUARDIAN signature verification\nproc enable_guardian\n push.GUARDIAN_ON\n # => [GUARDIAN_ON]\n\n push.GUARDIAN_SELECTOR_SLOT[0..2]\n # => [selector_slot_prefix, selector_slot_suffix, GUARDIAN_ON]\n\n exec.native_account::set_item\n # => [OLD_ROOT]\n\n dropw\n # => []\nend\n\n#! Disable GUARDIAN verification by setting the selector to OFF.\n#!\n#! Operand stack inputs: []\n#! Outputs: []\n#!\n#! Notes:\n#! - Sets GUARDIAN_SELECTOR_SLOT to GUARDIAN_OFF (0)\n#! - After this, transactions will NOT require GUARDIAN signature verification\nproc disable_guardian\n push.GUARDIAN_OFF\n # => [GUARDIAN_OFF]\n\n push.GUARDIAN_SELECTOR_SLOT[0..2]\n # => [selector_slot_prefix, selector_slot_suffix, GUARDIAN_OFF]\n\n exec.native_account::set_item\n # => [OLD_ROOT]\n\n dropw\n # => []\nend\n\n#! Update the GUARDIAN public key.\n#!\n#! Operand stack inputs: []\n#! Advice stack inputs: [PUB_KEY]\n#! - PUB_KEY is the new GUARDIAN RPO Falcon 512 public key\n#!\n#! Notes:\n#! - Stores PUB_KEY into GUARDIAN_PUBLIC_KEY_MAP_SLOT:\n#! [0, 0, 0, 0] => GUARDIAN_PUBLIC_KEY\n#! - To update the key without requiring GUARDIAN signature, ensure\n#! GUARDIAN_SELECTOR_SLOT = 0 (OFF) before calling this.\npub proc update_guardian_public_key\n exec.disable_guardian\n # ------ Update the GUARDIAN public key ------\n adv_loadw\n # => [PUB_KEY]\n\n push.0.0.0.0\n # => [MAP_KEY, PUB_KEY]\n # Note that MAP_KEY is [0, 0, 0, 0] for a single GUARDIAN_KEY\n\n push.GUARDIAN_PUBLIC_KEY_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, MAP_KEY, PUB_KEY]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE]\n\n dropw\n # => []\n\n push.0.0.0.0\n # => [MAP_KEY]\n\n push.FALCON_512_POSEIDON2_SCHEME_WORD\n # => [SCHEME_ID_WORD, MAP_KEY]\n\n swapw\n # => [MAP_KEY, SCHEME_ID_WORD]\n\n push.GUARDIAN_SCHEME_ID_MAP_SLOT[0..2]\n # => [scheme_id_slot_prefix, scheme_id_slot_suffix, MAP_KEY, SCHEME_ID_WORD]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE]\n\n dropw\n # => []\nend\n\n#! Conditionally verify a \"GUARDIAN\" signature against a stored public key hash.\n#! The condition is controlled by the selector at GUARDIAN_SELECTOR_SLOT.\n#!\n#! Inputs: [MSG]\n#! Outputs: [MSG]\n#!\n#! Panics if:\n#! - Selector is ON but the provided GUARDIAN signature is invalid or missing.\n#!\n#! Notes:\n#! - MSG is TX_SUMMARY_COMMITMENT provided by auth procedure\n#! - If selector is OFF (0), GUARDIAN verification is skipped\n#! - Selector value is read from initial storage state\npub proc verify_guardian_signature(msg: word)\n push.GUARDIAN_SELECTOR_SLOT[0..2]\n exec.active_account::get_item\n drop drop drop\n # => [selector, MSG]\n\n push.1 eq\n if.true\n push.1\n push.GUARDIAN_PUBLIC_KEY_MAP_SLOT[0..2]\n push.GUARDIAN_SCHEME_ID_MAP_SLOT[0..2]\n exec.::miden::standards::auth::signature::verify_signatures\n push.1 neq\n if.true\n emit.AUTH_UNAUTHORIZED_EVENT\n push.0 assert.err=\"invalid GUARDIAN signature\"\n end\n end\n # => [MSG]\n exec.enable_guardian\nend\n";
|
|
4
|
-
export declare const GUARDIAN_ECDSA_MASM = "# Guardian Authentication Component (ECDSA)\n#\n# This component provides GUARDIAN signature verification for accounts using\n# ECDSA secp256k1 (k256/keccak) signatures.\n# It can be used standalone or in conjunction with other auth components like multisig.\n\nuse miden::protocol::active_account\nuse miden::protocol::auth::AUTH_UNAUTHORIZED_EVENT\nuse miden::protocol::native_account\n\n# IMPORTANT SECURITY NOTES\n# --------------------------------------------------------------------------------\n# - The selector in `GUARDIAN_SELECTOR_SLOT` controls whether the extra GUARDIAN signature\n# is enforced:\n# * GUARDIAN_ON => exactly one valid GUARDIAN signature is required.\n# * GUARDIAN_OFF => GUARDIAN signature is skipped for that call.\n#\n# - `verify_guardian_signature` reads the selector from initial storage state.\n# This means changes made during the same transaction won't affect the check.\n#\n# - `enable_guardian` / `disable_guardian` procedures allow explicit control over GUARDIAN state.\n#\n# - `update_guardian_public_key`:\n# * Installs a new GUARDIAN public key in the map at `GUARDIAN_PUBLIC_KEY_MAP_SLOT`.\n# * Does not itself perform any signature checks.\n# * To update the key without requiring GUARDIAN signature, ensure selector is OFF.\n#\n# Storage Layout\n# --------------------------------------------------------------------------------\n#\n# +---------------------+---------------+\n# | DESCRIPTION | SLOT |\n# +---------------------+---------------+\n# | GUARDIAN SELECTOR (word) | 0 |\n# | GUARDIAN PUBLIC KEY MAP | 1 |\n# +---------------------+---------------+\n#\n# - GUARDIAN_SELECTOR_SLOT (0):\n# * Stores a word that is compared against [1, 0, 0, 0] (GUARDIAN_ON).\n# * Any value != GUARDIAN_ON is treated as GUARDIAN_OFF.\n#\n# - GUARDIAN_PUBLIC_KEY_MAP_SLOT (1):\n# * A map from a fixed key [0, 0, 0, 0] to the single GUARDIAN public key:\n# [0, 0, 0, 0] => GUARDIAN_PUBLIC_KEY\n# * GUARDIAN_PUBLIC_KEY is an ECDSA secp256k1 public key represented as a word.\n\n# CONSTANTS\n# =================================================================================================\n\n# Slot where the GUARDIAN selector flag is stored (using word() for named slot access):\n# - GUARDIAN_ON => GUARDIAN signature required\n# - GUARDIAN_OFF => GUARDIAN signature skipped\nconst GUARDIAN_SELECTOR_SLOT=word(\"openzeppelin::guardian::selector\")\n\n# Map slot for GUARDIAN public key\n# Uses exactly one GUARDIAN public key at index [0, 0, 0, 0]\n# [0, 0, 0, 0] => GUARDIAN_PUBLIC_KEY\nconst GUARDIAN_PUBLIC_KEY_MAP_SLOT=word(\"openzeppelin::guardian::public_key\")\nconst GUARDIAN_SCHEME_ID_MAP_SLOT=word(\"openzeppelin::guardian::scheme_id\")\n\n# Selector flag values\nconst GUARDIAN_ON=[1, 0, 0, 0]\nconst GUARDIAN_OFF=[0, 0, 0, 0]\nconst ECDSA_K256_KECCAK_SCHEME_WORD=[1, 0, 0, 0]\n\n# GUARDIAN PROCEDURES\n# =================================================================================================\n\n#! Enable GUARDIAN verification by setting the selector to ON.\n#!\n#! Operand stack inputs: []\n#! Outputs: []\n#!\n#! Notes:\n#! - Sets GUARDIAN_SELECTOR_SLOT to GUARDIAN_ON (1)\n#! - After this, transactions will require GUARDIAN signature verification\nproc enable_guardian\n push.GUARDIAN_ON\n # => [GUARDIAN_ON]\n\n push.GUARDIAN_SELECTOR_SLOT[0..2]\n # => [selector_slot_prefix, selector_slot_suffix, GUARDIAN_ON]\n\n exec.native_account::set_item\n # => [OLD_ROOT]\n\n dropw\n # => []\nend\n\n#! Disable GUARDIAN verification by setting the selector to OFF.\n#!\n#! Operand stack inputs: []\n#! Outputs: []\n#!\n#! Notes:\n#! - Sets GUARDIAN_SELECTOR_SLOT to GUARDIAN_OFF (0)\n#! - After this, transactions will NOT require GUARDIAN signature verification\nproc disable_guardian\n push.GUARDIAN_OFF\n # => [GUARDIAN_OFF]\n\n push.GUARDIAN_SELECTOR_SLOT[0..2]\n # => [selector_slot_prefix, selector_slot_suffix, GUARDIAN_OFF]\n\n exec.native_account::set_item\n # => [OLD_ROOT]\n\n dropw\n # => []\nend\n\n#! Update the GUARDIAN public key.\n#!\n#! Operand stack inputs: []\n#! Advice stack inputs: [PUB_KEY]\n#! - PUB_KEY is the new GUARDIAN ECDSA secp256k1 public key\n#!\n#! Notes:\n#! - Stores PUB_KEY into GUARDIAN_PUBLIC_KEY_MAP_SLOT:\n#! [0, 0, 0, 0] => GUARDIAN_PUBLIC_KEY\n#! - To update the key without requiring GUARDIAN signature, ensure\n#! GUARDIAN_SELECTOR_SLOT = 0 (OFF) before calling this.\npub proc update_guardian_public_key\n exec.disable_guardian\n # ------ Update the GUARDIAN public key ------\n adv_loadw\n # => [PUB_KEY]\n\n push.0.0.0.0\n # => [MAP_KEY, PUB_KEY]\n # Note that MAP_KEY is [0, 0, 0, 0] for a single GUARDIAN_KEY\n\n push.GUARDIAN_PUBLIC_KEY_MAP_SLOT[0..2]\n # => [pub_key_slot_prefix, pub_key_slot_suffix, MAP_KEY, PUB_KEY]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE]\n\n dropw\n # => []\n\n push.0.0.0.0\n # => [MAP_KEY]\n\n push.ECDSA_K256_KECCAK_SCHEME_WORD\n # => [SCHEME_ID_WORD, MAP_KEY]\n\n swapw\n # => [MAP_KEY, SCHEME_ID_WORD]\n\n push.GUARDIAN_SCHEME_ID_MAP_SLOT[0..2]\n # => [scheme_id_slot_prefix, scheme_id_slot_suffix, MAP_KEY, SCHEME_ID_WORD]\n\n exec.native_account::set_map_item\n # => [OLD_MAP_VALUE]\n\n dropw\n # => []\nend\n\n#! Conditionally verify a \"GUARDIAN\" signature against a stored public key hash.\n#! The condition is controlled by the selector at GUARDIAN_SELECTOR_SLOT.\n#!\n#! Inputs: [MSG]\n#! Outputs: [MSG]\n#!\n#! Panics if:\n#! - Selector is ON but the provided GUARDIAN signature is invalid or missing.\n#!\n#! Notes:\n#! - MSG is TX_SUMMARY_COMMITMENT provided by auth procedure\n#! - If selector is OFF (0), GUARDIAN verification is skipped\n#! - Selector value is read from initial storage state\npub proc verify_guardian_signature(msg: word)\n push.GUARDIAN_SELECTOR_SLOT[0..2]\n exec.active_account::get_item\n drop drop drop\n # => [selector, MSG]\n\n push.1 eq\n if.true\n push.1\n push.GUARDIAN_PUBLIC_KEY_MAP_SLOT[0..2]\n push.GUARDIAN_SCHEME_ID_MAP_SLOT[0..2]\n exec.::miden::standards::auth::signature::verify_signatures\n push.1 neq\n if.true\n emit.AUTH_UNAUTHORIZED_EVENT\n push.0 assert.err=\"invalid GUARDIAN signature\"\n end\n end\n # => [MSG]\n exec.enable_guardian\nend\n";
|
|
5
|
-
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/account/masm/auth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,63lBA0iBzB,CAAC;AAEF,eAAO,MAAM,mBAAmB,y4lBA0iB/B,CAAC;AAEF,eAAO,MAAM,aAAa,89MAuMzB,CAAC;AAEF,eAAO,MAAM,mBAAmB,i1MAmM/B,CAAC"}
|