Developer Center

Developer Center

  • Getting Started
  • Built-in Features
  • REST API Endpoints
  • Guides
  • Cheat Sheet

›Protocol

Getting Started

  • What is Sirius Chain
  • Setting up your workstation
  • Writing your first application

Built-in Features

  • Account
  • Mosaic (SDA)
  • Namespace
  • Transfer Transaction
  • Aggregate Transaction
  • Multisig Account
  • Metadata
  • Account Restriction
  • Cross-Chain Swaps
  • Exchange Market
  • Decentralized Exchange Market
  • Liquidity Provider
  • Storage

Protocol

  • Node
  • Block
  • Cryptography
  • Transaction
  • Validating
  • Consensus Algorithms
  • Receipt
  • Inflation

REST API

  • Overview
  • Tools
  • Serialization
  • Websockets
  • Status Errors

SDKs

  • Overview
  • Architecture
  • Languages
  • Extending Sirius Chain Capabilities
  • SDK Development
  • SDK Documentation

Wallets & Explorers

  • Wallets & Explorers

Cheat Sheet

  • Sirius Chain Cheat Sheet

Guides

  • Overview
  • External Guides
  • Account

    • Creating and opening an account
    • Getting account information
    • Getting the amount of XPX sent to an account
    • Reading transactions from an account

    Account Restriction

    • Preventing spam attacks with account restrictions

    Aggregate Transaction

    • Sending payouts with aggregate-complete transaction
    • Creating an escrow with aggregate bonded transaction
    • Asking for mosaics with aggregate-bonded transaction
    • Signing announced aggregate-bonded transactions

    Block

    • Listening to New Blocks
    • Getting block by height

    Cross Chain Swaps

    • Atomic cross-chain swap between Sirius public and private chains

    Metadata

    • Account Metadata
    • Mosaic Metadata
    • Namespace Metadata
    • Account Metadata (Deprecated since 0.7.0 Sirius Chain release)
    • Mosaic Metadata (Deprecated since 0.7.0 Sirius Chain release)
    • Namespace Metadata (Deprecated since 0.7.0 Sirius Chain release)

    Monitoring

    • Monitor transaction

    Mosaic

    • Creating a mosaic (SDA)
    • Getting the mosaic information
    • Getting the asset identifier behind a namespace with receipts

    Mosaic Levy

    • Modifying Mosaic Supply

    Multisig Account

    • Converting an account to multisig
    • Modifying a multisig account
    • Creating a multi-level multisig-account
    • Sending a multisig transaction

    Namespace

    • Registering a namespace
    • Registering a subnamespace
    • Getting the Namespace information
    • Linking a namespace to a mosaic
    • Linking namespace to account

    Transfer Transaction

    • Transfer transaction
    • Sending an encrypted message

    Storage

    • Data Modification Cancel
    • Data Modification
    • Download Channel
    • Download Payment
    • Drive Closure
    • Finish Download Channel
    • Prepare Bc Drive
    • Replicator Offboarding
    • Replicator Onboarding
    • Storage Payment
    • Verification Payment

Storage

  • Overview
  • Participate
  • External Economy
  • Roles
  • Verification
  • Challenge
  • Rewards
  • Transaction Schemas
  • Built-In Features

    • Drive
    • Replicator
    • Verifier
    • Supercontracts

    Protocols

    • Cross-Block Protocol
    • Fair Streaming

    Storage User Application

    • Overview
    • Getting Started
    • Managing Drives
    • Managing Drive Files
    • Downloading Data

Transaction

A transaction generally represents a unit of work within a database system. In the case of blockchain, a transaction is when an action signed by an account changes its state.

Transactions accepted by the network are stored permanently on blocks.

Transaction Types

There are different types of transactions. For example, you can transfer mosaics between accounts, transfer or configure the ownership of accounts (including the use of multisig rules), and more.

