XChain Platform Action - BATCH

This action batch executes multiple ACTION commands in a single transaction.

PARAMS

Name Type Description
VERSION String Format Version
COMMAND String Any valid ACTION with PARAMS

Formats

Version 0

  • VERSION|COMMAND;COMMAND

Examples

BATCH|0|MINT|0|XCHAIN|100;ISSUE|0|JDOG
This example mints 100 XCHAIN tokens and issues the JDOG token
BATCH|0|ISSUE|0|JDOG;ISSUE|0|JDOG.1;ISSUE|0|JDOG.2;ISSUE|0|JDOG.3
This example registers the JDOG parent token and three of its children in one transaction

Rules

  • Can only use one top-level (undotted) ISSUE action in a BATCH action
  • Child ISSUE actions, whose TICK contains a . (for example JDOG.1), are exempt from that limit: a BATCH may carry any number of them, subject to the command cap below
  • Can only use one MINT action per DISTINCT token in a BATCH action: minting several different tokens in one BATCH is allowed, minting the same token twice is not
  • Can not use BATCH as a action in a BATCH action
  • A BATCH may carry at most 250 commands
  • At/after the BATCH_COST_WEIGHTING activation, the cap becomes a weighted cost budget: the sub-commands’ cost weights must sum to at most 250 (see the weighted budget note below)

