Translations: How Tx Processing Works/7/en

From ArdorDocs
Jump to: navigation, search

The details of a Ardor transaction are as follows:

  1. The sender specifies parameters for the transaction. Types of transactions vary (sending money, creating an alias, transmitting a message, issuing an asset or an order for an asset) but several parameters must be specified for any transaction:
    • the secret passphrase for the sending account
    • a specified fee of the transaction
    • a deadline for the transaction
    • an optional "referenced" transaction
  2. All values for the transaction inputs are checked. For example, mandatory parameters must be specified; fees cannot be less than or equal to zero; a transaction deadline cannot be less than 1 minute into the future.
  3. If no exceptions are thrown as a result of parameter checking:
    1. The public key for the generating account is computed using the supplied secret passphrase
    2. Account information generating account is retrieved, and transaction parameters are further validated:
      • The sending account's balance cannot be zero
      • The sending account's confirmed balance must not be lower than the transaction amount plus the transaction fee
    3. If the sending account has sufficient funds for the transaction:
      1. A new transaction is created, with a type and subtype value set to match the kind of transaction being made (sending money, creating an alias, sending a message, etc.). All specified parameters are included in the Transaction object. A unique transaction ID is generated with the creation of the object
      2. The transaction is signed using the sending account's private key
      3. The encrypted transaction data is placed within a message instructing network peers to process the transaction
      4. The transaction is broadcast to all peers on the network
  4. The server responds with a result code: the transaction ID, if the transaction creation was successful; an error code and error message if any of the parameter checks failed.