AuthorTopic: Nxt 2.0 design (Read 170006 times)

We have been brainstorming the Nxt 2.0 design for some time now, and here is our current proposal. This is a high level summary, and many details are not yet known, more specific design decisions will be made as the development moves along. What we propose is a significant architectural change, not just a bundle of features. And it will take us some time to get there.

- A new main chain will be created, on which NXT becomes a token used for forging only, "forgingNXT". The current NXT ecosystem will become a child chain, preserving all features and holdings except the ability to forge. At the hard fork block, each NXT owner will have his NXT converted to both tokens in 1:1 ratio, and all other holdings migrated to the NXT child chain.

- It will always be possible to exchange NXT to fNXT, so small stakeholders not interested in forging may decide to sell their fNXT to large stakeholders running forging nodes. This would lead to some centralization, but also to a higher percentage of the (f)NXT stakeholders forging and thus securing the complete Nxt ecosystem.

- Child chains will all run the same code, but each one can be configured to have only a subset of the all possible features if needed. The NXT child chain will have all possible transaction types enabled.

- Each child chain will have its own native token/currency, in which payment transactions are denominated, asset ask/bid orders are placed, digital goods are priced, etc. Child chain transaction fees will also be in the native token.

- All transactions from all chains must be processed by all nodes. All nodes will carry all child chains for the last 1440 blocks at least. Archival nodes can opt to store one or more child chains longer, or indefinitely.

- Transactions on the child chains will be pruned completely after 1440 blocks on nodes not configured to archive them longer. A new node downloading the blockchain from scratch must make the assumption that since the forgers and all nodes that were running the blockchain at the time the prunable data was still there approved those transactions, they must have been valid at that time, even though the data to validate them again is no longer available.

- It must be possible to validate though that the effective fNXT balances of the forgers were indeed those that they claim to be. This is why transactions on the forging chain which change fNXT balances cannot be pruned, and must be kept to a minimum of essential transaction types.

- The child chain "blocks" will be implemented as a prunable attachment of a single (one per block per chain) transaction, of type ChildchainBlock, on the main chain. Anyone can create a ChildchainBlock transaction. However, it is up to the forgers that create blocks on the main chain to decide whether to include this ChildchainBlock transaction in a block. Forgers, just like all nodes, do full validation of all child chain transactions included in a ChildchainBlock, as long as the data has not been pruned yet.

- If there have been no transactions on a chain, there is no need to create a ChildchainBlock transaction for it, unlike the main chain where we continue to have blocks every 60s even if they are empty. We can think about reducing the main chain block times in order to allow for some child chains to have more frequent blocks.

- The forgers will accept fees in fNXT only, with the minimum fee required by the protocol for each transaction type also denominated in fNXT.

- When a ChildchainBlock transaction is included by a forger in the main chain, its creator pays a fee in fNXT to the forger. The amount of this fee is up to the ChildchainBlock creator, but must be at least equal to the total of minimum fees calculated in fNXT for each child chain transaction included. In return, the ChildchainBlock creator receives the fees, in native child chain token, paid by the senders of those child chain transactions.

- The exchange rate of child chain token to fNXT will therefore be determined by market forces. If no-one is willing to include a child chain transaction in a ChildchainBlock, it would mean that the fee offered in native token is not considered equivalent to the required minimum fNXT fee for this particular transaction, and such transaction will expire unconfirmed. If the value of the child chain native token drops to zero, no-one will be willing to create ChildchainBlocks for it, and transaction processing on this childchain will stop.

- Child chains will compete with each other for inclusion into a block, since at the end the forgers will still look at the fee/size ratio for each transaction and will want to maximize their forging profits, subject to main chain block size and transaction numbers limits.

- Before the pruning, each node must verify not only that the hash of the ChildchainBlock transaction matches, but that all transactions of the child chain enclosed within it are valid, i.e. there is no double spending, and all other validations. For that the node needs to know the current balances for all account holdings, on that child chain. To be able to still do pruning, we need a snapshot transaction, which takes a snapshot of the current child chain state only, without any history that led to this state. Then, after this transaction has been accepted in the blockchain for more than 720 blocks, we can assume that it is valid, prune all history for that chain before that snapshot, and discard the previous snapshot.

