Be a crypto hero in the market by logging in

Don't you have an account? Sign in

Token price

  • BTC

    8,916,174.0KRW

    -0.2%

  • ETH

    178,151.5KRW

    0.5%

  • XRP

    270.8KRW

    0.3%

  • USDT

    1,193.4KRW

    -0.3%

  • BCH

    253,640.8KRW

    0.4%

  • LTC

    54,759.1KRW

    -0.5%

  • EOS

    3,247.6KRW

    0.0%

  • BNB

    18,637.7KRW

    0.3%

  • BSV

    113,558.5KRW

    -0.6%

  • XLM

    66.0KRW

    1.0%

  • XTZ

    1,877.6KRW

    6.5%

  • ADA

    45.6KRW

    -0.9%

  • TRX

    17.3KRW

    -0.4%

  • XMR

    63,898.2KRW

    -1.8%

  • HT

    3,350.1KRW

    -0.1%

  • NEO

    10,658.5KRW

    -0.2%

  • MKR

    592,639.2KRW

    -1.0%

  • DASH

    61,275.9KRW

    -1.3%

  • USDC

    1,192.7KRW

    -0.3%

  • ETC

    4,671.4KRW

    1.1%

  • ONT

    764.3KRW

    4.0%

  • VET

    8.5KRW

    3.9%

  • XEM

    43.0KRW

    0.5%

  • DOGE

    2.6KRW

    -0.6%

  • BAT

    225.0KRW

    -0.6%

  • ZEC

    35,764.1KRW

    1.1%

  • PAX

    1,192.9KRW

    -0.3%

  • DCR

    24,276.1KRW

    -2.2%

  • INB

    634.9KRW

    -1.3%

  • QTUM

    2,070.3KRW

    -0.6%

  • RVN

    38.6KRW

    -3.1%

  • TUSD

    1,192.2KRW

    -0.4%

  • LINK

    485.1KRW

    2.0%

  • ZRX

    280.7KRW

    -0.6%

  • REP

    12,416.7KRW

    -0.2%

  • NANO

    984.0KRW

    0.6%

  • CNX

    2,320.4KRW

    0.2%

  • OMG

    887.2KRW

    0.0%

  • BTG

    7,098.7KRW

    -1.4%

  • XIN

    256,158.3KRW

    -0.4%

  • XIN

    256,158.3KRW

    -0.4%

  • LSK

    817.8KRW

    0.2%

  • DGB

    7.8KRW

    0.5%

  • XVG

    5.8KRW

    8.9%

  • KCS

    1,142.8KRW

    -0.8%

  • BTM

    92.8KRW

    -1.3%

  • BTM

    92.8KRW

    -1.3%

  • KMD

    778.0KRW

    -1.4%

  • THETA

    100.5KRW

    7.8%

  • IOST

    7.1KRW

    -0.1%

  • ENJ

    107.7KRW

    -0.5%

  • BCD

    448.8KRW

    -0.4%

  • ICX

    160.3KRW

    -0.6%

  • MCO

    5,014.9KRW

    1.4%

  • SC

    1.8KRW

    4.8%

  • ZIL

    7.7KRW

    0.8%

  • MONA

    1,091.5KRW

    2.4%

  • WAVES

    691.4KRW

    1.0%

  • BCN

    0.4KRW

    -0.5%

  • DAI

    1,188.3KRW

    -0.2%

  • QNT

    5,592.9KRW

    5.2%

  • BTS

    24.0KRW

    -0.8%

  • HC

    1,452.7KRW

    -1.4%

  • NEXO

    114.8KRW

    -0.5%

  • MAID

    136.0KRW

    0.1%

  • ARDR

    57.2KRW

    0.6%

  • AE

    193.8KRW

    0.6%

  • STEEM

    146.4KRW

    2.1%

  • SNT

    12.9KRW

    -0.8%

  • ETN

    4.5KRW

    -3.1%

  • GNT

    44.4KRW

    1.2%

  • NPXS

    0.2KRW

    0.5%

  • ELF

    73.5KRW

    -0.9%

  • XZC

    4,212.8KRW

    -0.2%

  • AOA

    5.6KRW

    0.6%

  • STRAT

    362.0KRW

    2.0%

  • FCT

    3,755.7KRW

    6.8%

  • PPT

    635.8KRW

    2.2%

  • ELA

    1,919.9KRW

    -0.1%

  • AION

    77.0KRW

    -5.2%

  • WTC

    629.0KRW

    -1.1%

  • LRC

    29.4KRW

    0.1%

  • ARK

    220.5KRW

    0.8%

  • LOOM

    24.9KRW

    -8.2%

  • R

    49.1KRW

    -3.3%

  • WAX

    24.0KRW

    -3.5%

  • POWR

    52.2KRW

    10.8%

  • RDD

    0.8KRW

    -1.3%

  • MOAC

    329.5KRW

    -0.5%

  • BNT

    325.6KRW

    2.7%

  • PAI

    14.1KRW

    0.3%

  • PAI

    14.1KRW

    0.3%

  • ANT

    635.9KRW

    -0.3%

  • DENT

    0.2KRW

    2.4%

  • ODE

    71.5KRW

    2.0%

  • PIVX

    265.8KRW

    -0.9%

  • REPO

    124.6KRW

    136.3%

  • TTC

    33.8KRW

    -1.5%

  • POLY

    27.8KRW

    4.1%

  • PAY

    67.0KRW

    -1.9%

  • BAAS

    1.8KRW

    0.4%

  • MBL

    2.0KRW

    -0.0%

  • EOSC

    7.3KRW

    1.7%

  • APIX

    0.7KRW

    22.7%

  • BORA

    9.0KRW

    0.5%

  • CPT

    1.9KRW

    -1.3%

  • FNB

    4.5KRW

    -15.8%

  • GUSD

    1,189.9KRW

    -0.4%

  • COSM

    7.0KRW

    -1.4%

  • AERGO

    39.7KRW

    9.4%

  • HUM

    8.5KRW

    -6.9%

  • FLETA

    9.5KRW

    -0.6%

  • UPP

    12.0KRW

    -1.7%

  • VRA

    1.1KRW

    2.2%

  • MVL

    0.4KRW

    -0.6%

  • DCC

    0.9KRW

    0.5%

  • LKY

    51.0KRW

    2.1%

  • eDEL

    2.4KRW

    -0.7%

  • MEETONE

    1.1KRW

    -0.6%

  • TEMCO

    0.6KRW

    -2.3%

  • RBG

    1.0KRW

    -23.9%

  • ABL

    6.2KRW

    -27.7%

  • AMON

    2.5KRW

    54.8%

  • AKRO

    1.7KRW

    -10.7%

  • AID

    2.5KRW

    3.4%

  • PTON

    0.1KRW

    41.6%

  • WET

    5.6KRW

    -1.2%

  • PXL

    20.2KRW

    -2.0%

  • CLB

    1.6KRW

    -0.2%

  • KARMA

    0.1KRW

    6.6%

  • XRA

    4.8KRW

    -30.5%

  • RBTC

    8,704,144.4KRW

    -1.1%

  • WIKEN

    1.6KRW

    -23.0%

  • SEAL

    0.8KRW

    0.5%

  • NEWS

    1.2KRW

    -2.0%

  • PUB

    0.2KRW

    11.9%

  • NPER

    3.5KRW

    0.5%

  • HORUS

    0.2KRW

    0.6%

  • CCH

    0.1KRW

    --%

  • PUT

    1.1KRW

    -20.6%

  • KNT

    0.0KRW

    42.0%

  • IQ

    3.1KRW

    -0.2%

  • BLACK

    0.6KRW

    -18.0%

  • CET

    17.9KRW

    -1.2%

  • RCD

    3.0KRW

    --%

  • MCC

    0.4KRW

    0.5%

  • INC

    0.2KRW

    -2.7%

  • BZKY

    0.1KRW

    -78.8%

  • CRE

    2.1KRW

    15.2%