Notes

  • COMMANDS are separated by a semi-colon ;

  • Sub-commands are not atomic. Each command is validated and settled on its own, in list order, and each gets its own ACTION_INDEX and its own status. A command that fails is recorded invalid by itself; the commands before it stand and the commands after it are still attempted. What the transaction guarantees is a shared sender, a shared confirmation and a shared position in the block, not all-or-nothing settlement. Some faults do reject the whole BATCH as a single record before any command runs (see the batch-level rejections below), but a per-command validation failure is not one of them.

  • Bulk child issuance (flag-day gated). At/above the BATCH_ISSUANCE_LIMITS activation, an ISSUE whose TICK contains a . no longer consumes the single top-level ISSUE slot, so ISSUE JDOG; ISSUE JDOG.1; ISSUE JDOG.2; ... is one transaction rather than one transaction per child. The parent may be registered in the same BATCH as its children: a command reads the state left by every command before it, so a parent written at a lower action index is already visible to the child that follows. Repeated ISSUE commands against the SAME dotted TICK are also legal in one BATCH, which is what lets create, add supply, lock and transfer-ownership run as a sequence.

  • A caret TICK is never exempt. In the ^<id> form the dot is an id separator, not a namespace separator (see Index ID References), so ^614.5 counts against the top-level limit rather than being treated as a child. An ISSUE whose TICK is a caret form containing a . is invalid (invalid: TICK (caret dot)).

  • Command cap. A BATCH may carry at most 250 commands. The count is the raw ;-separated list after the BATCH|<VERSION>| prefix, including empty elements, so 250 commands followed by a trailing ; counts as 251 and is over the cap. The cap is checked FIRST, before every other batch-level rule, so a BATCH that breaks the cap and some other rule reports the cap (invalid: COMMAND (limit)). It is a denial-of-service bound rather than a product quota: an issuer with 500 children uses two transactions. Both the cap and the child exemption activate together at BATCH_ISSUANCE_LIMITS.

  • Weighted command budget (flag-day gated). At/after the BATCH_COST_WEIGHTING activation the flat count above becomes a cost budget: every sub-command carries a weight and the BATCH is refused when the weights sum to more than the weight budget of 250. The budget is the same number as the command cap on purpose: with the default weight of 1, an ordinary batch is admitted or refused exactly as before, including the error string (invalid: COMMAND (limit)). Three cost regimes:

    Class Actions Weight
    Ordinary every action not listed below 1 (default)
    Fan-out AIRDROP, DIVIDEND 25
    VM DEPLOY, EXECUTE, XEXEC 30

    Fan-out actions write a row per recipient, so one sub-command really is worth many; the weight is flat because the recipient count is not on the wire. VM actions run contract code, and the weight is sized so a full batch of worst-case VM sub-commands stays under the cost of 250 ordinary ones. A chunk-carrier DEPLOY (format 4) weighs the default 1 rather than the VM weight: it is short-circuited into chunk storage before any contract code runs, so it costs a row write, not a contract run. Every weight is an integer of at least 1, so the count cap remains a sound pre-filter and is still checked (and reported) first: a batch over the command cap is always over the budget too. The weighting replaces only the flat count; the fairness caps are unchanged and still apply independently: one MINT per distinct token, one top-level ISSUE, at most one DEPLOY, no nested BATCH. The gate is armed at genesis (0) on every network; mainnet was armed at 0 on 2026-09-09 under the mainnet genesis arm. The budget replaces BATCH_ISSUANCE_LIMITS’s command cap in the same first position and reuses its sub-command classification, so it is only consulted where that gate is also active: its effective mainnet activation is 2026-08-16T00:00:00Z, the same instant as BATCH_ISSUANCE_LIMITS, even though its own mainnet value sits numerically below that gate’s.

  • Fees and settlement value are accounted cumulatively across the batch. One command’s worth of native-coin fee funds ONE sub-command, not all of them. The same running tally covers the settlement value a COINPAY or a DISPENSE draws down and the per-oracle fee outputs a DISPENSER pays. Fund a BATCH for the sum of its commands, not for one of them; a command that reaches an exhausted fee pool fails with a fee error while its siblings stand.

  • Dispatched-action admission (flag-day gated). At and after ACTION_ADMISSION_DISPATCHED_ONLY, every sub-command’s normalized action name must identify an action the indexer’s dispatcher handles. Merely having an enabled action-registry entry is not enough. If any sub-command names an enabled but undispatched registry action, the whole BATCH is invalid: ACTION (unknown) and no sub-command runs. Mainnet and testnet currently carry the house UNARMED sentinel, so this rule has no public-network activation instant yet; regtest is active from genesis. Below the gate, replay retains the legacy registry-only admission check.

  • Batch-level rejections invalidate the whole BATCH as one record, before any command runs: an unknown VERSION, a command naming an action that is not enabled (an empty command counts), an undispatched registry action once ACTION_ADMISSION_DISPATCHED_ONLY is active, more than one MINT of the SAME token, more than one top-level ISSUE, a nested BATCH, a sleeping SOURCE, going over the command cap, and a source that provably cannot pay for even the cheapest command in the list (invalid: GAS (insufficient)). That last check is a lower bound only: gas is billed greedily in list order against one running balance, so a source that can afford some of the commands is let through and lands exactly the ones it can pay for.

  • Activation. The child-issuance exemption, the caret-dot rejection, the per-distinct-token MINT rule, the 250-command cap, the cumulative fee and settlement accounting, and the aggregate gas pre-check all activate together at BATCH_ISSUANCE_LIMITS. That gate is active from genesis on testnet and regtest, and on mainnet it has been active since 2026-08-16T00:00:00Z. Sub-command output capture (BATCH_SUBCOMMAND_OUTPUT_CAPTURE_ACTIVATION, which is what lets a batched COINPAY or DISPENSER be seen at all) armed at the same instant on mainnet, so the two halves of batch behavior arrived together rather than leaving a window where one is live and the other is not. Below that instant, mainnet history keeps the behavior it always had: one ISSUE per BATCH (dotted or not), one MINT per BATCH whatever token it names, no command cap, and per-command fee checks that each read the transaction’s untouched value. Blocks before the instant are unaffected, which is why the instant was set in the future rather than backdated. The non-atomic settlement described above is not gated: it has always been how a BATCH behaves.

  • Sub-action normalization (flag-day gated): at and after the BATCH_SUBACTION_NORMALIZATION activation, sub-actions inside a BATCH get the same alias rewrite and legacy VERSION-0 injection as top-level actions. That gate is active from genesis on testnet and regtest, and on mainnet it has been active since the coordinated contract-era flag day at 2026-08-07T00:00:00Z, so canonical ACTION names and an explicit VERSION are no longer required of a BATCH command on any live network. Below that instant, mainnet history keeps the unnormalized behavior, and a re-decode of those blocks must reproduce it: ACTION aliases (TRANSFER, ADDR, DROP, CAST, MSG) invalidate the whole BATCH (invalid: ACTION (unknown)), and legacy ISSUE/MINT/SEND params that omit the VERSION field are misparsed (the first param is read as the format version).

  • A BATCH may contain at most one FILE action, and nothing on the indexing path enforces it. The decoder exposes one raw_data payload per transaction and the batch dispatcher carries that same payload into every sub-command, so a second FILE is not rejected: it is recorded valid and stored with the FIRST file’s payload duplicated into its record. Because FILE records are immutable once mined, the mistake is silent and permanent. This is an architectural limit of the wire format, not an explicit actionLimits rule in batch.js; the SDK’s batch builder refuses to compose such a BATCH, but a caller hand-rolling encoder input must enforce the limit itself.

  • A FILE may be batched with other actions, most commonly a MESSAGE v2 (ECIES) carrying the file’s symmetric key, so that publishing a token-gated file and committing the key happen in one transaction. The two commands still settle independently, so check that both were recorded valid rather than assuming the pair moved as a unit.

  • BATCH(SEND, MESSAGE) is the canonical composition for transferring a token that has active gated content: the MESSAGE v2 re-encrypts the content keys to the recipient. It is required unless every pack gating that token sets an unlock threshold the recipient will still be below after the transfer (see GATE_MIN_AMOUNT); in that case a plain SEND with no MESSAGE is valid.


Copyright © 2025–2026 Dankest, LLC

Based on XChain Platform by Dankest, LLC – https://dankest.llc

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-or-later) with a commercial license available for proprietary use.

You may use, modify, and distribute this material under the terms of the License. See LICENSE and NOTICE for full terms. See the licensing overview.

Edit this page on GitHub ↗