- The snapshot transaction for each child chain is created at regular intervals, such as 1440 blocks, by the forger of the current block. It will only contain the hash of the snapshot, not the full snapshot data.

- The snapshot data itself does not need to propagate through the network when the snapshot transaction is created. Each node that already is up to date, already has the state of the child chain being snapshotted, so it can generate such a snapshot for itself. It must only validate that the hash the forger calculated for the snapshot indeed matches its own snapshot.

- It is only nodes that are downloading the blockchain from scratch that would need to download the latest complete snapshot, and this is another reason that each node must generate and keep around this snapshot, to be able to serve it to such new nodes. The snapshot download can be in a torrent-like manner, different pieces from multiple nodes.

- Because every up-to-date node needs to validate all current transactions, even though we significantly reduce the long term blockchain bloat problem in terms of disk space used, and bandwith to download the blockchain from scratch, there will still be a bottleneck in terms of CPU for processing data on all chains, and the bandwith of having to receive and process current transactions for all chains. But since nodes don't need to validate past child chain transactions that have already been pruned, overall downloading the blockchain from scratch should be faster and less CPU intensive.

- The forging chain which all nodes share guarantees security, even for child chains that don't have many users and have transactions only occassionally. In return, each of the child chains gets the ability to be pruned. Child chains no longer need to keep all their old data going back to genesis in order to be secure, because they do not forge.

- As a first step, we will start with just the forging main chain, and the NXT chain as a single child chain to it, and perhaps a test child chain. Once we have this working, we implement the features required to be able to dynamically create a new child chain, or edit the properties of existing child chains.

We have been brainstorming the Nxt 2.0 design for some time now, and here is our current proposal. This is a high level summary, and many details are not yet known, more specific design decisions will be made as the development moves along. What we propose is a significant architectural change, not just a bundle of features. And it will take us some time to get there.

- A new main chain will be created, on which NXT becomes a token used for forging only, "forgingNXT". The current NXT ecosystem will become a child chain, preserving all features and holdings except the ability to forge. At the hard fork block, each NXT owner will have his NXT converted to both tokens in 1:1 ratio, and all other holdings migrated to the NXT child chain.

- It will always be possible to exchange NXT to fNXT, so small stakeholders not interested in forging may decide to sell their fNXT to large stakeholders running forging nodes. This would lead to some centralization, but also to a higher percentage of the (f)NXT stakeholders forging and thus securing the complete Nxt ecosystem.

Wow, I have to let this sink for a while. This is a huge change. I can see the benefits of it. What does "each NXT owner will have his NXT converted to both tokens" mean? That if I hold 10,000 NXT I would receive 10,000 NXT and 10,000 fNXT?

I am a little skeptic but I think you have put much thought into it. So I assume correctly that "official" Nxt childchain looks very similar to the current chain? But there is a meta "fNxt" chain above this, which holds and maintains the fNXT? Need to think this through and am looking forward to more discussions about this concept!

Have you considered cross chaining? Since there is a mother chain for forgning, will there be a bridge chain as well?

I assume some children will be public while others will be permissioned. Would it be sensible to keep the tx in the mother chained pruned from the start? What I mean is that you could still forge a childs' records but not leak any data at all from the child, i.e records in the mother will only be a signed hash which can be used to validate the history of the child.

Current forging do not yield a lot of profit. So the official NXT child chain should not be very much affected at the fork. I see that fNXT would take value eventually as more and more child chain are registered. Actually, at fork, probably the fNXT will drop in value compare to NXT. Indeed, there is a lot of current NXT that do not forge, so those extra fNXT might be sold after the fork.

If I understand correctly, the official NXT child chain will be the only chain who will always be process no matter the market dept of the fNXT/NXT? Because, I understand that some child chain could stop functionning if this dept is empty, and of course this should never happen on the official NXT child chain.

