Skip to content

Commit 1d85453

Browse files
authored
XLS-56: add integration considerations (#452)
* add integration considerations * one more * more feedback
1 parent 5e58546 commit 1d85453

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

XLS-0056-batch/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,39 @@ Namely:
565565
- Inner transactions may not be broadcast (and won't be accepted if they happen to be broadcast, e.g. from a malicious node). They must be generated from the `Batch` outer transaction instead.
566566
- Inner transactions may not be directly submitted via the `submit` RPC.
567567

568+
## 6. Integration Considerations
569+
570+
- An outer `Batch` transaction will return `tesSUCCESS` if the outer transaction succeeds, even if the inner transactions fail. The inner transaction metadata and result codes must be used to determine the actual outcome of each inner transaction.
571+
- The inner transactions, if validated, **will** be in the same ledger. If it is not in the same ledger, then it is likely a fraud attempt.
572+
- An inner `Batch` transaction will not be validated on its own.
573+
- Systems that don't specifically handle `Batch` transactions should be able to support them without any changes, since each inner transaction will be a valid transaction on its own.
574+
- All inner transactions that have a `tes` (success) or `tec` result code will be accessible via standard transaction-fetching mechanisms (such as `tx` and `account_tx`).
575+
- Since only the inner transactions and batch mode flags are signed in a multi-account `Batch` transaction, the relayer (submitter of the outer transaction) can adjust the sequence number and fee of the outer transaction as needed, without needing to coordinate with the other parties.
576+
577+
### 6.1. Client Libraries
578+
579+
- `Batch` transactions have a special fee calculation that includes the sum of the inner transaction fees. Client libraries should provide a helper method to calculate the fee for a `Batch` transaction.
580+
- Multi-account `Batch` transactions require a special signing flow where one party signs the outer transaction and the other parties sign the inner transactions. Client libraries should provide a helper method to construct a multi-account `Batch` transaction.
581+
- When auto-filling a `Batch` transaction, the inner transactions must have their `Fee` set to 0 and the `SigningPubKey` and `TxnSignature` fields must be empty. Client libraries should provide a helper method to auto-fill a `Batch` transaction.
582+
583+
### 6.2. Wallets
584+
585+
Wallets should:
586+
587+
- Clearly display all inner transactions to users before requesting a signature, so users understand the full scope of what they are approving.
588+
- For multi-account `Batch` transactions, provide a workflow for users to review and sign their portion of the batch, then export it for other parties to sign.
589+
- Warn users if they are signing a `Batch` transaction that includes inner transactions from other accounts, as they are approving the entire batch.
590+
- Display the batch mode (`ALLORNOTHING`, `ONLYONE`, `UNTILFAILURE`, `INDEPENDENT`) and explain its implications.
591+
- Not auto-increment sequence numbers after successes/failures, since it depends on what/how many transactions are validated.
592+
593+
### 6.3. Explorers and Indexers
594+
595+
Explorers and indexers should:
596+
597+
- Display the relationship between outer `Batch` transactions and their inner transactions using the `ParentBatchID` field.
598+
- Show inner transactions in context with their parent `Batch` transaction, rather than as standalone transactions.
599+
- Consider grouping inner transactions with their outer transaction in transaction lists for clarity.
600+
568601
# Appendix
569602

570603
## Appendix A: FAQ

0 commit comments

Comments
 (0)