Page MenuHomePhabricator

[ecash-lib, ecash-wallet] Add support for multisig txs for non-chained wallet actions
AbandonedPublic

Authored by bytesofman on Mar 6 2026, 14:40.

Details

Reviewers
tobias_ruck
Group Reviewers
Restricted Project
Summary

Multisig could be an important requirement for minting tokens with real world economic activity. This diff provides a good toolkit for this kind of management and adds integration tests demonstrating potential use. It would still be up to developers to implement a secure sharing system.

Test Plan

npm test

Event Timeline

Tail of the build log:

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-faucet-tests
Lockfile is up to date, resolution step is skipped
Done in 879ms using pnpm v10.24.0

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-faucet-tests
Scope: 2 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 890ms using pnpm v10.24.0

> chronik-client@4.1.0 build /work/modules/chronik-client
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-faucet-tests
Scope: 4 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 951ms using pnpm v10.24.0

> ecash-lib@4.9.0 build /work/modules/ecash-lib
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-faucet-tests
Scope: 5 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
.                                        |   +3 +
Progress: resolved 3, reused 0, downloaded 3, added 3, done
Done in 1s using pnpm v10.24.0

> ecash-wallet@5.1.0 build /work/modules/ecash-wallet
> tsc -p ./tsconfig.build.json

src/wallet.ts(924,46): error TS2339: Property 'sk' does not exist on type 'ActionableWallet'.
src/wallet.ts(931,42): error TS2339: Property 'pk' does not exist on type 'ActionableWallet'.
src/wallet.ts(1712,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(1715,34): error TS2339: Property 'getKeypairForAddress' does not exist on type 'ActionableWallet'.
src/wallet.ts(1743,35): error TS2339: Property 'ecc' does not exist on type 'ActionableWallet'.
src/wallet.ts(1778,38): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2456,26): error TS2345: Argument of type 'ActionableWallet' is not assignable to parameter of type 'Wallet'.
  Type 'ActionableWallet' is missing the following properties from type 'Wallet': sk, pk, tipHeight, _deriveKeypair, and 35 more.
src/wallet.ts(2472,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2517,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2519,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2536,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2545,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2547,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2552,22): error TS2339: Property 'updateBalance' does not exist on type 'ActionableWallet'.
/work/modules/ecash-wallet:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ecash-wallet@5.1.0 build: `tsc -p ./tsconfig.build.json`
Exit status 2
Build cashtab-faucet-tests failed with exit code 2

Tail of the build log:

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-integration-tests
Lockfile is up to date, resolution step is skipped
Done in 913ms using pnpm v10.24.0

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-integration-tests
Scope: 2 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 916ms using pnpm v10.24.0

> chronik-client@4.1.0 build /work/modules/chronik-client
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-integration-tests
Scope: 4 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 984ms using pnpm v10.24.0

> ecash-lib@4.9.0 build /work/modules/ecash-lib
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-integration-tests
Scope: 5 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
.                                        |   +5 +
Progress: resolved 5, reused 0, downloaded 5, added 5, done
Done in 1.2s using pnpm v10.24.0

> ecash-wallet@5.1.0 build /work/modules/ecash-wallet
> tsc -p ./tsconfig.build.json

src/wallet.ts(924,46): error TS2339: Property 'sk' does not exist on type 'ActionableWallet'.
src/wallet.ts(931,42): error TS2339: Property 'pk' does not exist on type 'ActionableWallet'.
src/wallet.ts(1712,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(1715,34): error TS2339: Property 'getKeypairForAddress' does not exist on type 'ActionableWallet'.
src/wallet.ts(1743,35): error TS2339: Property 'ecc' does not exist on type 'ActionableWallet'.
src/wallet.ts(1778,38): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2456,26): error TS2345: Argument of type 'ActionableWallet' is not assignable to parameter of type 'Wallet'.
  Type 'ActionableWallet' is missing the following properties from type 'Wallet': sk, pk, tipHeight, _deriveKeypair, and 35 more.
src/wallet.ts(2472,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2517,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2519,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2536,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2545,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2547,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2552,22): error TS2339: Property 'updateBalance' does not exist on type 'ActionableWallet'.
/work/modules/ecash-wallet:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ecash-wallet@5.1.0 build: `tsc -p ./tsconfig.build.json`
Exit status 2
Build ecash-agora-integration-tests failed with exit code 2