Overall, I'm not so sure what will be the main difference between the official NXT child chain and the other child chain. What are the avantage of using the main NXT child chain instead another child chain?

Anyone can create a ChildchainBlock transaction. However, it is up to the forgers that create blocks on the main chain to decide whether to include this ChildchainBlock transaction in a block.

(..)

- The exchange rate of child chain token to fNXT will therefore be determined by market forces. If no-one is willing to include a child chain transaction in a ChildchainBlock, it would mean that the fee offered in native token is not considered equivalent to the required minimum fNXT fee for this particular transaction, and such transaction will expire unconfirmed. If the value of the child chain native token drops to zero, no-one will be willing to create ChildchainBlocks for it, and transaction processing on this childchain will stop.

Can forgers choose individually which ChildchainBlocks they want to forge?

Let’s say a business creates a sidechain, offers a service, charges users in a native token (would this be an MS currency?) but the business also runs its own forging node. Could this business make its forging node include all childchain transactions from its own childchain? Or does the childchain need consensus among all fNXT to get transactions processed?

The business might want to spend money earned via the childchain service to cover costs for its own forging node, even if forging the childchainblocks earns them no fNXT. If consensus among all forging nodes are needed to get transactions processed, could the business itself pay extra rewards to the forgers who forge their (fee-less) ChildchainBlocks? In other words; Charging users for transactions is not the only way to make money. Is there a way for a business to cover transaction costs for their users?

The fees are interesting. After reading it a few times, I think I understand how it is supposed to work. Fees on a child chain are paid in its native token and paid to the chain creator. However, when a fee is paid, the creator of the chain also pays a fee of at least the minimal fNXT needed. So every time a transaction happens, the creator needs fNXT, but will receive the chain's native coins.

This is quite a big change. Noib question: how are ms tokens and child chains different from each other? Functionally speaking. What benefits are there to child chains over creating ms currencies?

Since each child chain will inherit the same properties as the current main nxt system, does this mean that each new child chain becomes a dependent sub-economy, but essentially just a clone of the original nxt design?

From what I now gather, this will allow for multiple public and private blockchains ecosystems to run simultaneously under one bucket. How does this benefit the creators of these side chains? Why would they choose to create a nxt side chain instead of just a clone?

In the current model, the fees goes to the forgers. In the child chain model, who gets all the fees for all the transactions in a particular child chain? The creator? Then who will get all the fees currently being generated in the main nxt child chain?

In the current model, the fees goes to the forgers. In the child chain model, who gets all the fees for all the transactions in a particular child chain? The creator? Then who will get all the fees currently being generated in the main nxt child chain?

Sent from my ASUS_Z00LD using Tapatalk

All fees go to the forgers via fnxt. Therefore fnxt will hold value because it's needed as fees to secure the network. How the fnxt is bought or given to the forgers, I don't know. If it's up to the creator, then I too am wondering who will pay fees for the current nxt chain (unless there is some sort of peg?).

If it is paid by the users of the chain, do they require to hold fnxt purely for fees?

