Skip to content

Updated Common Transaction Fields

This page describes the new fields and flags added to all transactions to support Sponsored Fees and Reserves. These fields extend the existing common transaction fields.

(Requires the Sponsor amendment )

New Common Fields

The following fields are added to the common transaction fields:

Field NameJSON TypeInternal TypeRequired?Description
SponsorStringAccountIDNoThe address of the sponsoring account.
SponsorFlagsNumberUInt32NoFlags indicating the type of sponsorship. If included, at least one flag must be set.
SponsorSignatureObjectObjectNoContains the signing information for the sponsorship.

SponsorFlags

The SponsorFlags field allows the user to specify which sponsorship type(s) they wish to participate in.

Flag NameHex ValueDecimal ValueDescription
spfSponsorFee0x000000011Sponsoring the fee of the transaction.
spfSponsorReserve0x000000022Sponsoring the reserve for any objects created in the transaction.
Note

Both flags can be used together in a single transaction. At least one flag must be set if the Sponsor field is included.

SponsorSignature

The SponsorSignature field is an object containing the sponsor's signing information.

Field NameJSON TypeInternal TypeRequired?Description
SigningPubKeyStringBlobNoThe SigningPubKey for the Sponsor, if single-signing.
TxnSignatureStringBlobNoA signature of the transaction from the sponsor, to indicate their approval of this transaction, if single-signing.
SignersArrayArrayNoAn array of signatures of the transaction from the sponsor's signers to indicate their approval of this transaction, if the sponsor is multi-signing.

These fields are not included in transaction signatures, though they are still included in the stored transaction. There is no additional transaction fee for using TxnSignature.

Note

A sponsor signature is only required if no pre-funded Sponsorship object exists, or if the lsfSponsorshipRequireSignForFee or lsfSponsorshipRequireSignForReserve flags are enabled on the Sponsorship ledger entry.

Transaction Fee Calculation

If the SponsorSignature.Signers field is necessary, the total fee of the transaction will be increased due to the extra signatures that need to be processed. This is similar to the additional fees for multi-signing.

The total fee calculation for signatures is:

(1 + |tx.Signers| + |tx.SponsorSignature.Signers|) × base_fee (+ any transaction-specific fees)

Error Cases

The following failure conditions have been added to transactions using the sponsorship fields:

Error CodeDescription
temDISABLEDThe Sponsor amendment is not enabled.
temMALFORMEDThe transaction is malformed. This can occur when:
  • The sponsor and the transaction sender are the same account.
  • The transaction includes a sponsor signature but does not specify a sponsor.
  • The sponsor signature contains an invalid combination of signing fields.
temINVALID_FLAGThe transaction has invalid flags. This can occur when:
  • The SponsorFlags field contains invalid flags. Valid flags are spfSponsorFee and spfSponsorReserve.
  • The transaction includes SponsorFlags but does not specify a sponsor.
  • The SponsorFlags field is included but set to zero.
terNO_ACCOUNTThe sponsor account does not exist.
tefBAD_AUTHThe sponsor signature is invalid. The public key does not match the sponsor account's master key or regular key, or the key type is unknown.
tefNOT_MULTI_SIGNINGThe sponsor account does not have a signer list.
tefBAD_SIGNATUREThe sponsor multi-signature is invalid. A signer is not in the signer list, a public key is invalid, or a signature is invalid.
tefBAD_QUORUMThe sponsor multi-signature does not meet the required quorum.
telINSUF_FEE_PThe sponsor account does not have enough XRP to pay the transaction fee.
terNO_SPONSORSHIPThe transaction requires a sponsor signature, but none was provided. This can occur when:
  • No pre-funded Sponsorship object exists.
  • The Sponsorship object requires a signature for fee sponsorship.
  • The Sponsorship object requires a signature for reserve sponsorship.
terINSUF_FEE_BThe pre-funded Sponsorship object does not have enough XRP in FeeAmount, or the transaction fee exceeds MaxFee.
tecINSUFF_FEEThe pre-funded Sponsorship object does not have enough XRP in FeeAmount, or the transaction fee exceeds MaxFee. This error occurs on a closed ledger when the balance is non-zero.
tecINSUFFICIENT_RESERVEThe sponsor does not have enough XRP to cover the reserve, or the pre-funded Sponsorship object does not have enough remaining ReserveCount.