bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 28쪽 중 21쪽
r account for a cross-chain bridge.
XChainAddAccountCreateAttestation
Requires:
Requires the
XChainBridge
.
Loading...
Provide an attestation that an XChainAccountCreateCommit transaction occurred on another chain, for a cross-chain bridge.
XChainAddClaimAttestation
Requires:
Requires the
XChainBridge
.
Loading...
Provide an attestation that an XChainCommit transaction occurred on another chain, for a cross-chain bridge.
XChainClaim
Requires:
Requires the
XChainBridge
.
Loading...
Complete a cross-chain transfer of value by claiming the value on the destination chain.
XChainCommit
Requires:
Requires the
XChainBridge
.
Loading...
Start a cross-chain transfer of value.
XChainCreateBridge
Requires:
Requires the
XChainBridge
.
Loading...
Create a bridge between two chains.
XChainCreateClaimID
Requires:
Requires the
XChainBridge
.
Loading...
Create a cross-chain claim ID that is used for a cross-chain transfer.
XChainModifyBridge
Requires:
Requires the
XChainBridge
.
Loading...
Modify the parameters of a cross-chain bridge.
Other
Batch
Requires:
Requires the
BatchV1_1
.
Loading...
Create and submit a batch of up to 8 transactions that succeed or fail atomically.
LedgerStateFix
Requires:
Requires the
fixNFTokenPageLinks
.
Loading...
Repair corruptions to the XRP ledger's state data.
## /docs/references/protocol/ledger-data/ledger-entry-types
Ledger Entry Types
Copy
Each
ledger version
's state data is a set of
ledger objects
, sometimes called
ledger entries
, which collectively represent all settings, balances, and relationships at a given point in time. To store or retrieve an object in the state data, the protocol uses that object's unique
Ledger Object ID
.
In the
peer protocol
, ledger objects have a
canonical binary format
. In
xrpld
APIs, ledger objects are represented as JSON objects.
A ledger object's data fields depend on the type of object; the XRP Ledger supports the following types:
AccountRoot
The settings, XRP balance, and other metadata for one account.
Amendments
The status of enabled and pending amendments.
AMM
The definition and details of an Automated Market Maker (AMM) instance.
Bridge
A single cross-chain bridge that connects and enables value to move efficiently between two blockchains.
Check
A check that can be redeemed for money by its destination.
Credential
A credential, which can be used to preauthorize payments or gain access to specific permissioned domains.
Delegate
A record of which permissions have been granted to another account.
DepositPreauth
A record of preauthorization for sending payments to an account that requires authorization.
DID
A Decentralized Identifier (DID).
DirectoryNode
A set of links to other ledger entries, either objects owned by an account or trades in the decentralized exchange.
Escrow
An escrow, which holds funds to be released when certain conditions are met.
FeeSettings
The current base transaction cost and reserve requirements.
LedgerHashes
Lists of prior ledger versions' hashes for history lookup.
Loan
A Loan ledger entry represents the terms of a loan between a borrower and loan issuer.
LoanBroker
A LoanBroker ledger entry represents the configuration and state of a lending protocol instance.
MPToken
Multi-Purpose Tokens (MPT) of one issuance held by a specific account.
MPTokenIssuance
Definition of a Multi-Purpose Token (MPT) issuance.
NegativeUNL
List of validators currently believed to be offline.
NFTokenOffer
An offer to buy or sell an NFT.
NFTokenPage
A group of up to 32 NFTs, stored together for efficiency.
Offer
An offer (order) to trade currencies in the decentralized exchange.
Oracle
A record of price information about currency pairs from an outside source.
PayChannel
A payment channel, which allows for rapid, asynchronous payments.
PermissionedDomain
A permissioned domain, which is used to limit access to other features.
RippleState
A trust line, which tracks the net balance of fungible tokens between two accounts.
SignerList
A list of addresses for multi-signing transactions.
Sponsorship
A Sponsorship ledger entry represents a sponsoring relationship between two accounts.
Ticket
A ticket, which sets aside a sequence number for use in a future transaction.
Vault
A Vault object defines the state of a tokenized vault.
XChainOwnedClaimID
A cross-chain transfer of value.
XChainOwnedCreateAccountClaimID
A record of attestations for creating an account via a cross-chain transfer.
## /docs/references/protocol/data-types/basic-data-types
Basic Data Types
Copy
Different types of objects are uniquely identified in different ways:
Accounts
are identified by their
Address
, for example
"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
. Addresses always start with "r". Many
xrpld
methods also accept a hexadecimal representation.
Transactions
are identified by a
Hash
of the transaction's binary format. You can also identify a transaction by its sending account and
Sequence Number
.
Each closed
Ledger
has a
Ledger Index
and a
Hash
value. When
Specifying Ledgers
you can use either one.
Addresses
Accounts in the XRP Ledger are identified by an address in the XRP Ledger's
base58
format. The address is derived from the account's master
public key
, which is in turn derived from a secret key. An address is represented as a string in JSON and has the following characteristics:
Between 25 and 35 characters in length
Starts with the character
r
Uses alphanumeric characters, excluding the number "
0
" capital letter "
O
", capital letter "
I
", and lowercase letter "
l
"
Case-sensitive
Includes a 4-byte checksum so that the probability of generating a valid address from random characters is approximately 1 in 2
32
Note
There is also an
X
-address format that "packs" a
destination tag
into the address. These addresses start with an
X
(for Mainnet) or a
T
(for
test networks
). Exchanges and wallets can use X-addresses to represent all the data a customer needs to know in one value. For more information, see the
X-address format site
and
codec
.
The XRP Ledger protocol only supports "classic" addresses natively, but many
client libraries
support X-addresses too.
Hashes
Many objects in the XRP Ledger, particularly transactions and ledgers, are uniquely identified by a 256-bit hash value. This value is typically calculated as a "SHA-512Half", which calculates a
SHA-512
hash from some contents, then takes the first half of the output. (That's 256 bits, which is 32 bytes, or 64 characters of the hexadecimal representation.) Since the hash of an object is derived from the contents in a way that is extremely unlikely to produce collisions, two objects with the same hash can be considered the same.
An XRP Ledger hash value has the following characteristics:
Exactly 64 characters in length
Hexadecimal
character set: 0-9 and A-F.
Typically written in upper case.
Note
SHA-512Half has similar security to the officially-defined
SHA-512/256
hash function. However, the XRP Ledger's usage predates SHA-512/256 and is also easier to implement on top of an existing SHA-512 function. (As of this writing, SHA-512 support in cryptographic libraries is much more common than for SHA-512/256.)
Hash Prefixes
[Source]
In many cases, the XRP Ledger prefixes an object's binary data with a 4-byte code before calculating its hash, so that objects of different types have different hashes even if their binary formats are the same. The existing 4-byte codes are structured as three alphabetic characters, encoded as ASCII, followed by a zero byte.
Some types of hash appear in API requests and responses. Others are only calculated as the first step of signing a certain type of data, or calculating a higher-level hash. The following table shows all 4-byte hash prefixes the XRP Ledger uses:
Object Type
API Fields
Hash Prefix (Hex)
Hash Prefix (Text)
Consensus proposal
N/A
0x50525000
PRP\0
Ledger Version
ledger_hash
0x4C575200
LWR\0
Ledger state data
account_state
in
ledger header
0x4D4C4E00
MLN\0
Ledger data inner node
N/A
0x4D494E00
MIN\0
Ledger data inner node (
SHAMapv2
)
N/A
0x494E5200
INR\0
Payment Channel Claim
N/A
0x434C4D00
CLM\0
Signed Transaction
hash
of transactions
0x54584E00
TXN\0
Transaction with metadata
N/A
0x534E4400
SND\0
Unsigned Transaction (Single-signing)
N/A
0x53545800
STX\0
Unsigned Transaction (Multi-signing)
N/A
0x534D5400
SMT\0
Counterparty Signature (Single-signing)
N/A
0x43505400
CPT\0
Counterparty Signature (Multi-signing)
N/A
0x43504D00
CPM\0
Sponsor Signature (Single-signing)
N/A
0x53504E00
SPN\0
Sponsor Signature (Multi-signing)
N/A
0x53504D00
SPM\0
Validation vote
N/A
0x56414C00
VAL\0
Validator manifest
N/A
0x4D414E00
MAN\0
Batch
N/A
0x42434800
BCH\0
Ledger objects IDs
are calculated in a similar way, but they use a 2-byte prefix called a "space key" instead of a prefix in the form described here.
Account Sequence
A sequence number is a 32-bit unsigned integer that is used to make sure transactions from a given sender execute only once each, and in the correct order.
Every
account in the XRP Ledger
has a sequence number in its
Sequence
field, which increases by 1 whenever that account sends a transaction and that transaction gets included in a
validated ledger
. Each
transaction
also has a sequence number in its
Sequence
field, which must match the account's current sequence number when the transaction executes. For each account, each sequence number can only be used once, in numerical order.
Tickets
make some exceptions from these rules so that it is possible to send transactions out of the normal order. Tickets represent sequence numbers reserved for later use; a transaction can use a Ticket instead of a normal sequence number.
With the
DeletableAccounts amendment
, the starting
Sequence
number for an account matches the
Ledger Index
of the ledger version where the account was created. Before DeletableAccounts, every account started with
Sequence
number 1.
Whenever a transaction is included in a ledger, it uses up a sequence number (or Ticket) regardless of whether the transaction executed successfully or failed with a
tec
-class error code
. Other transaction failures don't get included in ledgers, so they don't change the sender's sequence number (or have any other effects).
Within the ledger, an
Address
and a sequence number are sometimes used together to identify an object that was created by the validated transaction with that sender and sequence number.
Escrows
and
Offers
are examples of objects identified this way.
It is possible for multiple unconfirmed transactions to have the same sender and sequence number. Such transactions are mutually exclusive, and at most one of them can be included in a validated ledger. (Any others ultimately have no effect.)
Ledger Index
A ledger index is a 32-bit unsigned integer used to identify a ledger. The ledger index is sometimes known as the ledger's
sequence number
. (This is different from an
account sequence
.) The very first ledger was ledger index 1, and each new ledger has a ledger index that is 1 higher than the ledger index of the ledger immediately before it.
The ledger index indicates the order of the ledgers; the
hash
value identifies the exact contents of the ledger. Two ledgers with the same hash are always the same. For validated ledgers, hash values and ledger indexes are equally valid and correlate 1:1. However, this is not true for in-progress ledgers:
Two different
xrpld
servers may have different contents for a current ledger with the same ledger index, due to latency in propagating transactions throughout the network.
There may be multiple closed ledger versions competing to be validated by consensus. These ledger versions have the same ledger index but different contents (and different hashes). Only one of these closed ledgers can become validated.
The current open ledger's hash is not calculated. This is because a current ledger's contents change over time, which would cause its hash to change, even though its ledger index stays the same. The hash of a ledger is only calculated when the ledger is closed.
Specifying Ledgers
Many API methods require you to specify an instance of the ledger, with the data retrieved being considered up-to-date as of that particular version of the shared ledger. The commands that accept a ledger version all work the same way. There are three ways you can specify which ledger you want to use:
Specify a ledger by its
Ledger Index
in the
ledger_index
parameter. Each closed ledger has a ledger index that is 1 higher than the previous ledger. (The very first ledger had ledger index 1.)
"ledger_index": 61546724
Specify a ledger by its
Hash
value in the
ledger_hash
parameter.
"ledger_hash": "8BB204CE37CFA7A021A16B5F6143400831C4D1779E6FE538D9AC561ABBF4A929"
Specify a ledger by one of the following shortcuts, in the
ledger_index
parameter:
validated
for the most recent ledger that has been
validated by consensus
"ledger_index": "validated"
closed
for the most recent ledger that has been closed for modifications and proposed for validation
current
for the server's current working version of the ledger.
There is also a deprecated
ledger
parameter which accepts any of the above three formats.
Do not
use this parameter; it may be removed without further notice.
If you do not specify a ledger, the server decides which ledger to use to serve the request. By default, peer-to-peer servers chooses the
current
(in-progress) ledger. Clio servers use the most recent validated ledger instead. Do not provide more than one field specifying ledgers.
Note
Do not rely on the default behavior for specifying a ledger; it is subject to change. Always specify a ledger version in the request if you can.
Clio servers only record validated ledger data. If you make a request to a Clio server for the
current
or
closed
ledger, the server forwards the request to a P2P Mode server. If you request a ledger index or hash that is not validated, Clio responds with a
lgrNotFound
error.
Specifying Currency Amounts
There are three kinds of currencies in the XRP Ledger: XRP, tokens, and MPTs. These three types of currencies are specified in different formats, with different precision and rounding behavior.
Some fields, such as the destination
Amount
of a
Payment transaction
, can be either type. Some fields only accept XRP specifically, such as the
Fee
field (
transaction cost
).
XRP is specified as a string containing an integer number of "drops" of XRP, where 1 million drops equals 1 XRP. Tokens are instead specified as an object with fields for the decimal amount, currency code, and issuer. For example:
XRP
- To specify an
Amount
field with a value of 13.1 XRP:
"Amount": "13100000"
Token
- To specify an
Amount
field with a value of 13.1 FOO issued by or to
rf1B...
:
"Amount": {
"value": "13.1",
"currency": "FOO",
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
}
MPT
- Use
Amount
to specify the value of an MPT. Assuming an
AssetScale
of
1
, you would specify a value of 13.1 units of an MPT as follows:
"Amount": {
"mpt_issuance_id":
"0000012FFD9EE5DA93AC614B4DB94D7E0FCE415CA51BED47",
"value": "131"
}
For more information, see
Currency Formats
.
Specifying Time
The
xrpld
server and its APIs represent time as an unsigned integer. This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC). This is like the way the
Unix epoch
works, except the Ripple Epoch is 946684800 seconds after the Unix Epoch.
Don't convert Ripple Epoch times to UNIX Epoch times in 32-bit variables: this could lead to integer overflows.
## /docs/references/http-websocket-apis/public-api-methods
Public API Methods
Copy
Communicate directly with an
XRP Ledger server
using the public API methods. Public methods are not necessarily meant for the general public, but they are used by any client attached to the server. Think of public methods as being for members or customers of the organization running the server.
Account Methods
An account in the XRP Ledger represents a holder of XRP and a sender of transactions. Use these methods to work with account info.
account_channels
- Get a list of payment channels where the account is the source of the channel.
account_currencies
- Get a list of currencies an account can send or receive.
account_info
- Get basic data about an account.
account_lines
- Get info about an account's trust lines.
account_nfts
- Get a list of non-fungible tokens owned by an account.
account_objects
- Get all ledger objects owned by an account.
account_offers
- Get info about an account's currency exchange offers.
account_tx
- Get info about an account's transactions.
gateway_balances
- Calculate total amounts issued by an account.
noripple_check
- Get recommended changes to an account's Default Ripple and No Ripple settings.
Ledger Methods
A ledger version contains a header, a transaction tree, and a state tree, which contain account settings, trust lines, balances, transactions, and other data. Use these methods to retrieve ledger info.
ledger
- Get info about a ledger version.
ledger_closed
- Get the latest closed ledger version.
ledger_current
- Get the current working ledger version.
ledger_data
- Get the raw contents of a ledger version.
ledger_entry
- Get one element from a ledger version.
Transaction Methods
Transactions are the only thing that can modify the shared state of the XRP Ledger. All business on the XRP Ledger takes the form of transactions. Use these methods to work with transactions.
submit
- Send a transaction to the network.
submit_multisigned
- Send a multi-signed transaction to the network.
transaction_entry
- Retrieve info about a transaction from a particular ledger version.
tx
- Retrieve info about a transaction from all the ledgers on hand.
By default, the following methods are
admin-only
. They can be used as public methods if the server admin has
enabled public signing
.
sign
- Cryptographically sign a transaction.
sign_for
- Contribute to a multi-signature.
Path and Order Book Methods
Paths define a way for payments to flow through intermediary steps on their way from sender to receiver. Paths enable cross-currency payments by connecting sender and receiver through order books. Use these methods to work with paths and other books.
amm_info
- Get info about an Automated Market Maker (AMM).
book_offers
- Get info about offers to exchange two currencies.
deposit_authorized
- Look up whether one account is authorized to send payments directly to another.
nft_buy_offers
- Retrieve a list of buy offers for a specified NFToken object.
nft_sell_offers
- Retrieve a list of sell offers for a specified NFToken object.
path_find
- Find a path for a payment between two accounts and receive updates.
ripple_path_find
- Find a path for payment between two accounts, once.
Payment Channel Methods
Payment channels are a tool for facilitating repeated, unidirectional payments, or temporary credit between two parties. Use these methods to work with payment channels.
channel_verify
- Check a payment channel claim's signature.
By default, the following method is
admin-only
. It can be used as a public method if the server admin has
enabled public signing
.
channel_authorize
- Sign a claim for money from a payment channel.
Subscription Methods
Use these methods to enable the server to push updates to your client when various events happen, so that you can know and react right away.
WebSocket API only.
subscribe
- Listen for updates about a particular subject.
unsubscribe
- Stop listening for updates about a particular subject.
Server Info Methods
Use these methods to retrieve information about the current state of the
xrpld
server.
fee
- Get information about transaction cost.
feature
- Returns information about amendments this server knows about.
server_info
- Retrieve status of the server 프로젝트로 돌아가기