Community

Nano How 2: Blocks and Lattices

Nano | 12.02| 39

Tl;dr — The Nano block lattice is made up of blocks. Each complete transaction requires two blocks, one to send and another to receive. Changing your representative requires another block. A block contains all the information required for managing your Nano and is signed with a private key so only the owner can make changes. They are assigned a unique code called a hash.

What is a block?

Blocks are one of the fundamental concepts in cryptocurrency. They are groups of data linked together and usually represent transactions and interactions. These blocks are verified by the network and committed into a distributed ledger after being confirmed. For example, in Bitcoin, blocks are verified and committed to the ledger through the mining process, and each block is linked to the next to form a chain.

Blocks in Nano

The Nano ledger is different; instead of a single chain for the whole ledger (where each block aggregates multiple transactions), each account has its own chain of blocks which are woven together as new transactions are added to the network to create a block lattice. The blocks in a Nano chain represent the changes that its owner, who holds the private key, has made to their account. These changes take one of the following forms:

  • A send block, which is signaled by a resulting lower balance in the chain.
  • A receive block, which results in a higher balance in the chain.
  • An open block, the first in every chain.
  • A change block, used to choose a new representative.
  • An epoch block.
Fig 1. Comparison between Bitcoin Blockchain and Nano Block Lattice

How does it work?

