obsidiansystems / ledger-app-nervos

MIT License
10 stars 10 forks source link

[LEDGERJS] Suggest renaming API signTransaction to signWitness #160

Closed katat closed 4 years ago

katat commented 4 years ago

as per https://github.com/obsidiansystems/ledger-app-nervos/issues/145#issuecomment-672887250

The function of signTransaction is intended to sign a witness instead of a whole transaction. If so, it would be better to rename the signTransaction to signWitnesses to avoid confusions.

signTransaction seems implying it only needs to sign once for a transaction. But in reality, it is likely to do multiple times for a transaction under the context of HD wallet.

jonored commented 4 years ago

That would imply that it's signing just a witness, somehow, rather than signing the whole transaction and producing a witness. In general you need to sign the same transaction multiple times even if this looped over all the keys available from the ledger, you might have a mix of inputs from the ledger keys and not from the ledger keys, or indeed from completely separate individuals.

katat commented 4 years ago

Make senses to me