IdTypeDescription
Mosaic
0x414DMosaic Definition TransactionRegister a new mosaic.
0x424DMosaic Supply Change TransactionChange an existent mosaic supply.
Namespace
0x414ERegister Namespace TransactionRegister a namespace to organize your assets.
0x424EAddress Alias TransactionAttach a namespace name to an account.
0x434EMosaic Alias TransactionAttach a namespace name to a mosaic.
Transfer
0x4154Transfer TransactionSend mosaics and messages between two accounts.
Multisignature
0x4155Modify Multisig Account TransactionCreate or modify a multisig contract.
0x4141Aggregate Complete TransactionSend transactions in batches to different accounts.
0x4241Aggregate Bonded TransactionPropose many transactions between different accounts.
0x4148Hash Lock TransactionA deposit before announcing aggregate bonded transactions.
–Cosignature TransactionCosign an aggregate bonded transaction.
Account restrictions
0x4150Account Properties Address TransactionAllow or block incoming transactions for a given set of addresses.
0x4250Account Properties Mosaic TransactionAllow or block incoming transactions containing a given set of mosaics.
0x4350Account Properties Entity Type TransactionAllow or block outgoing transactions by transaction type.
Cross-chain swaps
0x4152Secret Lock TransactionStart a token swap between different chains.
0x4252Secret Proof TransactionConclude a token swap between different chains.
Remote validating
0x414CAccount Link TransactionDelegates the account to a proxy account to enable delegated validating.
Exchange
0x415DAdd Exchange Offer TransactionCreate a new exhange offer.
0x425DExchange Offer TransactionMake exchanging.
0x435DRemove Exchange Offer TransactionRemove a new exhange offer.
Drive
0x415A(Deprecated) Prepare Drive TransactionPreparing a new drive.
0x425A(Deprecated) Join To Drive TransactionSend a new join transaction to drive.
0x435A(Deprecated) Drive File System TransactionChange a drive file system.
0x445A(Deprecated) Files Deposit TransactionBlock mocaics at the rate of a file size.
0x455A(Deprecated) End Drive TransactionTerminate a drive execution.
0x465A(Deprecated) Drive Files Reward TransactionSend rewarding for files.
0x475A(Deprecated) Start Drive Verification TransactionStart verifying files storing.
0x485A(Deprecated) End Drive Verification TransactionEnd verifying files storing.
Super Contract
-Deploy TransactionDeploying super contract.
-Execute TransactionStart contract executing.
-Start Operation TransactionStarting executing operation.
-End Operation TransactionEnding executing operation.
-Operation Identify TransactionIdentifying execute operation.
Storage
0x4662Replicator Onboarding TransactionReplicator Onboarding
0x4162Prepare BcDrive TransactionPrepare a New Drive
0x4262Data Modification TransactionNew Data Modification
0x4462Data Modification Approval TransactionData Modification Approval. Inner transaction, sent by Replicators only
0x4B62Data Modification SingleApproval TransactionInner transaction, sends Only by Replicators
0x4562Data Modification Cancel TransactionCancel Data Modification
0x4A62Storage Payment TransactionStorage Payment
0x4962Download Payment TransactionDownload Payment
0x4362Download TransactionNew Download Channel
0x4862Finish Download TransactionClose Download Channel
0x4C62Verification Payment TransactionVerification Payment
0x4F62End Drive Verification V2 TransactionEnd Drive Verification. Inner transaction, sends Only by Replicators
0x4D62Download Approval TransactionDownload Approval. Inner transaction, sends Only by Replicators
0x4E62Drive Closure TransactionDrive Closure
0x4762Replicator Offboarding TransactionReplicator Offboarding

Defining a transaction

Transactions are defined in a serialized form. Each transaction extends from the transaction schema definition, combining the type's particular properties. You can find the description of the additional properties under the Schema section, at the end of each built-in feature description.

We recommend to use the xpx-chain-sdk to define transactions.

Fees

Transactions have an associated cost. This cost is necessary to provide an incentive for the validator who secures the network and runs the infrastructure.

The fee associated with a transaction primarily depends on the transaction’s size. The effective fee is the product of the size of the transaction, and a fee multiplier set by the Validator. The node owner can configure the latter value to all positive values, including zero.

effective_fee = transaction::bytes_size_to_be_validated * block::fee_multiplier

A sender of a transaction must specify max_fee during the transaction definition, meaning the maximum fee the account allows to spend for this transaction.

If the effective_fee is smaller or equal to the max fee, the validator can opt to include the transaction in the block.

The fee_multiplier is defined by validators, it is an integer value. It is stored in the block header, permitting to resolve which was the effective fee paid for every transaction included.

The validating nodes can decide their transaction inclusion strategy:

  • Prefer-oldest: Preferred for networks with high transaction throughput requirements. Include first the oldest transactions.
  • Minimise-fees: Philanthropic nodes. Include first transactions that other nodes do not want to include.
  • Maximise-fees: Most common in public networks. Include first transactions with higher fees.