Originally, Nano had 4 different block types: Open, Send, Receive and Change, each with slightly different layouts. However, these have since been merged into a single block type called a State block. Each state block contains all the details of that account, including the address and balance, as well as details to help place the block in the correct position in its chain. A block is then authorized by a digital signature created using the block details and the account’s private key.

Fig 2. Components that go into a state block

The most recent block is called the head or frontier block as its at the front. With the introduction of state blocks, only the frontier is necessary to know everything about the current state of account. The exception are pending blocks, that is, those that have been sent by other accounts, but not yet received.

With all this data grouped together in the state block structure, it is easy to make changes:

  • To send some Nano, include the destination address in the block and reduce the account’s balance by the amount you are sending.
  • To receive Nano previously sent to an account, include the hash (unique id) of the corresponding send block and increase the balance by this amount.
  • To change representative, include the new account in the representative field.

Notice that the amount transacted is not directly present in any block. To obtain this value, it is necessary to subtract the previous block’s balance from the frontier block’s balance.

Each block needs a work value; this is the resulting value following a resource consuming mathematical calculation and will be discussed in detail in a future Nano Education article. The idea is for this number to be hard to generate, but easy to validate. Interestingly, the work value is actually not included in the signature of the block, and can be obtained after the block is generated (but it needs to be present before the block is broadcast, or it will be rejected).

An example of a state block, in a JSON-encoded format:

"block": {
"type": "state",
"account": "nano_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft8tkp79za3sxwjym5rx",
"previous": "92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D",
"representative": "nano_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou",
"balance": "3618869000000000000000000000000",
"link": "5C2FBB148E006A8E8BA7A75DD86C9FE00C83F5FFDBFD76EAA09531071436B6AF",
"link_as_account": "nano_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p",
"signature": "79240D56231EF1885F354473733AF158DC6DA50E53836179565A20C0BE89D473ED3FF8CD11545FF0ED162A0B2C4626FD6BF84518568F8BB965A4884C7C32C205",
"work": "fbffed7c73b61367"
}

It is important to note that other nodes in the network check the blocks to make sure that all the details line up and will reject an incorrect block — it is not possible to just create a new block with a larger balance than what has been sent to you.

Why does Nano have a Send and Receive block?

Every account has its own chain and this chain can only be altered with blocks signed by the account’s private key. When someone sends you Nano, they create a new block with a reduced balance and a destination address but they can not change your chain; instead, the funds remain as confirmed by the network, but in a limbo (known as pending) until the corresponding receive block is created and increases the balance proportionally. There is no limit to how long the funds can stay pending.

Links and further reading

Special thanks to John “xeer0s” Pesonen for making the Nano Education logo.

Any opinions expressed by the Guest writer are their’s alone, and do not necessarily reflect the views of the Nano Foundation (NF), its officers or employees. Any links to third party sites are for information only, and may offer commercial or financial services or products which may: be subject to additional regulation; or, not lawfully be promoted to you in your jurisdiction. The inclusion of any such link is not an approval, endorsement or guarantee of that website, any information you may obtain from it, or the site’s owner (or their products/services), nor certification that the site is suitable or lawful for you to view or use. NF disclaims any and all liability for the acts, omissions and conduct of any such third parties and Guest writer. YOUR ACCESS TO AND USE OF ANY EXTERNAL SITE IS ENTIRELY AT YOUR OWN RISK.


Nano How 2: Blocks and Lattices was originally published in Nano on Medium, where people are continuing the conversation by highlighting and responding to this story.

Comment 0

delete

Are you sure you want to delete this post?