The Transaction.sign() method should delegate signing logic to the Input classes with new sign() methods. The method interface shall be unique to legacy, v0 witness and (later) taproot inputs. An interface for the sign methods shall be provided in new LegacyInput and LegacyWitnessInput classes.
The sign methods shall include the transaction object, signing key, input number, hash type and, for witness inputs, the input value. The methods will return a new input with the appropriate signature added. The Transaction.sign() method will call the input's sign method and return a new Transaction with the new input.
The
Transaction.sign()
method should delegate signing logic to theInput
classes with newsign()
methods. The method interface shall be unique to legacy, v0 witness and (later) taproot inputs. An interface for the sign methods shall be provided in newLegacyInput
andLegacyWitnessInput
classes.The sign methods shall include the transaction object, signing key, input number, hash type and, for witness inputs, the input value. The methods will return a new input with the appropriate signature added. The
Transaction.sign()
method will call the input's sign method and return a newTransaction
with the new input.