Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark input as external PSBT Partial sign #123

Closed
jafri opened this issue Feb 26, 2023 · 0 comments
Closed

Mark input as external PSBT Partial sign #123

jafri opened this issue Feb 26, 2023 · 0 comments

Comments

@jafri
Copy link

jafri commented Feb 26, 2023

I'm trying to combine inputs from 2 different ledger to create to output a single UTXO

Example:

Inputs
#0   |  0.1 BTC
#1   |  0.1 BTC

Outputs
#0   |  0.18 BTC

In bitcoinjs-lib, I'd do:
A. Sign a PSBT with input 0 and output 0 with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY
B. Sign for input 1 with SIGHASH_ALL

However A is not possible with ledger it seems to do a check of outputs < inputs

So I'm guessing the way to do this would be to provide the full inputs and outputs, while marking input 1 initially as external.

Is this correct? If so, how do I mark input 1 as external?

So far I have for a single payment:

    const result = await ledgerBtc.createPaymentTransaction({
      inputs: [
        [splitTx, +index, undefined, undefined],
      ],
      associatedKeysets: [`86'/0'/0'/0/0`],
      outputScriptHex,
      additionals: ['bech32m'],
      // sigHashType: BitcoinLikeSigHashType.SIGHASH_SINGLE | BitcoinLikeSigHashType.SIGHASH_ANYONECANPAY,
    });

This already throws an error if I uncomment sigHashType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant