Receipt

Conditional state changes in the background enable complex transactions.

For example, a hash lock concludes as soon as the AggregateBondedTransaction is confirmed. When the locked funds are automatically returned to the account, there is no additional transaction recorded. This might appear as a hidden change that increases the account balance. Receipts provide proof for every hidden change.

The collection of receipts are hashed into a merkle tree and linked to a block. The block header stores the root hash, which is different from zero when the block has receipts.

Transaction statement

A transaction statement is a collection of receipts linked with a transaction in a particular block. Statements can include receipts with the following basic types:

  • Balance Transfer: The invisible state change triggered a mosaic transfer.
  • Balance Change: The invisible state change changed an account balance.
  • Artifact Expiry: An artifact (e.g. namespace, mosaic) expired.
  • Inflation Receipt: Native currency mosaics were created due to inflation.

Resolution statement

When a transaction includes an alias, a so called resolution statement reflects the resolved value for that block:

  • Address Resolution: An account alias was used in the block.
  • Mosaic Resolution: A mosaic alias was used in the block.

The alias receipts record the first occurrence of an (unresolved, resolved) alias pair used in a block.

Recorded receipts

Catapult records invisible state changes for the following entities.

Id Receipt Basic type Description
Core      
0x2143 Harvest_Fee BalanceCredit The recipient, account and amount of fees received for harvesting a block. It is recorded when a block is harvested.
0x5143 Inflation Inflation The amount of native currency mosaics created. The receipt is recorded when the network has inflation configured, and a new block triggers the creation of currency mosaics.
0xE143 Transaction_Group Aggregate A collection of state changes for a given source. It is recorded when a state change receipt is issued.
0xF143 Address_Alias_Resolution Alias Resolution The unresolved and resolved alias. It is recorded when a transaction indicates a valid address alias instead of an address.
0xF243 Mosaic_Alias_Resolution Alias Resolution The unresolved and resolved alias. It is recorded when a transaction indicates a valid mosaic alias instead of a mosaicId.
Mosaic      
0x414D Mosaic_Expired ArtifactExpiry The identifier of the mosaic expiring in this block. It is recorded when a mosaic lifetime elapses.
0x124D Mosaic_Rental_Fee BalanceTransfer The sender and recipient of the mosaicId and amount representing the cost of registering the mosaic. It is recorded when a mosaic is registered.
Namespace      
0x414E Namespace_Expired ArtifactExpiry The identifier of the namespace expiring in this block. It is recorded when the namespace lifetime elapses.
0x424E Namespace_Deleted ArtifactExpiry The identifier of the namespace deleted in this block. It is recorded when the namespace grace period elapses.
0x134E Namespace_Rental_Fee BalanceTransfer The sender and recipient of the mosaicId and amount representing the cost of extending the namespace. It is recorded when a namespace is registered or its duration is extended.
HashLock      
0x3148 LockHash_Created BalanceDebit The lockhash sender, mosaicId and amount locked. It is recorded when a valid HashLockTransaction is announced.
0x2248 LockHash_Completed BalanceCredit The hashlock sender, mosaicId and amount locked that is returned. It is recorded when an AggregateBondedTransaction linked to the hash completes.
0x2348 LockHash_Expired BalanceCredit The account receiving the locked mosaic, the mosaicId and the amount. It is recorded when a lock hash expires.
SecretLock      
0x3152 LockSecret_Created BalanceDebit The secretlock sender, mosaicId and amount locked. It is recorded when a valid SecretLockTransaction is announced.
0x2252 LockSecret_Completed BalanceCredit The secretlock recipient, mosaicId and amount locked. It is recorded when a secretlock is proved.
0x2352 LockSecret_Expired BalanceCredit The account receiving the locked mosaic, the mosaicId and the amount. It is recorded when a secretlock expires.

Guides

Schemas

Receipt

Conditional state changes in the background enable complex transactions.

Inlines:

Property Type Description
version uint16 Receipt version.
type ReceiptType Receipt type.

BalanceTransferReceipt

The invisible state change triggered a mosaic transfer.

  • version: 0x1
  • basicType: 0x1

Inlines:

Property Type Description
senderPublicKey Key Public key of the sender.
recipientAddress Address Address of the recipient.
mosaicId MosaicId Identifier of the mosaic.
amount Amount Amount of mosaics to send.

BalanceChangeReceipt

The invisible state change changed an account balance.

  • version: 0x1
  • basicType: (0x2) credit or (0x3) debit

Inlines:

Property Type Description
targetPublicKey Key Public key of the target account.
mosaicId MosaicId Identifier of the mosaic.
amount Amount Amount of mosaics to increase or decrease.

ArtifactExpiryReceipt

An artifact (e.g. namespace, mosaic) expired.

  • version: 0x1
  • basicType: 0x4

Inlines:

Property Type Description
artifactId MosaicId or NamespaceId Identifier of the artifact.

InflationReceipt

  • version: 0x1
  • basicType: 0x5

Inlines:

Property Type Description
mosaicId MosaicId Identifier of the mosaic that has been created.
amount Amount Number of mosaics created.

TransactionStatement

The collection of receipts related to a transaction.

  • version: 0x1
  • type: Transaction_Group

Inlines:

Property Type Description
source ReceiptSource Transaction that triggered the receipt.
receipts array(Receipt, size=receiptsSize) Array of receipts.

ResolutionStatement

A resolution statement keeps the relation between a namespace alias used in a transaction and the real address or mosaicId.

  • version: 0x1
  • type: Address_Alias_Resolution or Mosaic_Alias_Resolution

Inlines:

Property Type Description
unresolved UnresolvedAddress or UnresolvedMosaicId Unresolved address or unresolved mosaic identifier.
resolutionEntries array(ResolutionEntry, size=resolvedEntriesSize) Array of resolution entries linked to the unresolved namespace identifier. It is an array instead of a single UInt64 field since within one block the resolution might change for different sources due to alias related transactions.

ResolutionEntry

Property Type Description
resolvedValue Address or MosaicId Resolved address or resolved mosaic identifier.
source ReceiptSource Information about the transaction that triggered the receipt.

ReceiptSource

The transaction that triggered the receipt.

Property Type Description
primaryId uint32 Transaction index within the block.
secondaryId uint32 Transaction index inside within the AggregateTransaction. If the transaction is not an inner transaction, then the secondary identifier is set to 0.