Developer Center

Developer Center

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

›Namespace

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

Registering a namespace

Register your own namespace.

Background Information

Namespaces allow you to create an on-chain unique place for your business and your assets on the Sirius Chain.

A namespace starts with a name that you choose, similar to an internet domain name. If one account creates a namespace, that will appear as unique in the network.

An account can link a registered name (namespace or subnamespace) with an account or a mosaic identifier.

Prerequisites

  • Finish the getting started section.
  • XPX-Chain-SDK or XPX-Chain-CLI.
  • A text editor or IDE.
  • An account with XPX.

Getting into some code

  1. Choose a name you like. One common option is to use your company’s or own name. In this example, we will register a namespace called foo.
  2. Check if this namespace name is available.
Golang
TypeScript
JavaScript
Java
CLI
conf, err := sdk.NewConfig(context.Background(), []string{"http://bctestnet1.brimstone.xpxsirius.io:3000"})
if err != nil {
panic(err)
}

// Use the default http client
client := sdk.NewClient(nil, conf)

namespaceId, err := sdk.NewNamespaceIdFromName("foo")
if err != nil {
panic(err)
}

namespaceInfo, err := client.Namespace.GetNamespaceInfo(context.Background(), namespaceId)
if err != nil {
panic(err)
}
const namespaceHttp = new NamespaceHttp('http://bctestnet1.brimstone.xpxsirius.io:3000');

const namespace = new NamespaceId('foo');

namespaceHttp
.getNamespace(namespace)
.subscribe(namespace => console.log(namespace), err => console.error(err));
const namespaceHttp = new NamespaceHttp('http://bctestnet1.brimstone.xpxsirius.io:3000');

const namespace = new NamespaceId('foo');

namespaceHttp
.getNamespace(namespace)
.subscribe(namespace => console.log(namespace), err => console.error(err));
final NamespaceId namespaceId = new NamespaceId("foo");

final NamespaceHttp namespaceHttp = new NamespaceHttp("http://bctestnet1.brimstone.xpxsirius.io:3000");

final NamespaceInfo namespaceInfo = namespaceHttp.getNamespace(namespaceId).toFuture().get();

System.out.println(namespaceInfo);
xpx2-cli namespace info --name foo
  1. Is the namespace available? Try to register it before someone else does it! Announce a register namespace transaction with the chosen name and renting duration expressed in blocks.

Note:

In Sirius Chain, blocks are complete every 15 seconds in average. You will have to renew your namespace before it expires.

Golang
TypeScript
JavaScript
Java
// Create an account from a private key
account, err := client.NewAccountFromPrivateKey(os.Getenv("PRIVATE_KEY"))
if err != nil {
panic(err)
}

// Create a new namespace type transaction
transaction, err := client.NewRegisterRootNamespaceTransaction(
// The maximum amount of time to include the transaction in the blockchain.
sdk.NewDeadline(time.Hour),
// Name of namespace
"foo",
// Duration of namespace life in blocks
sdk.Duration(1000),
)
if err != nil {
panic(err)
}

// Sign transaction
signedTransaction, err := account.Sign(transaction)
if err != nil {
panic(err)
}

// Announce transaction
_, err = client.Transaction.Announce(context.Background(), signedTransaction)
if err != nil {
panic(err)
}
const transactionHttp = new TransactionHttp('http://bctestnet1.brimstone.xpxsirius.io:3000');

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

const namespaceName = "foo"; //Replace with an unique namespace name

const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace(
Deadline.create(),
namespaceName,
UInt64.fromUint(1000),
NetworkType.TEST_NET);

const signedTransaction = account.sign(registerNamespaceTransaction, generationHash);

transactionHttp
.announce(signedTransaction)
.subscribe(x => console.log(x), err => console.error(err));
const transactionHttp = new TransactionHttp('http://bctestnet1.brimstone.xpxsirius.io:3000');

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

const namespaceName = "foo"; //Replace with an unique namespace name

const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace(
Deadline.create(),
namespaceName,
UInt64.fromUint(1000),
NetworkType.TEST_NET);

const signedTransaction = account.sign(registerNamespaceTransaction, generationHash);

transactionHttp
.announce(signedTransaction)
.subscribe(x => console.log(x), err => console.error(err));
    // Replace with private key
final String privateKey = "<privateKey>";

final Account account = Account.createFromPrivateKey(privateKey, NetworkType.TEST_NET);

// Replace with namespace name
final String namespaceName = "foo";

final RegisterNamespaceTransaction registerNamespaceTransaction = new TransactionBuilderFactory()
.registerNamespace().rootNamespace(namespaceName)
.duration(BigInteger.valueOf(1000))
.deadline(new Deadline(2, ChronoUnit.HOURS))
.networkType(NetworkType.TEST_NET).build();

final SignedTransaction signedTransaction = account.sign(registerNamespaceTransaction, generationHash);

final TransactionHttp transactionHttp = new TransactionHttp("http://bctestnet1.brimstone.xpxsirius.io:3000");

transactionHttp.announce(signedTransaction).toFuture().get();

What’s next?

When the transaction is confirmed, register a subnamespace following the next guide.

← Sending a multisig transactionRegistering a subnamespace →
  • Background Information
  • 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