Nine Chronicles
  • Nine Chronicles
  • Game Overview
    • The Campaign
    • Items
      • Equipment
      • Materials
      • Item Crafting
      • Item Upgrading
      • Consumables
      • Costumes & Titles
    • Market
    • Time in Nine Chronicles
    • The Arena - PvP competition
      • Arena Season 0
    • Mimisbrunnr Elemental dungeon
  • Economic Design
    • Core Axioms
    • Play to Earn Model
    • Nine Chronicles Crystals
    • Staking & Monster Collection
  • Nine Chronicles Gold (NCG)
    • In game uses
    • Allocations and Unlock schedule
    • Ethereum Bridge
  • Technology
    • Actions and Transactions
    • Transactions and querying local storage
    • Libplanet Blockchain
    • Blocks and mining
    • RPC Connection
  • Community
    • Content Creators Program
    • Third-party development
      • Software Grant
      • Game Modding
    • Community Treasury
  • Governance and Decentralized Organization
    • Nine Chronicles Improvement Proposals
  • Key Metrics
  • Roadmap and Milestones
    • Roadmap - 2022
  • Team
  • Partners
Powered by GitBook
On this page
  1. Technology

Transactions and querying local storage

PreviousActions and TransactionsNextLibplanet Blockchain

Last updated 3 years ago

As mentioned in a , the game's graphical interface provides a nice way to interact with the data that sits on the Nine Chronicles blockchain. All game data sits on the blockchain which means a copy of this data is stored by all people who run the blockchain software.

It is worth noting that the storage component of any blockchain is a database. Whenever we want to extract data from a blockchain we are actually querying a database. One nice illustration of this is the in-game . Whenever players view the marketplace inside the game, the game's software queries a database that's stored locally on players' computers. One such query is to retrieve a list of “all items for sale”.

The various filters that players can select in the user interface are different queries built into the game client. As our code is , then any developer can figure out how to create their own queries. Planetarium has which should make querying easier, as it offers an enhanced set of queries.

Making a purchase

We make queries in order to find something we want and in the case of the marketplace, we do this in order to make a purchase.

Once you have searched the market and found something you want to buy, then you click on the item and agree to the price by pressing “Buy”. This is perhaps the most obvious time that you expect to make a transaction to the blockchain since you are purchasing something.

As all actions that are stored on-chain, players sign their transaction with their private key. The game client signs the transaction and then sends it to the blockchain node software managed by the launcher software, which in turn broadcasts the transaction to the whole Nine Chronicles network.

This procedure of sending a signed transaction is similar for combat. In this case, the transaction the purchase of an item, while for combat a transaction is used to start the fight-sequence.

To re-iterate, all game actions that change the state of the game are recorded as transactions on the blockchain. Any 'action' that involves looking at something, such as clicking from one screen to another, or looking at items in the marketplace, are not recorded on-chain.

Making a sale

The process of selling is similar to buying. You select an item from your inventory then press “Sell”. This marks the item as “for sale”, which is also a transaction that tells everyone to update their database.

When items are marked for sale, or change ownership, there is an update to the game’s state. It is important that everyone playing the game agrees upon such changes, which is why all such changes are signed by your private key.

Only you have access to your private key which is one reason we have strong guarantees about the authenticity of actions within a blockchain.

previous section
marketplace
open source
released an API
Main screen of the marketplace
Buying an item from the marketplace
Selling an item on the marketplace