Search code examples
transactionsblockchainwavesplatformride

There're different types of transactions with different versions in Waves Platform, what is the main difference between them?


Why Waves have so many transaction types? In other blockchain just few of them, in Waves more than 10, why? I can’t find any reasons for it. Also there are many different versions of them. To be honest I tried to understand advantages and disadvantages, but see only disadvantages.


Solution

  • In Waves platform, there are 14 different types of transactions where each type is used for different purpose. The main advantages of having different types of transactions are flexibility and scalability. So if there is a need to enable new feature, for example setting a script to an account, a new transaction type will be introduced. It’s not logical to have only one or two transactions to cover all cases. To make it easier, let’s categorize the transactions regarding their purpose:

    Tokenization Transactions

    1. Issue transaction: you can use it to issue your own tokens on Waves where you can define the exact amount of tokens with the possibility to reissue more tokens if you enable the reissue feature by assigning a true value to it.

    2. Reissue transaction: you can use it to reissue more tokens of your asset if you enabled this feature while issuing your asset.

    3. Burn transaction: you can use it to burn some amount of tokens of your asset.

    Payment and Usage Transactions

    1. Transfer Transaction: you can use it to transfer a specific amount to the recipient.

    2. Mass Transfer Transaction: you can use it to combine several ordinary transfer transactions that share single sender and asset ID(a list of recipients, and an amount to be transferred to each recipient).

    3. Exchange Transaction: you can use it to create an offer of exchange(buy or sell order), in which you specify the asset and amount you are offering, and the asset and amount you request in return.

    4. Data Transaction: you can use it to post data in different formats to Waves blockchain where the data inside a transaction is structured as key-value pairs with four data types(boolean, integer, byte array, and string).

    5. Alias Transaction: you can use it to create an Alias.

    Node and Network Transactions

    1. Lease Transaction: you can use it to lease an amount of WAVES to a node operator.

    2. Cancel Lease Transaction: you can use it to cancel and discontinue your leasing.

    3. Set Sponsorship Transaction: you can use it to set a transaction fee nominated in an asset but only the issuer of that asset can set up sponsorship. The sponsorship is set by giving the rate at which fee in an asset is converted to WAVES.

    Smart Contracts Transactions

    1. Set Script Transaction: you can use it to set so up an smart account so this transaction sets the script which verifies all outgoing transactions.

    2. Set Asset Script Transaction: you can use it to change a smart asset’s script and only the issuer of that asset can change the asset's script.

    3. Invoke Script Transaction: you can use it to invoke functions in your smart contract.

    Transaction versions

    There are two versions of transactions (V1,V2), in the new version the transactions are signed by proofs instead of using a signature. So basically signature is replaced with proofs. Proofs are an alternative way to authorize the transaction that is more flexible than signatures and enables smart contracts such as multisig and atomic swap. Each proof is a Base58 encoded byte string and can be a signature, a secret, or anything else – the semantics of a proof is dictated by the smart contract that interprets it. There can be up to 8 proofs at most 64 bytes each.