DepositPreauth Ledger Entry

[Source]

A DepositPreauth entry tracks a preauthorization from one account. Anyone can send DepositPreauth transactions to create these entries, but they have no effect unless you are using Deposit Authorization.

A preauthorization allows specific others to send money directly to you even if you have Deposit Authorization enabled. Preauthorizations are one-directional, and have no effect on payments going the opposite direction.

You can preauthorize a specific account or a set of credentials. In the case of a set of credentials, any account that has a matching set of credentials on-ledger can send you money.

Example DepositPreauth JSON

{
  "LedgerEntryType": "DepositPreauth",
  "Account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
  "Authorize": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de",
  "Flags": 0,
  "OwnerNode": "0000000000000000",
  "PreviousTxnID": "3E8964D5A86B3CD6B9ECB33310D4E073D64C865A5B866200AD2B7E29F8326702",
  "PreviousTxnLgrSeq": 7,
  "index": "4A255038CC3ADCC1A9C91509279B59908251728D0DAADB248FFE297D0F7E068C"
}

DepositPreauth Fields

In addition to the common fields, DepositPreauth entries have the following fields:

FieldJSON TypeInternal TypeRequired?Description
AccountStringAccountYesThe account that granted the preauthorization. (The destination of the preauthorized payments.)
AuthorizeStringAccountNoThe account that received the preauthorization. (The sender of the preauthorized payments.)
AuthorizeCredentialsArrayArrayNoThe set of credentials that received preauthorization. (Any account with these credentials is preauthorized.) This array has a minimum length of 1 and a maximum length of 8 credentials.
LedgerEntryTypeStringUInt16YesThe value 0x0070, mapped to the string DepositPreauth, indicates that this is a DepositPreauth object.
OwnerNodeStringUInt64YesA hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages. Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.
PreviousTxnIDString - HashHash256YesThe identifying hash of the transaction that most recently modified this object.
PreviousTxnLgrSeqNumberUInt32YesThe index of the ledger that contains the transaction that most recently modified this object.

Each entry must have either the Authorize field or the AuthorizeCredentials field, but not both.

Authorized Credential Objects

If the entry has an AuthorizeCredentials field, each member of that array is an inner object, identifying one credential to require, with the following format:

FieldJSON TypeInternal TypeRequired?Description
IssuerString - AddressAccountIDYesThe issuer of the credential.
CredentialTypeString - HexadecimalBlobYesThe credential type of the credential.

To be preauthorized, an account must hold all the specified credentials.

DepositPreauth Flags

There are no flags defined for DepositPreauth entries.

DepositPreauth Reserve

DepositPreauth entries count as one item towards the owner reserve of the account that granted preauthorization, as long as the entry is in the ledger. Unauthorizing the counterparty frees up the reserve.

DepositPreauth ID Format

There are two formats for the ID of a DepositPreauth entry, depending on whether it authorizes an individual account or a set of credentials.

Individual Account Preauthorization

In this case, the ID is the SHA-512Half of the following values, concatenated in order:

  • The DepositPreauth space key (0x0070)
  • The AccountID of the owner of this object (the sender of the [DepositPreauth transaction][] that created this object; in other words, the one that granted the preauthorization)
  • The AccountID in the Authorize field

Credential Preauthorization

In this case, the ID is the SHA-512Half of the following values, concatenated in order:

  • The Credential Preauth space key (0x0050)
  • The AccountID of the owner of this object (the sender of the [DepositPreauth transaction][] that created this object; in other words, the one that granted the preauthorization)
  • The contents of the AuthorizeCredentials field.