DepositPreauth Ledger Entry
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
DepositPreauth Fields
In addition to the common fields, DepositPreauth
entries have the following fields:
Field | JSON Type | Internal Type | Required? | Description |
---|---|---|---|---|
Account | String | Account | Yes | The account that granted the preauthorization. (The destination of the preauthorized payments.) |
Authorize | String | Account | No | The account that received the preauthorization. (The sender of the preauthorized payments.) |
AuthorizeCredentials | Array | Array | No | The 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. |
LedgerEntryType | String | UInt16 | Yes | The value 0x0070 , mapped to the string DepositPreauth , indicates that this is a DepositPreauth object. |
OwnerNode | String | UInt64 | Yes | A 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 . |
PreviousTxnID | String - Hash | Hash256 | Yes | The identifying hash of the transaction that most recently modified this object. |
PreviousTxnLgrSeq | Number | UInt32 | Yes | The 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:
Field | JSON Type | Internal Type | Required? | Description |
---|---|---|---|---|
Issuer | String - Address | AccountID | Yes | The issuer of the credential. |
CredentialType | String - Hexadecimal | Blob | Yes | The 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.