peercoin / coinlib

The most feature-complete *coin library in the entire Dart/Flutter ecosystem.
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

Move signing logic to Input classes #10

Closed MatthewLM closed 1 year ago

MatthewLM commented 1 year ago

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.

MatthewLM commented 1 year ago

Completed