Be a crypto hero in the market by logging in

Don't you have an account? Sign in

Token price

  • BTC

    8,645,447.7KRW

    -2.5%

  • ETH

    173,240.9KRW

    -2.0%

  • XRP

    264.2KRW

    -1.4%

  • USDT

    1,195.4KRW

    -0.1%

  • BCH

    246,831.7KRW

    -1.0%

  • LTC

    54,759.1KRW

    -0.5%

  • EOS

    3,105.0KRW

    -2.3%

  • BNB

    17,709.6KRW

    -4.0%

  • BSV

    113,351.6KRW

    -0.3%

  • XLM

    63.8KRW

    -2.8%

  • TRX

    16.9KRW

    -2.1%

  • ADA

    43.4KRW

    -3.5%

  • XTZ

    1,699.2KRW

    -9.9%

  • XMR

    62,634.5KRW

    -2.8%

  • HT

    3,210.0KRW

    -3.3%

  • NEO

    10,161.4KRW

    -3.4%

  • MKR

    598,926.7KRW

    0.4%

  • USDC

    1,196.5KRW

    -0.0%

  • DASH

    59,523.0KRW

    -3.7%

  • ETC

    4,494.4KRW

    -1.6%

  • ONT

    698.2KRW

    -5.7%

  • VET

    7.3KRW

    -11.7%

  • XEM

    41.5KRW

    -2.3%

  • DOGE

    2.6KRW

    -0.9%

  • BAT

    208.5KRW

    -7.3%

  • ZEC

    35,794.5KRW

    -4.9%

  • PAX

    1,197.8KRW

    0.1%

  • DCR

    23,020.1KRW

    -2.2%

  • INB

    628.0KRW

    -1.4%

  • QTUM

    2,045.3KRW

    -1.9%

  • TUSD

    1,196.0KRW

    0.1%

  • LINK

    485.1KRW

    2.0%

  • ZRX

    263.1KRW

    -5.1%

  • RVN

    29.0KRW

    -23.1%

  • REP

    11,813.4KRW

    -3.4%

  • NANO

    954.6KRW

    -2.5%

  • CNX

    2,267.8KRW

    -1.5%

  • OMG

    855.9KRW

    -3.8%

  • BTG

    6,805.3KRW

    -3.2%

  • XIN

    254,137.2KRW

    -0.4%

  • XIN

    254,137.2KRW

    -0.4%

  • DGB

    7.7KRW

    -4.1%

  • LSK

    760.0KRW

    -6.2%

  • KCS

    1,115.3KRW

    -1.9%

  • BTM

    88.6KRW

    -5.1%

  • BTM

    88.6KRW

    -5.1%

  • KMD

    700.9KRW

    -8.3%

  • BCD

    439.2KRW

    -0.9%

  • THETA

    90.2KRW

    -9.9%

  • XVG

    4.9KRW

    -14.3%

  • MCO

    4,885.1KRW

    -2.7%

  • IOST

    6.4KRW

    -11.0%

  • ICX

    148.3KRW

    -6.2%

  • SC

    1.7KRW

    -5.6%

  • MONA

    1,050.4KRW

    -2.6%

  • ENJ

    85.5KRW

    -15.3%

  • DAI

    1,198.4KRW

    0.5%

  • BCN

    0.4KRW

    -12.2%

  • QNT

    5,337.5KRW

    -4.0%

  • BTS

    23.3KRW

    -2.4%

  • ZIL

    6.5KRW

    -12.7%

  • WAVES

    629.9KRW

    -7.8%

  • NEXO

    112.4KRW

    -2.1%

  • HC

    1,394.8KRW

    -2.5%

  • MAID

    132.3KRW

    -2.2%

  • STEEM

    162.5KRW

    11.1%

  • ARDR

    53.8KRW

    -5.1%

  • AE

    180.7KRW

    -6.8%

  • ETN

    4.4KRW

    -3.5%

  • SNT

    12.3KRW

    -3.5%

  • NPXS

    0.2KRW

    -3.0%

  • GNT

    40.0KRW

    -7.3%

  • ELF

    67.1KRW

    -8.9%

  • AOA

    5.4KRW

    -6.2%

  • XZC

    3,951.7KRW

    -5.8%

  • STRAT

    329.7KRW

    -7.9%

  • ELA

    1,806.6KRW

    -5.6%

  • FCT

    3,332.3KRW

    -4.2%

  • PPT

    551.3KRW

    -9.2%

  • LRC

    27.9KRW

    -5.9%

  • AION

    69.2KRW

    -7.0%

  • WTC

    569.2KRW

    -8.6%

  • R

    49.4KRW

    -1.0%

  • ARK

    199.8KRW

    -10.1%

  • WAX

    22.8KRW

    -4.5%

  • LOOM

    21.3KRW

    -14.1%

  • MOAC

    322.2KRW

    -2.2%

  • RDD

    0.7KRW

    -12.5%

  • BNT

    301.0KRW

    -6.3%

  • POWR

    44.8KRW

    -9.8%

  • ANT

    600.3KRW

    -5.5%

  • PAI

    12.8KRW

    -9.0%

  • PAI

    12.8KRW

    -9.0%

  • DENT

    0.2KRW

    -9.3%

  • ODE

    68.3KRW

    -2.9%

  • CET

    16.6KRW

    -6.8%

  • PIVX

    248.0KRW

    -9.7%

  • POLY

    31.2KRW

    5.9%

  • TTC

    30.5KRW

    -6.0%

  • PAY

    64.7KRW

    -2.9%

  • BAAS

    1.8KRW

    0.0%

  • MBL

    2.1KRW

    -16.2%

  • REPO

    63.9KRW

    44.9%

  • EOSC

    7.2KRW

    -7.1%

  • CPT

    1.8KRW

    -2.9%

  • BORA

    8.5KRW

    -7.5%

  • GUSD

    1,192.7KRW

    0.1%

  • APIX

    0.5KRW

    -21.1%

  • COSM

    6.8KRW

    -4.3%

  • FNB

    4.1KRW

    -3.5%

  • HUM

    8.6KRW

    -3.7%

  • AERGO

    37.1KRW

    -9.7%

  • FLETA

    9.1KRW

    -3.9%

  • UPP

    11.3KRW

    -7.1%

  • MVL

    0.4KRW

    3.5%

  • VRA

    0.9KRW

    -9.2%

  • DCC

    0.9KRW

    0.1%

  • LKY

    51.0KRW

    0.1%

  • eDEL

    2.4KRW

    -0.7%

  • RBG

    1.3KRW

    -5.0%

  • MEETONE

    1.0KRW

    -1.8%

  • TEMCO

    0.6KRW

    -6.3%

  • ABL

    6.2KRW

    -13.8%

  • AMON

    2.3KRW

    -8.3%

  • AKRO

    1.5KRW

    -12.4%

  • AID

    2.4KRW

    -0.8%

  • WET

    5.6KRW

    -0.7%

  • PXL

    20.5KRW

    0.5%

  • CLB

    1.6KRW

    0.8%

  • PTON

    0.0KRW

    -30.6%

  • HORUS

    0.7KRW

    282.7%

  • KARMA

    0.1KRW

    0.1%

  • SEAL

    1.0KRW

    29.3%

  • WIKEN

    1.9KRW

    18.8%

  • XRA

    4.9KRW

    -30.3%

  • RBTC

    8,522,814.9KRW

    -0.9%

  • NEWS

    1.2KRW

    0.7%

  • PUB

    0.2KRW

    5.0%

  • NPER

    3.5KRW

    0.1%

  • CCH

    0.1KRW

    -0.0%

  • PUT

    1.1KRW

    1.6%

  • KNT

    0.0KRW

    -33.6%

  • IQ

    3.2KRW

    1.5%

  • BLACK

    0.6KRW

    -0.1%

  • RCD

    3.0KRW

    --%

  • MCC

    4.1KRW

    815.2%

  • INC

    0.2KRW

    3.0%

  • BZKY

    0.1KRW

    0.1%

  • CRE

    1.7KRW

    -10.3%

Community

Nano How 2: Blocks and Lattices

Nano | 12.02| 40

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?