What
Add new challenge transactions helpers to txnbuild to support verifying a challenge transaction that has multiple signatures. Add three new functions:
ReadChallengeTx: Read the details like the transaction and the client account ID out of the transaction.VerifyChallengeTxSigners: Verify that the signers of the transaction are a subset of a list of signers given to the function.VerifyChallengeTxThreshold: Verify that the signers of the transaction are a subset of a list of signers that meet a required threshold.
Deprecate VerifyChallengeTx.
Why
The SEP-10 change that is open in stellar/stellar-protocol#489 clarifies how an implementer should verify that signers of the transaction are signers on the account and that accounts may have multiple signers.
An implementer needs to read out of the transaction the client account before verifying the transaction. For this reason we need two functions, one to read out details we need before verification and one to perform verification.
The read call also validates the server signature because no challenge transaction would ever be valid to read if it wasn't signed by the server.
Known limitations
These helper functions take a decent amount of complexity away from an implementer, but they still leave a decent amount up to the implementer. An implementer would still need to make a call to Horizon. I think it might be out-of-scope of the txnbuild package to offer that additional logic and SEP-10 technically leaves the exact details of what happens there up to the implementer so it would also be difficult to implementer in a library function.
该提问来源于开源项目:stellar/go