Class SignOptions
-
- All Implemented Interfaces:
public final class SignOptionsOptions for a software signer.
Adjust the behavior of our software signers and the way a transaction is finalized.
-
-
Field Summary
Fields Modifier and Type Field Description private BooleantrustWitnessUtxoprivate UIntassumeHeightprivate BooleanallowAllSighashesprivate BooleantryFinalizeprivate BooleansignWithTapInternalKeyprivate BooleanallowGrinding
-
Method Summary
Modifier and Type Method Description final BooleangetTrustWitnessUtxo()Whether the signer should trust the witness_utxo, if thenon_witness_utxohasn't been providedDefaults tofalseto mitigate the "SegWit bug" which could trick the wallet into paying a fee larger than expected.final UnitsetTrustWitnessUtxo(Boolean trustWitnessUtxo)Whether the signer should trust the witness_utxo, if thenon_witness_utxohasn't been providedDefaults tofalseto mitigate the "SegWit bug" which could trick the wallet into paying a fee larger than expected.final UIntgetAssumeHeight()Whether the wallet should assume a specific height has been reached when trying to finalize a transactionThe wallet will only "use" a timelock to satisfy the spending policy of an input if the timelock height has already been reached. final UnitsetAssumeHeight(UInt assumeHeight)Whether the wallet should assume a specific height has been reached when trying to finalize a transactionThe wallet will only "use" a timelock to satisfy the spending policy of an input if the timelock height has already been reached. final BooleangetAllowAllSighashes()Whether the signer should use the sighash_typeset in the PSBT when signing, no matter what its value isDefaults tofalsewhich will only allow signing usingSIGHASH_ALL.final UnitsetAllowAllSighashes(Boolean allowAllSighashes)Whether the signer should use the sighash_typeset in the PSBT when signing, no matter what its value isDefaults tofalsewhich will only allow signing usingSIGHASH_ALL.final BooleangetTryFinalize()Whether to try finalizing the PSBT after the inputs are signed. final UnitsetTryFinalize(Boolean tryFinalize)Whether to try finalizing the PSBT after the inputs are signed. final BooleangetSignWithTapInternalKey()Whether we should try to sign a taproot transaction with the taproot internal key or not. final UnitsetSignWithTapInternalKey(Boolean signWithTapInternalKey)Whether we should try to sign a taproot transaction with the taproot internal key or not. final BooleangetAllowGrinding()Whether we should grind ECDSA signature to ensure signing with low r or not. final UnitsetAllowGrinding(Boolean allowGrinding)Whether we should grind ECDSA signature to ensure signing with low r or not. -
-
Method Detail
-
getTrustWitnessUtxo
final Boolean getTrustWitnessUtxo()
Whether the signer should trust the
witness_utxo, if thenon_witness_utxohasn't been providedDefaults to
falseto mitigate the "SegWit bug" which could trick the wallet into paying a fee larger than expected.Some wallets, especially if relatively old, might not provide the
non_witness_utxofor SegWit transactions in the PSBT they generate: in those cases setting this totrueshould correctly produce a signature, at the expense of an increased trust in the creator of the PSBT.For more details see: https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd
-
setTrustWitnessUtxo
final Unit setTrustWitnessUtxo(Boolean trustWitnessUtxo)
Whether the signer should trust the
witness_utxo, if thenon_witness_utxohasn't been providedDefaults to
falseto mitigate the "SegWit bug" which could trick the wallet into paying a fee larger than expected.Some wallets, especially if relatively old, might not provide the
non_witness_utxofor SegWit transactions in the PSBT they generate: in those cases setting this totrueshould correctly produce a signature, at the expense of an increased trust in the creator of the PSBT.For more details see: https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd
-
getAssumeHeight
final UInt getAssumeHeight()
Whether the wallet should assume a specific height has been reached when trying to finalize a transaction
The wallet will only "use" a timelock to satisfy the spending policy of an input if the timelock height has already been reached. This option allows overriding the "current height" to let the wallet use timelocks in the future to spend a coin.
-
setAssumeHeight
final Unit setAssumeHeight(UInt assumeHeight)
Whether the wallet should assume a specific height has been reached when trying to finalize a transaction
The wallet will only "use" a timelock to satisfy the spending policy of an input if the timelock height has already been reached. This option allows overriding the "current height" to let the wallet use timelocks in the future to spend a coin.
-
getAllowAllSighashes
final Boolean getAllowAllSighashes()
Whether the signer should use the
sighash_typeset in the PSBT when signing, no matter what its value isDefaults to
falsewhich will only allow signing usingSIGHASH_ALL.
-
setAllowAllSighashes
final Unit setAllowAllSighashes(Boolean allowAllSighashes)
Whether the signer should use the
sighash_typeset in the PSBT when signing, no matter what its value isDefaults to
falsewhich will only allow signing usingSIGHASH_ALL.
-
getTryFinalize
final Boolean getTryFinalize()
Whether to try finalizing the PSBT after the inputs are signed.
Defaults to
truewhich will try finalizing PSBT after inputs are signed.
-
setTryFinalize
final Unit setTryFinalize(Boolean tryFinalize)
Whether to try finalizing the PSBT after the inputs are signed.
Defaults to
truewhich will try finalizing PSBT after inputs are signed.
-
getSignWithTapInternalKey
final Boolean getSignWithTapInternalKey()
Whether we should try to sign a taproot transaction with the taproot internal key or not. This option is ignored if we're signing a non-taproot PSBT.
Defaults to
true, i.e., we always try to sign with the taproot internal key.
-
setSignWithTapInternalKey
final Unit setSignWithTapInternalKey(Boolean signWithTapInternalKey)
Whether we should try to sign a taproot transaction with the taproot internal key or not. This option is ignored if we're signing a non-taproot PSBT.
Defaults to
true, i.e., we always try to sign with the taproot internal key.
-
getAllowGrinding
final Boolean getAllowGrinding()
Whether we should grind ECDSA signature to ensure signing with low r or not. Defaults to
true, i.e., we always grind ECDSA signature to sign with low r.
-
setAllowGrinding
final Unit setAllowGrinding(Boolean allowGrinding)
Whether we should grind ECDSA signature to ensure signing with low r or not. Defaults to
true, i.e., we always grind ECDSA signature to sign with low r.
-
-
-
-