Tail of the build log:

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-tests
Lockfile is up to date, resolution step is skipped
Done in 941ms using pnpm v10.24.0

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-tests
Scope: 2 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 993ms using pnpm v10.24.0

> chronik-client@4.1.0 build /work/modules/chronik-client
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-tests
Scope: 4 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 1s using pnpm v10.24.0

> ecash-lib@4.9.0 build /work/modules/ecash-lib
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/ecash-agora-tests
Scope: 5 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
.                                        |   +5 +
Progress: resolved 5, reused 0, downloaded 5, added 5, done
Done in 1.3s using pnpm v10.24.0

> ecash-wallet@5.1.0 build /work/modules/ecash-wallet
> tsc -p ./tsconfig.build.json

src/wallet.ts(924,46): error TS2339: Property 'sk' does not exist on type 'ActionableWallet'.
src/wallet.ts(931,42): error TS2339: Property 'pk' does not exist on type 'ActionableWallet'.
src/wallet.ts(1712,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(1715,34): error TS2339: Property 'getKeypairForAddress' does not exist on type 'ActionableWallet'.
src/wallet.ts(1743,35): error TS2339: Property 'ecc' does not exist on type 'ActionableWallet'.
src/wallet.ts(1778,38): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2456,26): error TS2345: Argument of type 'ActionableWallet' is not assignable to parameter of type 'Wallet'.
  Type 'ActionableWallet' is missing the following properties from type 'Wallet': sk, pk, tipHeight, _deriveKeypair, and 35 more.
src/wallet.ts(2472,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2517,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2519,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2536,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2545,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2547,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2552,22): error TS2339: Property 'updateBalance' does not exist on type 'ActionableWallet'.
/work/modules/ecash-wallet:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ecash-wallet@5.1.0 build: `tsc -p ./tsconfig.build.json`
Exit status 2
Build ecash-agora-tests failed with exit code 2

Tail of the build log:

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-tests
Lockfile is up to date, resolution step is skipped
Done in 911ms using pnpm v10.24.0

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-tests
Scope: 2 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 938ms using pnpm v10.24.0

> chronik-client@4.1.0 build /work/modules/chronik-client
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-tests
Scope: 4 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 991ms using pnpm v10.24.0

> ecash-lib@4.9.0 build /work/modules/ecash-lib
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/cashtab-tests
Scope: 5 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
.                                        |   +3 +
Progress: resolved 3, reused 0, downloaded 3, added 3, done
Done in 1.1s using pnpm v10.24.0

> ecash-wallet@5.1.0 build /work/modules/ecash-wallet
> tsc -p ./tsconfig.build.json

src/wallet.ts(924,46): error TS2339: Property 'sk' does not exist on type 'ActionableWallet'.
src/wallet.ts(931,42): error TS2339: Property 'pk' does not exist on type 'ActionableWallet'.
src/wallet.ts(1712,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(1715,34): error TS2339: Property 'getKeypairForAddress' does not exist on type 'ActionableWallet'.
src/wallet.ts(1743,35): error TS2339: Property 'ecc' does not exist on type 'ActionableWallet'.
src/wallet.ts(1778,38): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2456,26): error TS2345: Argument of type 'ActionableWallet' is not assignable to parameter of type 'Wallet'.
  Type 'ActionableWallet' is missing the following properties from type 'Wallet': sk, pk, tipHeight, _deriveKeypair, and 35 more.
src/wallet.ts(2472,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2517,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2519,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2536,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2545,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2547,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2552,22): error TS2339: Property 'updateBalance' does not exist on type 'ActionableWallet'.
/work/modules/ecash-wallet:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ecash-wallet@5.1.0 build: `tsc -p ./tsconfig.build.json`
Exit status 2
Build cashtab-tests failed with exit code 2

Tail of the build log:

[591/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionview.cpp.o
[592/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletframe.cpp.o
[593/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletmodeltransaction.cpp.o
[594/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o
[595/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletcontroller.cpp.o
[596/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletview.cpp.o
[597/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletmodel.cpp.o
[598/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin.cpp.o
[599/603] Linking CXX static library src/qt/libbitcoin-qt-base.a
[600/603] Automatic MOC for target bitcoin-qt
[601/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/bitcoin-qt_autogen/mocs_compilation.cpp.o
[602/603] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/main.cpp.o
[603/603] Linking CXX executable src/qt/bitcoin-qt
/work /work/abc-ci-builds/ecash-wallet-integration-tests
Scope: all 23 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
Packages: +2041
Progress: resolved 2041, reused 99, downloaded 377, added 479
Progress: resolved 2041, reused 99, downloaded 965, added 1087
Progress: resolved 2041, reused 99, downloaded 1509, added 1630
Progress: resolved 2041, reused 99, downloaded 1913, added 2036
Progress: resolved 2041, reused 99, downloaded 1918, added 2041, done

╭ Warning ─────────────────────────────────────────────────────────────────────╮
│                                                                              │
│   Ignored build scripts: @railway/cli, core-js, core-js-pure, esbuild,       │
│   mongodb-memory-server, sharp, styled-components.                           │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed     │
│   to run scripts.                                                            │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Done in 8.2s using pnpm v10.24.0
Scope: 5 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 1.1s using pnpm v10.24.0
/work/abc-ci-builds/ecash-wallet-integration-tests
/work/modules/ecash-wallet /work/abc-ci-builds/ecash-wallet-integration-tests

> ecash-wallet@5.1.0 build /work/modules/ecash-wallet
> tsc -p ./tsconfig.build.json

src/wallet.ts(924,46): error TS2339: Property 'sk' does not exist on type 'ActionableWallet'.
src/wallet.ts(931,42): error TS2339: Property 'pk' does not exist on type 'ActionableWallet'.
src/wallet.ts(1712,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(1715,34): error TS2339: Property 'getKeypairForAddress' does not exist on type 'ActionableWallet'.
src/wallet.ts(1743,35): error TS2339: Property 'ecc' does not exist on type 'ActionableWallet'.
src/wallet.ts(1778,38): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2456,26): error TS2345: Argument of type 'ActionableWallet' is not assignable to parameter of type 'Wallet'.
  Type 'ActionableWallet' is missing the following properties from type 'Wallet': sk, pk, tipHeight, _deriveKeypair, and 35 more.
src/wallet.ts(2472,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2517,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2519,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2536,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2545,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2547,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2552,22): error TS2339: Property 'updateBalance' does not exist on type 'ActionableWallet'.
 ELIFECYCLE  Command failed with exit code 2.
Build ecash-wallet-integration-tests failed with exit code 2

Tail of the build log:

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/the-overmind-tests
Lockfile is up to date, resolution step is skipped
Done in 941ms using pnpm v10.24.0

> ecashaddrjs@2.0.0 build /work/modules/ecashaddrjs
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/the-overmind-tests
Scope: 2 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 935ms using pnpm v10.24.0

> chronik-client@4.1.0 build /work/modules/chronik-client
> tsc

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/the-overmind-tests
Scope: 4 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Done in 1s using pnpm v10.24.0

> ecash-lib@4.9.0 build /work/modules/ecash-lib
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Preparing pnpm@10.24.0 for immediate activation...
/work /work/abc-ci-builds/the-overmind-tests
Scope: 5 of 23 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
.                                        |   +5 +
Progress: resolved 5, reused 0, downloaded 5, added 5, done
Done in 1.1s using pnpm v10.24.0

> ecash-wallet@5.1.0 build /work/modules/ecash-wallet
> tsc -p ./tsconfig.build.json

src/wallet.ts(924,46): error TS2339: Property 'sk' does not exist on type 'ActionableWallet'.
src/wallet.ts(931,42): error TS2339: Property 'pk' does not exist on type 'ActionableWallet'.
src/wallet.ts(1712,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(1715,34): error TS2339: Property 'getKeypairForAddress' does not exist on type 'ActionableWallet'.
src/wallet.ts(1743,35): error TS2339: Property 'ecc' does not exist on type 'ActionableWallet'.
src/wallet.ts(1778,38): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2456,26): error TS2345: Argument of type 'ActionableWallet' is not assignable to parameter of type 'Wallet'.
  Type 'ActionableWallet' is missing the following properties from type 'Wallet': sk, pk, tipHeight, _deriveKeypair, and 35 more.
src/wallet.ts(2472,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2517,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2519,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2536,30): error TS2339: Property 'isWalletScript' does not exist on type 'ActionableWallet'.
src/wallet.ts(2545,34): error TS2339: Property 'prefix' does not exist on type 'ActionableWallet'.
src/wallet.ts(2547,30): error TS2339: Property 'utxos' does not exist on type 'ActionableWallet'.
src/wallet.ts(2552,22): error TS2339: Property 'updateBalance' does not exist on type 'ActionableWallet'.
/work/modules/ecash-wallet:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ecash-wallet@5.1.0 build: `tsc -p ./tsconfig.build.json`
Exit status 2
Build the-overmind-tests failed with exit code 2
tobias_ruck added inline comments.
modules/ecash-lib/src/script.ts
180 ↗(On Diff #58517)
182 ↗(On Diff #58517)

I wouldn't use the term "redeem" and "scriptSig" here because you can also have a "bare" multisig (which is standard rn afaik), instead just make it build what is considered a multisig script

189 ↗(On Diff #58517)

?? what if someone wants to use an existing non-sorted pubkeys? then they can't use this function

better have callers sort it themselves

191 ↗(On Diff #58517)

there's a function to convert numbers to pushops

200 ↗(On Diff #58517)

for schnorr sigs, you have to use the dummy as bitset

200 ↗(On Diff #58517)

for schnorr multi sig you need to add the dummy bitset

see the spec: https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/2019-11-15-schnorrmultisig.md

203 ↗(On Diff #58517)

in line with e.g. p2pkh <-> p2pkhSpend

204 ↗(On Diff #58517)

I like to use undefined in ecash-lib; it's some policy that the typescript compiler also uses

205 ↗(On Diff #58517)

this should be optional Script, to allow for bare multisig

205 ↗(On Diff #58517)

Plus, you need a way to communicate the dummy bitset for schnorr multisig, probably a pubkeyIndices: Set<number> param is good, or just the dummy bitset right away

Could also add another function for that, but then this should be called multisigEcdsaSpend (not sure if a good idea)

222 ↗(On Diff #58517)

why not use this for the script? Feel free to change the name, this just feels the most "me" here

I added "P2sh" to make clear it's not for bare multisig (where you can't get that data other than signatures and kinda m)

223 ↗(On Diff #58517)
290 ↗(On Diff #58517)

better add a function to parse numbers—good idea to do this in a previous diff

bytesofman published this revision for review.Mar 7 2026, 14:43
tobias_ruck added inline comments.
modules/ecash-lib/src/op.ts
45

What about numbers >255? They can now be up to 64-bits

Might also make sense to split this into its own diff

modules/ecash-lib/src/txBuilder.ts
236

Shouldn’t this be another diff?

Odd to have that many new features in one diff

This revision now requires changes to proceed.Mar 7 2026, 14:50
bytesofman marked 2 inline comments as done.
bytesofman added inline comments.
modules/ecash-lib/src/op.ts
45

would we use this method to parse these larger numbers in other existing use cases? If so I think would make sense to put this in another diff, add the support, confirm it with regtest

As it stands, we are only using this method for parsing multi-sig, which does not cover this range (I think?)

I think the function doc comment as is explains the current scope. I don't think we need to overhaul this function for this diff. If there are other use cases, then there should be a separate diff extending this function and confirming that behavior in regtest.

modules/ecash-lib/src/txBuilder.ts
236

In this case, the goal is multisig for token actions, i.e. the behavior confirmed by the new integration tests in ecash-wallet

there are a lot of dependencies required to get that functionality, but we're really just adding one thing

imo that we are able to confirm the behavior we want with explicit regtest justifies including everything in one go; I'm not sure why we would want methods like this without full multisig tx support.

modules/ecash-lib/src/op.ts
45

yes, this is a public function, so it should work as an inverse of pushNumberOp. Otherwise it's super confusing for users.

this is library

modules/ecash-lib/src/txBuilder.ts
236

Yes, but having everything in one big diff makes it harder to review—and the other stuff should have good tests, like that the multisig is built correctly etc. by comparing the built scripts

bytesofman marked 2 inline comments as done.

superseded by improved PSBT implementations in ecash-lib; will put up a schnorr-only multisig diff for ecash-wallet using PSBT