I will try to give my simplified understanding of the idea:At the moment of time all nxters will have 2 coins instead of one (I call them Forgies and Coinies). If you had 10000 NXT you will get 10000 Forgies and 10000 Coinies. You can forge with Forgies and have normal NXT experience with Coinies. Surpisingly Coinies can be converted to Forgies 1:1 so we will have 2x amount of Forgies now.Now someone may create another coin (let's call it Monies). Those Monies can be traded and moved around by Monie users and fees are being payed in Monies too. But in order to snapshot this activity in the blockchain someone should pay some Forgies to the forgers.

Now my concerns about this design:1. It looks like a Monetary System done right. Thanks for it.2. Who will be paying Forgies (fNXT) for writing the sidechain blocks into blockchain? If you will require sidechain users to do it the design will be as unusable as current implementation of MS. Each user will need to store some Forgies together with his Monies in his wallet. It is not user friendly at all.3. This decision may be economically devastatable for NXT. Right now forging is not profitable but it is connected to the value of the NXT token such as divs payment, messaging, permanent storage and currency features. In the new design the Forgie token cannot do anything but forging. It cannot be used for anything hence the price will be nearing zero (and do not forget 2x supply). I expect each Forgie price to set at 1/10 of NXT price at the fork moment and declining in the future leading to lower blockchain security.

I will try to give my simplified understanding of the idea:At the moment of time all nxters will have 2 coins instead of one (I call them Forgies and Coinies). If you had 10000 NXT you will get 10000 Forgies and 10000 Coinies. You can forge with Forgies and have normal NXT experience with Coinies. Surpisingly Coinies can be converted to Forgies 1:1 so we will have 2x amount of Forgies now.Now someone may create another coin (let's call it Monies). Those Monies can be traded and moved around by Monie users and fees are being payed in Monies too. But in order to snapshot this activity in the blockchain someone should pay some Forgies to the forgers.

Now my concerns about this design:1. It looks like a Monetary System done right. Thanks for it.2. Who will be paying Forgies (fNXT) for writing the sidechain blocks into blockchain? If you will require sidechain users to do it the design will be as unusable as current implementation of MS. Each user will need to store some Forgies together with his Monies in his wallet. It is not user friendly at all.3. This decision may be economically devastatable for NXT. Right now forging is not profitable but it is connected to the value of the NXT token such as divs payment, messaging, permanent storage and currency features. In the new design the Forgie token cannot do anything but forging. It cannot be used for anything hence the price will be nearing zero (and do not forget 2x supply). I expect each Forgie price to set at 1/10 of NXT price at the fork moment and declining in the future leading to lower blockchain security.

If that is the case then forget asset/asset because that would just be one less purpose for coinies. Which would leave things like Aliases and sending messages? So why would anybody keep more than a few bucks worth of coinies at any given time? Even 2 million users with $5 in NXT would mean coinies would really never go anywhere.

I will try to give my simplified understanding of the idea:At the moment of time all nxters will have 2 coins instead of one (I call them Forgies and Coinies). If you had 10000 NXT you will get 10000 Forgies and 10000 Coinies. You can forge with Forgies and have normal NXT experience with Coinies. Surpisingly Coinies can be converted to Forgies 1:1 so we will have 2x amount of Forgies now.Now someone may create another coin (let's call it Monies). Those Monies can be traded and moved around by Monie users and fees are being payed in Monies too. But in order to snapshot this activity in the blockchain someone should pay some Forgies to the forgers.

Now my concerns about this design:1. It looks like a Monetary System done right. Thanks for it.2. Who will be paying Forgies (fNXT) for writing the sidechain blocks into blockchain? If you will require sidechain users to do it the design will be as unusable as current implementation of MS. Each user will need to store some Forgies together with his Monies in his wallet. It is not user friendly at all.3. This decision may be economically devastatable for NXT. Right now forging is not profitable but it is connected to the value of the NXT token such as divs payment, messaging, permanent storage and currency features. In the new design the Forgie token cannot do anything but forging. It cannot be used for anything hence the price will be nearing zero (and do not forget 2x supply). I expect each Forgie price to set at 1/10 of NXT price at the fork moment and declining in the future leading to lower blockchain security.

If that is the case then forget asset/asset because that would just be one less purpose for coinies. Which would leave things like Aliases and sending messages? So why would anybody keep more than a few bucks worth of coinies at any given time? Even 2 million users with $5 in NXT would mean coinies would really never go anywhere.

I don't think Coinie value will be hurt much. Many people do not bother forging. And Bitcoin does not have any functionality but sending and still it has nice value for people.

By the first look and reading it few times, I would say leave NXT alone, as it is now. All stuff with sidechains and if they will have own coin for their chain fees, looks great. I have in mind one real world use case, which is impossible to do with today NXT system, but sidechain with their internal fees solves my problem. No problem for sidechain to pay for main chain in NXT for securing it That could be solved by business project.