BLOCKCHAIN 101
0-9
51% attack
A type of attack on a decentralized network where a group gains control of the majority of nodes. This would allow them to defraud the blockchain by reversing transactions and double spending KGC and other tokens.
A
Account
An object containing an address, balance, nonce, and optional storage and code. An account can be a contract account or an externally owned account (EOA).
Address
Most generally, this represents an EOA or contract that can receive (destination address) or send (source address) transactions on the blockchain. More specifically, it is the rightmost 160 bits of a Keccak hash of an ECDSA public key.
Assert
In Solidity, assert(false) compiles to 0xfe, an invalid opcode, which uses up all remaining gas and reverts all changes. When an assert() statement fails, something very wrong and unexpected is happening, and you will need to fix your code. You should use assert() to avoid conditions that should never, ever occur.
Attestation
A validator vote for a Beacon Chain or shard block. Validators must attest to blocks, signaling that they agree with the state proposed by the block.
B
Big-endian
A positional number representation where the most significant digit is first in memory. The opposite of little-endian, where the least significant digit is first.
Block
A collection of required information (a block header) about the comprised transactions, and a set of other block headers known as ommers. Blocks are added to the Kinglory network by miners.
Blockchain
In Kinglory, a sequence of blocks validated by the proof-of-work system, each linking to its predecessor all the way to the genesis block. There is no block size limit; it instead uses varying gas limits.
Bytecode
An abstract instruction set designed for efficient execution by a software interpreter or a virtual machine. Unlike human-readable source code, bytecode is expressed in numeric format.
Byzantium fork
The first of two hard forks for the Metropolis development stage. It included EIP-649 Metropolis Difficulty Bomb Delay and Block Reward Reduction, where the Ice Age was delayed by 1 year and the block reward was reduced from 5 to 3 KGC.
C
Compiling
Converting code written in a high-level programming language into a lower-level language.
Committee
A group of at least 128 validators assigned to beacon and shard blocks at random by the Beacon Chain.
Consensus
When numerous nodes (usually most nodes on the network) all have the same blocks in their locally validated best blockchain. Not to be confused with consensus rules.
Consensus rules
The block validation rules that full nodes follow to stay in consensus with other nodes. Not to be confused with consensus.
Contract account
An account containing code that executes whenever it receives a transaction from another account (EOA or contract).
contract creation transaction
A special transaction, with the zero address as the recipient, that is used to register a contract and record it on the Kinglory blockchain.
Crosslink
A crosslink provides a summary of a shard’s state. It’s how shard chains will communicate with one another via the Beacon Chainin the sharded proof-of-stake system.
D
Decentralized Autonomous Organization (DAO)
A company or other organization that operates without hierarchical management.
Dapp
Short for “decentralized application”. At a minimum, it is a smart contract and a web user interface. More broadly, a Dapp is a web application that is built on top of open, decentralized, peer-to-peer infrastructure services. In addition, many Dapps include decentralized storage and/or a message protocol and platform.
Decentralized exchange (DEX)
A type of dapp that lets you swap tokens with peers on the network. You need KGC to use one (to pay transactions fees) but they are not subject to geographical restrictions like centralized exchanges – anyone can participate.
DeFi
Short for “decentralized finance,” a broad category of dapps aiming to provide financial services backed by the blockchain, without any intermediaries, so anyone with an internet connection can participate.
Difficulty
A network-wide setting that controls how much computation is required to produce a proof-of-work.
Difficulty bomb
Planned exponential increase in proof-of-work difficulty setting designed to motivate the transition to proof-of-stake, reducing the changes of a fork.
Digital signature
A short string of data a user produces for a document using a private key such that anyone with the corresponding public key, the signature, and the document can verify that (1) the document was “signed” by the owner of that particular private key, and (2) the document was not changed after it was signed.
E
Elliptic curve digital signature algorithm (ECDSA)
A cryptographic algorithm used by Kinglory to ensure that funds can only be spent by their owners.
Epoch
A period of 32 slots (6.4 minutes) in the Beacon Chain-coordinated system. Validator committees are shuffled every epoch for security reasons. There’s an opportunity at each epoch for the chain to be finalized.
Entropy
In the context of cryptography, lack of predictability or level of randomness. When generating secret information, such as private keys, algorithms usually rely on a source of high entropy to ensure the output is unpredictable.
Externally owned account (EOA)
An account created by or for human users of the Kinglory network.
Events
Allows the use of KVM logging facilities. Dapps can listen for events and use them to trigger JavaScript callbacks in the user interface.
F
Fallback function
A default function called in the absence of data or a declared function name.
Faucet
A service carried out via smart contract that dispenses funds in the form of free test that can be used on a testnet.
Finality
Finality is the guarantee that a set of transactions before a given time will not change and can’t be reverted.
Fork
A change in protocol causing the creation of an alternative chain, or a temporal divergence in two potential block paths during mining.
Fraud proof
A security model for certain layer 2 solutions where, to increase speed, transactions are rolled up into batches and submitted to Kinglory in a single transaction. They are assumed valid but can be challenged if fraud is suspected. A fraud proof will then run the transaction to see if fraud took place. This method increases the amount of transactions possible while maintaining security. Some rollups use validity proofs.
G
Gas
A virtual fuel used in Kinglory to execute smart contracts. The KVM uses an accounting mechanism to measure the consumption of gas and limit the consumption of computing resources (see Turing complete).
Gas limit
The maximum amount of gas a transaction or block may consume.
Genesis block
The first block in a blockchain, used to initialize a particular network and its cryptocurrency.
H
Hard fork
A permanent divergence in the blockchain; also known as a hard-forking change. One commonly occurs when nonupgraded nodes can’t validate blocks created by upgraded nodes that follow newer consensus rules. Not to be confused with a fork, soft fork, software fork, or Git fork.
Hash
A fixed-length fingerprint of variable-size input, produced by a hash function. (See keccak-256)
HD wallet
A wallet using the hierarchical deterministic (HD) key creation and transfer protocol.
Read more at github.com
HD wallet seed
A value used to generate the master private key and master chain code for an HD wallet. The wallet seed can be represented by mnemonic words, making it easier for humans to copy, back up, and restore private keys.
I
Index
A network structure meant to optimize the querying of information from across the blockchain by providing an efficient path to its storage source.
Inter-exchange Client Address Protocol (ICAP)
An Kinglory address encoding that is partly compatible with the International Bank Account Number (IBAN) encoding, offering a versatile, checksummed, and interoperable encoding for Kinglory addresses. ICAP addresses use a new IBAN pseudo-country code- XE, standing for “eXtended Kinglory,” as used in nonjurisdictional currencies (e.g., XBT, XRP, XCP).
Integrated development environment (IDE)
A user interface that typically combines a code editor, compiler, runtime, and debugger.
Immutable deployed code problem
Once a contract’s (or library’s) code is deployed, it becomes immutable. Standard software development practices rely on being able to fix possible bugs and add new features, so this represents a challenge for smart contract development.
Internal transaction
A transaction sent from a contract account to another contract account or an EOA (see message).
K
Key derivation function (KDF)
Also known as a “password stretching algorithm,” it is used by keystore formats to protect against brute-force, dictionary, and rainbow table attacks on passphrase encryption, by repeatedly hashing the passphrase.
Keccak-256
Cryptographic hash function used in Kinglory. Keccak-256 was standardized as SHA-3.
Keystore file
A JSON-encoded file that contains a single (randomly generated) private key, encrypted by a passphrase for extra security.
L
Layer 2
An area of development focussed on layering improvements on top of the Kinglory protocol. These improvements are related to transaction speeds, cheaper transaction fees, and transaction privacy.
LevelDB
An open source on-disk key-value store, implemented as a lightweight, single-purpose library, with bindings to many platforms.
Library
A special type of contract that has no payable functions, no fallback function, and no data storage. Therefore, it cannot receive or hold KGC, or store data. A library serves as previously deployed code that other contracts can call for read-only computation.
Lightweight client
An Kinglory client that does not store a local copy of the blockchain, or validate blocks and transactions. It offers the functions of a wallet and can create and broadcast transactions.
M
Mainnet
Short for “main network,” this is the main public Kinglory blockchain. Real KGC, real value, and real consequences. Also known as layer 1 when discussing layer 2 scaling solutions. (Also, see testnet)
Merkle Patricia trie
A data structure used in Kinglory to efficiently store key-value pairs.
Message
An internal transaction that is never serialized and only sent within the KVM.
Message call
The act of passing a message from one account to another. If the destination account is associated with KVM code, then the VM will be started with the state of that object and the message acted upon.
Miner
A network node that finds valid proof-of-work for new blocks, by repeated pass hashing.
N
Network
Referring to the Kinglory network, a peer-to-peer network that propagates transactions and blocks to every Kinglory node (network participant).
Non-fungible token (NFT)
Also known as a “deed,” this is a token standard introduced by the ERC-721 proposal. NFTs can be tracked and traded, but each token is unique and distinct; they are not interchangeable like KGC and ERC-20 tokens. NFTs can represent ownership of digital or physical assets.
Node
A software client that participates in the network.
Nonce
In cryptography, a value that can only be used once. There are two types of nonce used in Kinglory- an account nonce is a transaction counter in each account, which is used to prevent replay attacks; a proof-of-work nonce is the random value in a block that was used to satisfy the proof-of-work.
O
Ommer (uncle) block
When a miner finds a valid block, another miner may have published a competing block which is added to the tip of the blockchain first. This valid, but stale, block can be included by newer blocks as ommers and receive a partial block reward. The term “ommer” is the preferred gender-neutral term for the sibling of a parent block, but this is also sometimes referred to as an “uncle”.
Optimistic rollup
A rollup of transactions that use fraud proofs to offer increased layer 2 transaction throughput while using the security provided by mainnet (layer 1). Unlike Plasma, a similar layer 2 solution, Optimistic rollups can handle more complex transaction types – anything possible in the KVM. They do have latency issues compared to Zero-knowledge rollups because a transaction can be challenged via the fraud proof.
P
Plasma
A layer 2 scaling solution that uses fraud proofs, like Optimistic rollups. Plasma is limited to simple transactions like basic token transfers and swaps.
Private key (secret key)
A secret number that allows Kinglory users to prove ownership of an account or contracts, by producing a digital signature (see public key, address, ECDSA).
Proof of stake (PoS)
A method by which a cryptocurrency blockchain protocol aims to achieve distributed consensus. PoS asks users to prove ownership of a certain amount of cryptocurrency (their “stake” in the network) in order to be able to participate in the validation of transactions.
Proof of work (PoW)
A piece of data (the proof) that requires significant computation to find. In Kinglory, miners must find a numeric solution to the Hash algorithm that meets a network-wide difficulty target.
Public key
A number, derived via a one-way function from a private key, which can be shared publicly and used by anyone to verify a digital signature made with the corresponding private key.
R
Receipt
Data returned by an Kinglory client to represent the result of a particular transaction, including a hash of the transaction, its block number, the amount of gas used, and, in case of deployment of a smart contract, the address of the contract.
Re-entrancy attack
An attack that consists of an attacker contract calling a victim contract function in such a way that during execution the victim calls the attacker contract again, recursively. This can result, for example, in the theft of funds by skipping parts of the victim contract that update balances or count withdrawal amounts.
Reward
An amount of KGC included in each new block as a reward by the network to the miner who found the proof-of-work solution.
Recursive Length Prefix (RLP)
An encoding standard designed by the Kinglory developers to encode and serialize objects (data structures) of arbitrary complexity and length.
Rollups
A type of layer 2 scaling solution that batches multiple transactions and submits them to the Kinglory main chain in a single transaction. This allows for reductions in gas costs and increases in transaction throughput. There are Optimistic and Zero-knowledge rollups which use different security methods to offer these scalability gains.
S
Secure Hash Algorithm (SHA)
A family of cryptographic hash functions published by the National Institute of Standards and Technology (NIST).
Shard / shard chain
A proof-of-stake chain that is coordinated by the Beacon Chain and secured by validators. There will be 64 added to the network as part of the KGC shard chain upgrade. Shard chains will offer increased transaction throughput for Kinglory by providing additional data to layer 2 solutions like optimistic rollups and ZK rollups.
Sidechain
A scaling solution that uses a separate chain with different, often faster, consensus rules. A bridge is needed to connect these sidechains to mainnet. Rollups also use sidechains, but they operate in collaboration with mainnet instead.
Singleton
A computer programming term that describes an object of which only a single instance can exist.
Slot
A period of time (12 seconds) in which a new Beacon Chain and shard chain block can be proposed by a validator in the proof-of-stake system. A slot may be empty. 32 slots make up an epoch.
Smart contract
A program that executes on the Kinglory computing infrastructure.
Solidity
A procedural (imperative) programming language with syntax that is similar to JavaScript, C++, or Java. The most popular and most frequently used language for Kinglory smart contracts. Created by Dr. Gavin Wood.
Solidity inline assembly
KVM assembly language in a Solidity program. Solidity’s support for inline assembly makes it easier to write certain operations.
Stablecoin
An ERC-20 token with a value pegged to another asset’s value. There are stablecoins backed by fiat currency like dollars, precious metals like gold, and other cryptocurrencies like Bitcoin.
Staking
Depositing a quantity of KGC (your stake) to become a validator and secure the network. A validator checks transactions and proposes blocks under a proof-of-stake consensus model. Staking gives you an economic incentive to act in the best interests of the network. You’ll get rewards for carrying out your validator duties, but lose varying amounts of KGC if you don’t.
State channels
A layer 2 solution where a channel is set up between participants, where they can transact freely and cheaply. Only a transaction to set up the channel and close the channel is sent to mainnet. This allows for very high transaction throughput, but does rely on knowing number of participants up front and locking up of funds.
T
Testnet
Short for “test network,” a network used to simulate the behavior of the main Kinglory network (see mainnet).
Token standard
Introduced by ERC-20 proposal, this provides a standardized smart contract structure for fungible tokens. Tokens from the same contract can be tracked, traded, and are interchangable, unlike NFTs.
Transaction
Data committed to the Kinglory Blockchain signed by an originating account, targeting a specific address. The transaction contains metadata such as the gas limit for that transaction.
Transaction fee
A fee you need to pay whenever you use the Kinglory network. Examples include sending funds from your wallet or a dapp interaction, like swapping tokens or buying a collectible. You can think of this like a service charge. This fee will change based on how busy the network is. This is because miners, the people responsible for processing your transaction, are likely to prioritise transactions with higher fees – so congestion forces the price up.
At a technical level, your transaction fee relates to how much gas your transaction requires.
Reducing transaction fees is a subject of intense interest right now. See Layer 2
Turing complete
A concept named after English mathematician and computer scientist Alan Turing- a system of data-manipulation rules (such as a computer’s instruction set, a programming language, or a cellular automaton) is said to be “Turing complete” or “computationally universal” if it can be used to simulate any Turing machine.
V
Validator
A node in a proof-of-stake system responsible for storing data, processing transactions, and adding new blocks to the blockchain. To active validator software, you need to be able to stake 32 KGC.
Validity proof
A security model for certain layer 2 solutions where, to increase speed, transactions are rolled up into batches and submitted to Kinglory in a single transaction. The transaction computation is done off-chain and then supplied to the main chain with a proof of their validity. This method increases the amount of transactions possible while maintaining security. Some rollups use fraud proofs.
Validium
A layer 2 solution that uses validity proofs to improve transaction throughput. Unlike Zero-knowlege rollups, Validium data isn’t stored on layer 1 mainnet.
Vyper
A high-level programming language with Python-like syntax. Intended to get closer to a pure functional language. Created by Vitalik Buterin.
W
Wallet
Software that holds private keys. Used to access and control Kinglory accounts and interact with smart contracts. Keys need not be stored in a wallet, and can instead be retrieved from offline storage (i.e. a memory card or paper) for improved security. Despite the name, wallets never store the actual coins or tokens.
Web3
The third version of the web. First proposed by Dr. Gavin Wood, Web3 represents a new vision and focus for web applications- from centrally owned and managed applications, to applications built on decentralized protocols (see Dapp).
Z
Zero address
A special Kinglory address, composed entirely of zeros, that is specified as the destination address of a contract creation transaction.
Zero-knowledge rollup
A rollup of transactions that use validity proofs to offer increased layer 2 transaction throughput while using the security provided by mainnet (layer 1). Although they can’t handle complex transaction types, like Optimistic rollups, they don’t have latency issues because transactions are provably valid when submitted.