By default, the fee is paid in xpx, the underlying currency of the Sirius Chain network. Private chains can edit the configuration of the network to eliminate fees, or use another mosaic and namespace that better suits their needs.

Fee Tips

In short, validators need to define fee_multiplier, which is considered as fee per byte.

Max fee value is the lowest currency absolute value. eg. 5000 max fee = 0.005000 xpx.

The final transaction size might be increased from client/user site due to more complex transactions such as transactions with multisig accounts with extra cosigner information. Fee_multiplier will calculate with the final transaction size.

Signing a transaction

Accounts must sign transactions before announcing them to the network. Signing a transaction expresses the account’s agreement to change the network state as defined.

For example, a transfer transaction describes who is the recipient and the quantity of mosaics to be transferred. In this case, signing the transaction means to accept moving those mosaics from one account’s balance to another.

An account has to follow the next steps to sign a transaction:

  1. Get the signing bytes, which are all the bytes of the transaction except the size, signature and signer.
  2. Get the nemesis block generation hash. You can query http://bctestnet1.brimstone.xpxsirius.io:3000/block/1 and copy meta.generationHash value.
  3. Prepend the nemesis block generation hash to the signing bytes.
  4. Sign the resulting string with the signer's private key. This will give you the transaction signature.
  5. Append the signer's signature and public key to the transaction to obtain the payload.
  6. Calculate the hash of the transaction applying the network hashing algorithm to the first 32 bytes of signature, the signer public key, nemesis block generation hash, and the remaining transaction payload.

Announcing a transaction

Signed transactions are ready to be announced to the network. You can either use the SDK TransactionHttp service or append the payload to the request of the transaction endpoint.

After announcing a transaction, the REST API will always return an OK response immediately. At this point, it is still unknown whether the transaction is valid.

Transaction Cycle

Transaction cycle

The first stage of validation happens in the API nodes. If the transaction presents some error, the WebSocket throws a notification through the status channel. In the positive case, the transaction reaches the P2P network with an unconfirmed status. Never rely on a transaction which has an unconfirmed state. It is not clear if it will get included in a block, as it should pass a second validation.

The second validation is done before the transaction is added in a validated block. If valid, the validator stores the transaction in a block, and it reaches the confirmed status.

Continuing the previous example, the transaction gets processed and the amount stated gets transferred from the signer's account to the recipient's account. Additionally, the transaction fee is deducted from the signer's account.

The transaction has zero confirmations at this point. When another block is added to the blockchain, the transaction has one confirmation. The next block added to the chain will give it two confirmations and so on.

Rollbacks

Blockchains are designed in a way that under certain circumstances, recent blocks need to be rolled back. These are essential to resolve forks of the blockchain.

The rewrite limit is the maximum number of blocks that can be rolled back. Hence, forks can only be resolved up to a certain depth too.

Sirius Chain has a rewrite limit of 360 blocks. Once a transaction has more than 360 confirmations, it cannot be reversed.

From experience, forks that are deeper than 20 blocks do not happen, unless there is a severe problem with the blockchain due to a bug in the code or an attack.

Guides

  • Monitoring a transaction status

    Make sure a transaction gets included in the blockchain after being announced.

Schemas

Transaction

Inlines:

  • SizePrefixedEntity
  • VerifiableEntity
  • EntityBody
PropertyTypeDescription
max_feeuint64The maximum fee allowed to spend for the transaction.
deadlineuint64The maximum amount of time to include the transaction in the blockchain.

EmbeddedTransaction

Inlines:

  • SizePrefixedEntity
  • EntityBody

SizePrefixedEntity

PropertyTypeDescription
sizeunit32The size of the transaction.
← CryptographyValidating →
  • Transaction Types
  • Defining a transaction
  • Fees
    • Fee Tips
  • Signing a transaction
  • Announcing a transaction
  • Rollbacks
  • Guides
  • Schemas
    • Transaction
    • EmbeddedTransaction
    • SizePrefixedEntity
  • Follow our profile
  • Ask development questions
  • Join our Discord channel
  • Explore our Youtube channel
  • Explore Github
Protocol
BlockConsensus AlgorithmsCryptographyInflationNodeReceiptTransactionValidating
Built-in Features
AccountAggregate TransactionCross-Chain SwapsExchange MarketDecentralized Exchange MarketMetadataMosaicMultisig AccountNamespaceTransfer TransactionStorageLiquidity Provider
References
REST APISDKsCheat Sheet
Includes Documentation Forked from NEM
Copyright © 2025 Sirius Chain