LedgerHQ/ledger-live-common

[Stellar]: Message and check for multisign are both wrong.

Kanaye opened this issue · 1 comments

grafik
This message is missleading and disabling the ability to send XLM based on this condition

is just wrong.

In Stellar multisign doesn't mean "You need all signers signature to sign a transaction" but "you need a combined weight of signers to be equal or greater than the transactions treshold". See: https://developers.stellar.org/docs/glossary/multisig/#authorization

What a correct implementation would look like:

  1. determine the type of treshold the transaction would require "low", "medium" or "high" (afaik ledger live currently only uses payment and create account operation, which are "medium". But correct me if I'm wrong).
  2. fetch the determined threshold from the account object. The account object is probably already beeing fetched somewhere in the codebase, but I'm not familiar with it, so can't tell.
  3. determine the weight of the ledger key. This is done by looking up the public key in the account objects "signers".
  4. Compare if determined_threshold <= determinded_signer_weight. If so: proceed as the transaction is valid. If not: show some message telling that the transactions isn't signable with only this key.

If you wish, I might be able to take the time to make a PR for this.

Also please provide feedback about your thoughts about this.

Hi @Kanaye thanks a lot for your feedback and sorry for the late answer.

We simply don't support Stellar multisign in Ledger Live, hence the basic signers.length > 1 condition.
You are right that the error message is misleading, it should maybe say "...to send Stellar with Ledger Live".

Your proposed implementation seems correct, a PR is always welcome.

Thanks again.