Developer Center

Developer Center

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

›Mosaic

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

Creating a mosaic (SDA)

Follow this guide to create a mosaic (SDA).

Background

A mosaic is synonomously known as Sirius Digital Asset (SDA). Mosaics and SDAs are used interchangeably. SDAs can be used to represent any asset in the blockchain such as objects, tickets, coupons, stock share representation, and even your cryptocurrency.

Prerequisites

  • Finish registering a namespace guide.
  • Have an account with XPX.
  • XPX-Chain-SDK or XPX-Chain-CLI.
  • A text editor or IDE.
  • An account with XPX and at least one namespace.

Getting into some code

Define two transactions to create an SDA:

  1. An SDA definition transaction, to create the SDA, with the following properties:
PropertyValueDescription
Divisibility0The SDA won’t be divisible. Determines up to what decimal place the mosaic can be divided.
Duration1000The SDA will be created for the next 1000 blocks. If you want to create a non-expiring SDA, do not set this property.
Supply mutabletrueThe SDA supply can change at a later point.
TransferabletrueThe SDA can be transferred between arbitrary accounts. Otherwise, the SDA can only be transferred back to the SDA creator.
Golang
JavaScript
nonce := rand.New(rand.NewSource(time.Now().UTC().UnixNano())).Uint32()

mosaicDefinitionTrx, err := client.NewMosaicDefinitionTransaction(
sdk.NewDeadline(time.Hour),
nonce,
account.PublicAccount.PublicKey,
sdk.NewMosaicProperties(true, true, 0, sdk.Duration(1000)),
)
if err != nil {
panic(err)
}
    const nodeURL = "http://bctestnet1.brimstone.xpxsirius.io:3000";

const transactionHttp = new TransactionHttp(nodeURL);

var mosaicDuration = (1 * 365 * 24 * 60 * 4 ); // 1 year - 15 sec per block

const privateKey = process.env.PRIVATE_KEY;
const account = Account.createFromPrivateKey(privateKey, NetworkType.TEST_NET);

const nonce = MosaicNonce.createRandom();
var mosaicId = MosaicId.createFromNonce(nonce, account.publicAccount);

const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create(
Deadline.create(),
nonce,
mosaicId,
MosaicProperties.create({
supplyMutable: true,
transferable: true,
divisibility: 0,
duration: UInt64.fromUint(mosaicDuration),
}),
NetworkType.TEST_NET
)
  1. An SDA supply change transaction, to set the supply. We are going to create 1.000.000 SDA units.
Golang
JavaScript
mosaic, err := sdk.NewMosaicIdFromNonceAndOwner(nonce, account.PublicAccount.PublicKey)
if err != nil {
panic(err)
}

mosaicSupplyChangeTrx, err := client.NewMosaicSupplyChangeTransaction(
sdk.NewDeadline(time.Hour),
mosaic,
sdk.Increase,
sdk.Amount(1000000),
)
if err != nil {
panic(err)
}
const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create(
Deadline.create(),
mosaicId,
MosaicSupplyType.Increase,
UInt64.fromUint(1000000),
NetworkType.TEST_NET
);

Note:

Sirius Chain mainly works with absolute amounts. To get an absolute amount, multiply the amount of assets you want to create by power of 10 with divisibility as exponent. For example, if the mosaic has a divisibility of 2, to create 10 units (relative) you should define 1000 (absolute) instead.

  1. Both transactions can be announced together using an aggregate transaction.
Golang
JavaScript
// Convert an aggregate transaction to an inner transaction including transaction signer.
mosaicDefinitionTrx.ToAggregate(account.PublicAccount)
mosaicSupplyChangeTrx.ToAggregate(account.PublicAccount)

// Create an aggregate complete transaction
aggregateTransaction, err := client.NewCompleteAggregateTransaction(
// The maximum amount of time to include the transaction in the blockchain.
sdk.NewDeadline(time.Hour),
// Inner transactions
[]sdk.Transaction{mosaicDefinitionTrx, mosaicSupplyChangeTrx,},
)
const aggregateTransaction = AggregateTransaction.createComplete(
Deadline.create(),
[
mosaicDefinitionTransaction.toAggregate(account.publicAccount),
mosaicSupplyChangeTransaction.toAggregate(account.publicAccount)
],
NetworkType.TEST_NET,
[]);

What’s next?

Transfer one mosaic created to another account or modify its properties following the next guide.

← Monitor transactionGetting the mosaic information →
  • Background
  • Prerequisites
  • Getting into some code
  • What’s next?
  • 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