@vultisig/core-mpc 1.19.1 → 1.20.0
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/CHANGELOG.md +54 -0
- package/dist/keysign/fee/resolvers/evm.d.ts +8 -0
- package/dist/keysign/fee/resolvers/evm.d.ts.map +1 -1
- package/dist/keysign/fee/resolvers/evm.js +34 -2
- package/dist/keysign/fee/resolvers/evm.js.map +1 -1
- package/dist/keysign/signingInputs/resolvers/evm/index.d.ts.map +1 -1
- package/dist/keysign/signingInputs/resolvers/evm/index.js +33 -37
- package/dist/keysign/signingInputs/resolvers/evm/index.js.map +1 -1
- package/dist/keysign/signingInputs/resolvers/ripple.d.ts.map +1 -1
- package/dist/keysign/signingInputs/resolvers/ripple.js +70 -1
- package/dist/keysign/signingInputs/resolvers/ripple.js.map +1 -1
- package/dist/tx/signature/generateSignature.js +1 -1
- package/dist/tx/signature/generateSignature.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @vultisig/core-mpc
|
|
2
2
|
|
|
3
|
+
## 1.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1830](https://github.com/vultisig/vultisig-sdk/pull/1830) [`1fd27b9`](https://github.com/vultisig/vultisig-sdk/commit/1fd27b9103b75a13191f173ebeed98288d8c16b0) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Fail closed when LI.FI returns a destination outside its official chain-scoped Diamond deployments. Accept that Diamond as LI.FI's deterministic approval-spender fast path, while requiring an independent benign Blockaid verdict for any route-dependent spender that differs from it. Require the same independent verdicts for SwapKit EVM transaction destinations and approval spenders, while retaining response-local target-address binding as defense in depth.
|
|
8
|
+
|
|
9
|
+
**Consumer-visible behavior changes:**
|
|
10
|
+
|
|
11
|
+
- **New runtime throws on the signing path.** A LI.FI destination outside the official Diamond, a distinct LI.FI approval spender that doesn't clear an independent Blockaid check, or a SwapKit destination/approval-spender that doesn't clear the same check now throws during quote construction and co-signer signing-input construction. A consumer on a caret range picks this up automatically.
|
|
12
|
+
- **Dynamic LI.FI approval spenders and SwapKit addresses add a live third-party network call (Blockaid) during MPC signing**, per co-signer. The official LI.FI Diamond remains an offline fast path. A slow or unreachable Blockaid response can stall a signing ceremony for up to the shared `queryUrl` timeout (20s default) before throwing.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`1fd27b9`](https://github.com/vultisig/vultisig-sdk/commit/1fd27b9103b75a13191f173ebeed98288d8c16b0), [`003ee98`](https://github.com/vultisig/vultisig-sdk/commit/003ee98728f3318eb2de661209f164b449150810), [`44f0ecb`](https://github.com/vultisig/vultisig-sdk/commit/44f0ecbdf10b07789341c0279041d3a1e37d46a0), [`eb25508`](https://github.com/vultisig/vultisig-sdk/commit/eb25508eadfde14ee62470e64d8c2b590627fd76)]:
|
|
17
|
+
- @vultisig/core-chain@2.36.0
|
|
18
|
+
|
|
19
|
+
## 1.19.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#1846](https://github.com/vultisig/vultisig-sdk/pull/1846) [`8faa612`](https://github.com/vultisig/vultisig-sdk/commit/8faa612e6358af0a77cebf9c06d8865d832b69df) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - Reserve the OP-stack balance-check surcharges in the EVM fee amount, so a native max send on Optimism, Base, Blast or Mantle stays affordable at broadcast. op-geth requires `value + gasLimit * maxFeePerGas + l1Cost + operatorCost`, and an amount that left only the gas term behind was rejected by exactly the difference — after the keysign ceremony had already run. Both oracle reads fail open, so a chain whose oracle is unreachable or predates a term behaves exactly as before.
|
|
24
|
+
|
|
25
|
+
- [#1844](https://github.com/vultisig/vultisig-sdk/pull/1844) [`69a891c`](https://github.com/vultisig/vultisig-sdk/commit/69a891ce5fbb49c6fd8951e28f66411cc5a8ff99) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - fix(ripple): refuse a partial payment with no delivery floor
|
|
26
|
+
|
|
27
|
+
For a `signRipple` Payment this resolver binds the raw transaction's
|
|
28
|
+
`Destination` and `Amount` to the reviewed `toAddress` / `toAmount`, so the
|
|
29
|
+
bytes being signed match the terms someone approved. That binding assumes
|
|
30
|
+
`Amount` is a delivery.
|
|
31
|
+
|
|
32
|
+
`tfPartialPayment` breaks the assumption. With the flag set, `Amount` becomes a
|
|
33
|
+
maximum: the ledger delivers whatever the chosen path can source and records
|
|
34
|
+
the real figure only in the executed transaction's metadata
|
|
35
|
+
(`delivered_amount`). The reviewed amount is still matched byte for byte and
|
|
36
|
+
still describes nothing the recipient will actually receive, while the sender
|
|
37
|
+
can be charged the full `SendMax`. A cross-currency self-swap — the shape where
|
|
38
|
+
`Destination` is the sender's own address — turns an attractive receive figure
|
|
39
|
+
into dust for the price of the whole `SendMax`.
|
|
40
|
+
|
|
41
|
+
A `DeliverMin` restores a floor only if it actually guarantees the reviewed
|
|
42
|
+
amount: `DeliverMin` must be the same asset as `Amount` (native XRP, or the
|
|
43
|
+
same issued-currency code and issuer) and at least as much value, so a
|
|
44
|
+
partial payment carrying one is forwarded unchanged only when the recipient
|
|
45
|
+
is guaranteed to receive no less than what was reviewed. A `DeliverMin` that
|
|
46
|
+
is merely present and positive — but floors delivery at a fraction of
|
|
47
|
+
`Amount`, or in an unrelated currency — is refused: it satisfies "the field
|
|
48
|
+
is there" while leaving the sender able to pay the full `SendMax` for dust,
|
|
49
|
+
which is the exact outcome this resolver exists to prevent. `Flags` that
|
|
50
|
+
cannot be read as a uint32 — the `{ tfPartialPayment: true }` object form
|
|
51
|
+
some client libraries accept — are refused for the same reason, since they
|
|
52
|
+
may carry the very bit being checked.
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [[`8faa612`](https://github.com/vultisig/vultisig-sdk/commit/8faa612e6358af0a77cebf9c06d8865d832b69df)]:
|
|
55
|
+
- @vultisig/core-chain@2.35.1
|
|
56
|
+
|
|
3
57
|
## 1.19.1
|
|
4
58
|
|
|
5
59
|
### Patch Changes
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { FeeAmountResolver } from '../resolver.js';
|
|
2
|
+
/**
|
|
3
|
+
* What an EVM transaction costs its sender's balance: the gas the node holds
|
|
4
|
+
* against it, plus the surcharges an OP-stack rollup adds to the same check.
|
|
5
|
+
*
|
|
6
|
+
* The gas term is `gasLimit * maxFeePerGas` — the worst case the node reserves
|
|
7
|
+
* up front, not the eventual `gasUsed * effectiveGasPrice` — so anything derived
|
|
8
|
+
* from this number stays affordable once the transaction lands.
|
|
9
|
+
*/
|
|
2
10
|
export declare const getEvmFeeAmount: FeeAmountResolver;
|
|
3
11
|
//# sourceMappingURL=evm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/mpc/keysign/fee/resolvers/evm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/mpc/keysign/fee/resolvers/evm.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAY/C;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,iBAoB7B,CAAA"}
|
|
@@ -1,6 +1,38 @@
|
|
|
1
|
+
import { getOpStackFeeSurcharge } from '@vultisig/core-chain/chains/evm/opStack/getOpStackFeeSurcharge';
|
|
2
|
+
import { isOpStackChain } from '@vultisig/core-chain/chains/evm/opStack/opStackChains';
|
|
3
|
+
import { formatDataToHex } from '@vultisig/lib-utils/formatDataToHex';
|
|
4
|
+
import { size } from 'viem';
|
|
1
5
|
import { getBlockchainSpecificValue } from '../../chainSpecific/KeysignChainSpecific.js';
|
|
2
|
-
|
|
6
|
+
import { getKeysignSwapPayload } from '../../swap/getKeysignSwapPayload.js';
|
|
7
|
+
import { getKeysignChain } from '../../utils/getKeysignChain.js';
|
|
8
|
+
// Mirrors how the EVM chain-specific resolver picks the transaction's `data`, so
|
|
9
|
+
// the bytes the L1 fee is quoted for are the bytes that end up being signed.
|
|
10
|
+
const getCallDataSize = (keysignPayload) => {
|
|
11
|
+
const swapPayload = getKeysignSwapPayload(keysignPayload);
|
|
12
|
+
const swapData = swapPayload && 'general' in swapPayload ? swapPayload.general.quote?.tx?.data : undefined;
|
|
13
|
+
const data = swapData || keysignPayload.memo;
|
|
14
|
+
return data ? size(formatDataToHex(data)) : 0;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* What an EVM transaction costs its sender's balance: the gas the node holds
|
|
18
|
+
* against it, plus the surcharges an OP-stack rollup adds to the same check.
|
|
19
|
+
*
|
|
20
|
+
* The gas term is `gasLimit * maxFeePerGas` — the worst case the node reserves
|
|
21
|
+
* up front, not the eventual `gasUsed * effectiveGasPrice` — so anything derived
|
|
22
|
+
* from this number stays affordable once the transaction lands.
|
|
23
|
+
*/
|
|
24
|
+
export const getEvmFeeAmount = async ({ keysignPayload }) => {
|
|
3
25
|
const { maxFeePerGasWei, gasLimit } = getBlockchainSpecificValue(keysignPayload.blockchainSpecific, 'ethereumSpecific');
|
|
4
|
-
|
|
26
|
+
const gasFee = BigInt(maxFeePerGasWei) * BigInt(gasLimit);
|
|
27
|
+
const chain = getKeysignChain(keysignPayload);
|
|
28
|
+
if (!isOpStackChain(chain)) {
|
|
29
|
+
return gasFee;
|
|
30
|
+
}
|
|
31
|
+
const surcharge = await getOpStackFeeSurcharge({
|
|
32
|
+
chain,
|
|
33
|
+
gasLimit: BigInt(gasLimit),
|
|
34
|
+
callDataSize: getCallDataSize(keysignPayload),
|
|
35
|
+
});
|
|
36
|
+
return gasFee + surcharge;
|
|
5
37
|
};
|
|
6
38
|
//# sourceMappingURL=evm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../../../../../packages/core/mpc/keysign/fee/resolv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A;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAEzD,MAAM,KAAK,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;IAC7C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAA;IACf,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC;QAC7C,KAAK;QACL,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC1B,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC;KAC9C,CAAC,CAAA;IAEF,OAAO,MAAM,GAAG,SAAS,CAAA;AAC3B,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/evm/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/evm/index.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAKtD,eAAO,MAAM,mBAAmB,EAAE,qBAAqB,CAAC,KAAK,CA0M5D,CAAA"}
|
|
@@ -12,7 +12,7 @@ import { maxBigInt } from '@vultisig/lib-utils/math/maxBigInt';
|
|
|
12
12
|
import { assertField } from '@vultisig/lib-utils/record/assertField';
|
|
13
13
|
import { TW } from '@trustwallet/wallet-core';
|
|
14
14
|
import { KeysignPayloadSchema } from '../../../../types/vultisig/keysign/v1/keysign_message_pb.js';
|
|
15
|
-
import { assertEnforcedSwapApprovalSpenderBound, assertKnownAggregatorRouterOnSigningPath, } from '@vultisig/core-chain/swap/general/knownAggregatorRouters';
|
|
15
|
+
import { assertEnforcedSwapApprovalSpenderBound, assertKnownAggregatorRouterOnSigningPath, assertLifiApprovalAddress, assertSwapKitAddressReputation, } from '@vultisig/core-chain/swap/general/knownAggregatorRouters';
|
|
16
16
|
import { getBlockchainSpecificValue } from '../../../chainSpecific/KeysignChainSpecific.js';
|
|
17
17
|
import { getKeysignSwapPayload } from '../../../swap/getKeysignSwapPayload.js';
|
|
18
18
|
import { toTwAddress } from '../../../tw/toTwAddress.js';
|
|
@@ -30,17 +30,20 @@ export const getEvmSigningInputs = async ({ keysignPayload, walletCore }) => {
|
|
|
30
30
|
// sibling can't see the spender). The router allow-list runs on quote.tx.to in that recursion;
|
|
31
31
|
// this binds the INDEPENDENT erc20ApprovePayload.spender field to it for enforced providers, so
|
|
32
32
|
// a payload can't pass the router check yet still approve an attacker. sdk#1457: cowswap is now
|
|
33
|
-
// bound too (its spender IS its tx.to — both the fixed GPv2VaultRelayer)
|
|
34
|
-
//
|
|
35
|
-
//
|
|
33
|
+
// bound too (its spender IS its tx.to — both the fixed GPv2VaultRelayer). LI.FI and SwapKit
|
|
34
|
+
// can carry distinct approval spenders, so those providers use independent reputation checks
|
|
35
|
+
// below rather than trusting response-local equality or forcing legitimate routes to the router.
|
|
36
36
|
const approveSwapPayload = getKeysignSwapPayload(keysignPayload);
|
|
37
37
|
if (approveSwapPayload && 'general' in approveSwapPayload) {
|
|
38
38
|
assertEnforcedSwapApprovalSpenderBound(approveSwapPayload.general.provider, erc20ApprovePayload.spender, approveSwapPayload.general.quote?.tx?.to ?? '', chain);
|
|
39
|
+
if (approveSwapPayload.general.provider === 'li.fi') {
|
|
40
|
+
await assertLifiApprovalAddress(erc20ApprovePayload.spender, chain);
|
|
41
|
+
}
|
|
42
|
+
else if (approveSwapPayload.general.provider === 'swapkit') {
|
|
43
|
+
await assertSwapKitAddressReputation(erc20ApprovePayload.spender, chain, 'approval spender');
|
|
44
|
+
}
|
|
39
45
|
}
|
|
40
|
-
const approveSigningInput = getErc20ApproveSigningInput({
|
|
41
|
-
keysignPayload,
|
|
42
|
-
walletCore,
|
|
43
|
-
});
|
|
46
|
+
const approveSigningInput = getErc20ApproveSigningInput({ keysignPayload, walletCore });
|
|
44
47
|
const restOfSigningInputs = await getEvmSigningInputs({
|
|
45
48
|
keysignPayload: incrementKeysignPayloadNonce(create(KeysignPayloadSchema, restOfKeysignPayload)),
|
|
46
49
|
walletCore,
|
|
@@ -55,9 +58,13 @@ export const getEvmSigningInputs = async ({ keysignPayload, walletCore }) => {
|
|
|
55
58
|
// destination (getToAddress/getTransaction general arms below) - a compromised initiator can
|
|
56
59
|
// hand a co-signer a payload whose tx.to was never quote-checked, and every co-signer
|
|
57
60
|
// independently rebuilds the input from that payload. Fail closed for enforced providers
|
|
58
|
-
// (1inch/kyber)
|
|
59
|
-
//
|
|
60
|
-
// pre-signing hash.
|
|
61
|
+
// (1inch/kyber/cowswap/li.fi), require an independent reputation verdict for SwapKit, and retain
|
|
62
|
+
// log-only compatibility only for legacy unattributed payloads. A pure gate: it throws or no-ops,
|
|
63
|
+
// never changes the signed bytes, so it cannot desync the cross-device pre-signing hash. sdk#1458:
|
|
64
|
+
// that guarantee covers only the bytes. SwapKit's branch below makes a live Blockaid call, so two
|
|
65
|
+
// co-signers given the identical payload can now reach different verdicts (one gets Benign, another
|
|
66
|
+
// times out) - the failure mode this introduces is a stuck ceremony, not a hash desync or fund loss,
|
|
67
|
+
// but it is a new failure mode this paragraph used to read as having ruled out.
|
|
61
68
|
//
|
|
62
69
|
// SCOPE - this guard covers the swap-leg destination ONLY, NOT the ERC-20 approval spender.
|
|
63
70
|
// On the INITIATOR, build.ts derives the approve spender from this same quote.tx.to
|
|
@@ -65,14 +72,20 @@ export const getEvmSigningInputs = async ({ keysignPayload, walletCore }) => {
|
|
|
65
72
|
// (handled in the erc20ApprovePayload branch above) is built from an INDEPENDENT wire field,
|
|
66
73
|
// erc20ApprovePayload.spender (erc20.ts), which nothing binds to quote.tx.to - so a payload can
|
|
67
74
|
// pass this router check yet still carry an approve to an arbitrary spender. That gap is now
|
|
68
|
-
// closed for
|
|
69
|
-
// (sdk#1358 review follow-up; sdk#1457 extended it to cowswap, whose spender IS its tx.to).
|
|
70
|
-
//
|
|
75
|
+
// closed for fixed-spender providers by assertEnforcedSwapApprovalSpenderBound in the branch
|
|
76
|
+
// above (sdk#1358 review follow-up; sdk#1457 extended it to cowswap, whose spender IS its tx.to).
|
|
77
|
+
// LI.FI and SwapKit distinct spenders are independently reputation-checked above. The legacy
|
|
78
|
+
// `''` provider remains unenforced.
|
|
71
79
|
if (swapPayload && 'general' in swapPayload) {
|
|
72
80
|
const { provider, quote } = swapPayload.general;
|
|
73
81
|
// Pass the raw (possibly empty) destination unconditionally: for an enforced provider an empty
|
|
74
82
|
// `to` must ALSO fail closed (the helper rejects it as unrecognized), not be silently skipped.
|
|
75
|
-
|
|
83
|
+
if (provider === 'swapkit') {
|
|
84
|
+
await assertSwapKitAddressReputation(quote?.tx?.to ?? '', chain, 'transaction destination');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
assertKnownAggregatorRouterOnSigningPath(provider, quote?.tx?.to ?? '', chain);
|
|
88
|
+
}
|
|
76
89
|
}
|
|
77
90
|
// A token coin carrying raw `0x` calldata with a zero `toAmount` (and no swap)
|
|
78
91
|
// is a generic contract call (e.g. staking depositFor, whose token amount lives
|
|
@@ -107,25 +120,14 @@ export const getEvmSigningInputs = async ({ keysignPayload, walletCore }) => {
|
|
|
107
120
|
};
|
|
108
121
|
}
|
|
109
122
|
const abiFunction = walletCore.EthereumAbiFunction.createWithString('depositWithExpiry');
|
|
110
|
-
abiFunction.addParamAddress(toTwAddress({
|
|
111
|
-
|
|
112
|
-
walletCore,
|
|
113
|
-
chain,
|
|
114
|
-
}), false);
|
|
115
|
-
abiFunction.addParamAddress(toTwAddress({
|
|
116
|
-
address: shouldBePresent(fromCoin?.contractAddress),
|
|
117
|
-
walletCore,
|
|
118
|
-
chain,
|
|
119
|
-
}), false);
|
|
123
|
+
abiFunction.addParamAddress(toTwAddress({ address: vaultAddress, walletCore, chain }), false);
|
|
124
|
+
abiFunction.addParamAddress(toTwAddress({ address: shouldBePresent(fromCoin?.contractAddress), walletCore, chain }), false);
|
|
120
125
|
abiFunction.addParamUInt256(toEvmTwAmount(fromAmount), false);
|
|
121
126
|
abiFunction.addParamString(memo, false);
|
|
122
127
|
abiFunction.addParamUInt256(toEvmTwAmount(expirationTime), false);
|
|
123
128
|
const data = walletCore.EthereumAbi.encode(abiFunction);
|
|
124
129
|
return {
|
|
125
|
-
contractGeneric: TW.Ethereum.Proto.Transaction.ContractGeneric.create({
|
|
126
|
-
amount: toEvmTwAmount(0),
|
|
127
|
-
data,
|
|
128
|
-
}),
|
|
130
|
+
contractGeneric: TW.Ethereum.Proto.Transaction.ContractGeneric.create({ amount: toEvmTwAmount(0), data }),
|
|
129
131
|
};
|
|
130
132
|
},
|
|
131
133
|
general: ({ quote }) => {
|
|
@@ -157,10 +159,7 @@ export const getEvmSigningInputs = async ({ keysignPayload, walletCore }) => {
|
|
|
157
159
|
};
|
|
158
160
|
}
|
|
159
161
|
return {
|
|
160
|
-
erc20Transfer: TW.Ethereum.Proto.Transaction.ERC20Transfer.create({
|
|
161
|
-
amount,
|
|
162
|
-
to: keysignPayload.toAddress,
|
|
163
|
-
}),
|
|
162
|
+
erc20Transfer: TW.Ethereum.Proto.Transaction.ERC20Transfer.create({ amount, to: keysignPayload.toAddress }),
|
|
164
163
|
};
|
|
165
164
|
};
|
|
166
165
|
const getFeeFields = () => {
|
|
@@ -182,10 +181,7 @@ export const getEvmSigningInputs = async ({ keysignPayload, walletCore }) => {
|
|
|
182
181
|
const input = TW.Ethereum.Proto.SigningInput.create({
|
|
183
182
|
toAddress: getToAddress(),
|
|
184
183
|
transaction: TW.Ethereum.Proto.Transaction.create(getTransaction()),
|
|
185
|
-
chainId: getEvmTwChainId({
|
|
186
|
-
walletCore,
|
|
187
|
-
chain,
|
|
188
|
-
}),
|
|
184
|
+
chainId: getEvmTwChainId({ walletCore, chain }),
|
|
189
185
|
nonce: getEvmTwNonce(nonce),
|
|
190
186
|
...getFeeFields(),
|
|
191
187
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAA0B,MAAM,6DAA6D,CAAA;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAA;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAA;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAA;AAC/F,OAAO,EACL,sCAAsC,EACtC,wCAAwC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAA0B,MAAM,6DAA6D,CAAA;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC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AAC,MAAM,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;YAC1E,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACjC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC,CAAA;IAED,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;QAClD,SAAS,EAAE,YAAY,EAAE;QACzB,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QACnE,OAAO,EAAE,eAAe,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;QAC/C,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC;QAC3B,GAAG,YAAY,EAAE;KAClB,CAAC,CAAA;IAEF,OAAO,CAAC,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ripple.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ripple.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ripple.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ripple.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA4DnD,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,CAAC,QAAQ,CA6NlE,CAAA"}
|
|
@@ -8,6 +8,47 @@ import { getBlockchainSpecificValue } from '../../chainSpecific/KeysignChainSpec
|
|
|
8
8
|
import { getKeysignTwPublicKey } from '../../tw/getKeysignTwPublicKey.js';
|
|
9
9
|
import { isRippleTrustSet } from '../../utils/isRippleTrustSet.js';
|
|
10
10
|
import { getLegacyDestinationTag, resolveDestinationTag } from '../../utils/rippleDestinationTag.js';
|
|
11
|
+
// tfPartialPayment on an XRPL Payment. It redefines `Amount` from a guaranteed
|
|
12
|
+
// delivery into a maximum, leaving `delivered_amount` in the executed
|
|
13
|
+
// transaction's metadata as the only record of what actually moved.
|
|
14
|
+
const tfPartialPayment = 0x00020000;
|
|
15
|
+
const parseXrplAmount = (value) => {
|
|
16
|
+
if (typeof value === 'string') {
|
|
17
|
+
const drops = attempt(() => BigInt(value));
|
|
18
|
+
if ('error' in drops || drops.data <= 0n) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return { kind: 'native', units: drops.data };
|
|
22
|
+
}
|
|
23
|
+
if (typeof value !== 'object' || value === null) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const { currency, issuer, value: issuedValue } = value;
|
|
27
|
+
if (typeof currency !== 'string' || typeof issuer !== 'string' || typeof issuedValue !== 'string') {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const parsed = attempt(() => parseIssuedCurrencyValue(issuedValue));
|
|
31
|
+
if ('error' in parsed || parsed.data <= 0n) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const normalizedCurrency = attempt(() => toXrplCurrencyCode(currency));
|
|
35
|
+
if ('error' in normalizedCurrency) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return { kind: 'issued', currency: normalizedCurrency.data, issuer, units: parsed.data };
|
|
39
|
+
};
|
|
40
|
+
// True only if `deliverMin` is the same asset as `amount` (native XRP, or the
|
|
41
|
+
// same issued-currency code + issuer) and exactly matches its value. On XRPL a
|
|
42
|
+
// partial payment's `Amount` is the delivery maximum, so `DeliverMin > Amount`
|
|
43
|
+
// is unsatisfiable rather than a stricter guarantee. A different currency, or a
|
|
44
|
+
// lower/higher floor in the same currency, means the reviewed `toAmount` no
|
|
45
|
+
// longer describes a valid guaranteed outcome.
|
|
46
|
+
const deliverMinExactlyMatchesReviewedAmount = (deliverMin, amount) => {
|
|
47
|
+
if (deliverMin.kind === 'native' || amount.kind === 'native') {
|
|
48
|
+
return deliverMin.kind === 'native' && amount.kind === 'native' && deliverMin.units === amount.units;
|
|
49
|
+
}
|
|
50
|
+
return (deliverMin.currency === amount.currency && deliverMin.issuer === amount.issuer && deliverMin.units === amount.units);
|
|
51
|
+
};
|
|
11
52
|
export const getRippleSigningInputs = ({ keysignPayload }) => {
|
|
12
53
|
const rippleSpecific = getBlockchainSpecificValue(keysignPayload.blockchainSpecific, 'rippleSpecific');
|
|
13
54
|
const { gas, sequence, lastLedgerSequence } = rippleSpecific;
|
|
@@ -20,7 +61,8 @@ export const getRippleSigningInputs = ({ keysignPayload }) => {
|
|
|
20
61
|
// payload's toAddress / toAmount (which cannot describe an offer); this
|
|
21
62
|
// resolver is instead the fail-closed chokepoint that binds the raw
|
|
22
63
|
// transaction to the signing vault (the `Account` check below) and, for
|
|
23
|
-
// Payments, to the reviewed destination and amount
|
|
64
|
+
// Payments, to the reviewed destination and amount — including refusing the
|
|
65
|
+
// flags that would quietly unbind that amount again.
|
|
24
66
|
const getRawJson = () => {
|
|
25
67
|
if (keysignPayload.signData.case !== 'signRipple') {
|
|
26
68
|
return undefined;
|
|
@@ -92,6 +134,33 @@ export const getRippleSigningInputs = ({ keysignPayload }) => {
|
|
|
92
134
|
// Missing Amount (or an unrepresentable encoding) cannot be reviewed.
|
|
93
135
|
throw amountMismatch;
|
|
94
136
|
}
|
|
137
|
+
// The Amount binding just established only means something while Amount
|
|
138
|
+
// is a delivery. tfPartialPayment turns it into a ceiling: the ledger
|
|
139
|
+
// hands over whatever the path can source and records the real figure
|
|
140
|
+
// only in the executed transaction's metadata, so the reviewed toAmount
|
|
141
|
+
// stops describing what the recipient gets while the sender can still be
|
|
142
|
+
// charged the full SendMax. A DeliverMin that merely exists and is
|
|
143
|
+
// positive is not a floor the reviewer approved — a dApp can bind Amount
|
|
144
|
+
// to the reviewed toAmount while DeliverMin permits delivering a dust
|
|
145
|
+
// fraction of it. Only a DeliverMin that guarantees the full reviewed
|
|
146
|
+
// Amount (same asset, at least as much value) restores what the review
|
|
147
|
+
// screen promised; without one there is nothing left to bind, so refuse
|
|
148
|
+
// rather than sign an outcome no reviewer could have seen. Flags we
|
|
149
|
+
// cannot read as a uint32 are refused for the same reason — they may
|
|
150
|
+
// carry the very bit checked here.
|
|
151
|
+
const flags = tx.Flags === undefined ? 0 : tx.Flags;
|
|
152
|
+
if (typeof flags !== 'number' || !Number.isInteger(flags) || flags < 0 || flags > 0xffffffff) {
|
|
153
|
+
throw new Error('signRipple rawJson Flags is not a uint32 bitmask');
|
|
154
|
+
}
|
|
155
|
+
if ((flags & tfPartialPayment) !== 0) {
|
|
156
|
+
const parsedAmount = parseXrplAmount(amount);
|
|
157
|
+
const parsedDeliverMin = parseXrplAmount(tx.DeliverMin);
|
|
158
|
+
if (!parsedAmount ||
|
|
159
|
+
!parsedDeliverMin ||
|
|
160
|
+
!deliverMinExactlyMatchesReviewedAmount(parsedDeliverMin, parsedAmount)) {
|
|
161
|
+
throw new Error('signRipple rawJson sets tfPartialPayment without a DeliverMin that guarantees the reviewed amount');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
95
164
|
}
|
|
96
165
|
return { rawJson };
|
|
97
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ripple.js","sourceRoot":"","sources":["../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ripple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA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AAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,CAAQ,EAAE,CAAC;aACpG,CAAC;SACH,CAAA;IACH,CAAC,CAAA;IAED,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;QAChD,OAAO;QACP,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC1B,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,CAAC;QAC9C,SAAS,EAAE,qBAAqB,CAAC,cAAc,CAAC;QAChD,GAAG,CAAC,UAAU,EAAE,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC;KACnD,CAAC,CAAA;IAEF,OAAO,CAAC,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -9,7 +9,7 @@ export const generateSignature = ({ walletCore, signature, signatureFormat }) =>
|
|
|
9
9
|
return new Uint8Array([...r, ...s, ...recovery_id]);
|
|
10
10
|
},
|
|
11
11
|
raw: () => {
|
|
12
|
-
const { r, s } = recordMap(pick(signature, ['r', 's']), value => walletCore.HexCoding.decode(value)
|
|
12
|
+
const { r, s } = recordMap(pick(signature, ['r', 's']), value => walletCore.HexCoding.decode(value));
|
|
13
13
|
return new Uint8Array([...r, ...s]);
|
|
14
14
|
},
|
|
15
15
|
der: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSignature.js","sourceRoot":"","sources":["../../../../../../packages/core/mpc/tx/signature/generateSignature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAWhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAS,EAAE,EAAE;IACrF,OAAO,KAAK,CAAC,eAAe,EAAE;QAC5B,iBAAiB,EAAE,GAAG,EAAE;YACtB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAC5G,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CACnC,CAAA;YAED,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAA;QACrD,CAAC;QACD,GAAG,EAAE,GAAG,EAAE;YACR,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"generateSignature.js","sourceRoot":"","sources":["../../../../../../packages/core/mpc/tx/signature/generateSignature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAWhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAS,EAAE,EAAE;IACrF,OAAO,KAAK,CAAC,eAAe,EAAE;QAC5B,iBAAiB,EAAE,GAAG,EAAE;YACtB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAC5G,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CACnC,CAAA;YAED,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAA;QACrD,CAAC;QACD,GAAG,EAAE,GAAG,EAAE;YACR,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;YAEpG,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QACrC,CAAC;QACD,GAAG,EAAE,GAAG,EAAE;YACR,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;QAC7D,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vultisig/core-mpc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "MPC, keysign, and vault types shared across Vultisig clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -1094,7 +1094,7 @@
|
|
|
1094
1094
|
"@noble/hashes": "^1.8.0",
|
|
1095
1095
|
"@solana/web3.js": "^1.98.4",
|
|
1096
1096
|
"@trustwallet/wallet-core": "^4.7.0",
|
|
1097
|
-
"@vultisig/core-chain": "2.
|
|
1097
|
+
"@vultisig/core-chain": "2.36.0",
|
|
1098
1098
|
"@vultisig/core-config": "0.9.1",
|
|
1099
1099
|
"@vultisig/lib-dkls": "0.9.0",
|
|
1100
1100
|
"@vultisig/lib-mldsa": "0.9.0",
|