2022-09-27 16:02:09 -04:00
2021-02-10 17:21:33 -06:00
2022-09-27 16:02:09 -04:00
2022-08-23 14:56:06 -05:00
2022-09-16 13:42:09 -05:00
2018-11-05 00:44:35 -05:00
2022-09-15 11:59:58 -05:00
2022-07-11 14:22:39 -05:00
2022-08-08 16:35:40 -05:00
2020-02-12 10:38:11 -05:00
2021-01-13 10:24:31 -06:00
2020-04-15 09:34:25 +02:00
2020-04-17 13:57:39 -04:00
2021-09-02 18:47:08 -05:00
2022-07-01 16:45:04 -05:00
2022-05-17 12:30:39 -05:00
2015-08-11 14:53:29 -04:00
2022-07-11 14:22:39 -05:00
2022-09-16 14:04:12 -05:00

Subnets

Subnets are a layer-2 scaling solution in the Stacks blockchain that offers low latency and high throughput workloads. It enables developers to build fast and reliable experiences on Stacks.

Overview

Subnets are designed to transact on Stacks assets, meaning users can move assets in and out of subnets. While a users assets are in a subnet, they trust that subnets consensus rules. This subnet will interact with the Stacks chain using a smart contract specific to that subnet.

Note

The current implementation of subnets uses a 2-phase commit protocol amongst a fully-trusted pool of miners.

Below are some of the features of subnets:

  • Each subnet may define its throughput settings. The default implementation should support at least 4x high throughput for transactions and may reduce confirmation time from 10 minutes to 1 minute.
  • Interacting with a subnet is similar to interacting with a different Stacks network (example: testnet vs. mainnet).
  • The Stacks blockchain can support many different subnets.
  • Each subnet may use the same or different consensus rules.
  • This repository implements a consensus mechanism that uses a two-phase commit among a federated pool of miners.
  • To deposit into a subnet, users submit a layer-1 transaction to invoke the deposit method on that subnet's smart contract.
  • For withdrawals, users commit the withdrawal on the subnet and then submit a layer-1 transaction to invoke the subnet's smart contract's withdraw method.

Architecture

This diagram outlines the interaction between a subnet and the Stacks layer-1 chain.

Architecture of subnets.

When a miner proposes a block to the other miners, the other miners must approve and sign the block before it can be committed to the subnet.

Screenshot of subnet miners proposing and approving the blocks.

Trust models in subnets

The current implementation of subnets uses a federated system of miners. This federation is fully-trusted, but future work on subnets will explore alternative trust models.

In a fully - trusted model:

  • Miners are responsible for issuing subnet blocks.
  • Users can validate, but subnet miners control withdrawals.
  • Trust can be federated with a 2-phase commit and BFT protocol for miner block issuance.
  • Federation requires a majority of miners to approve withdrawals.

Getting started

You can start with an NFT use case demo here.

Resources

Description
No description provided
Readme GPL-3.0 93 MiB
Languages
Rust 95.5%
Clarity 1.6%
TypeScript 1.4%
Shell 1.2%
JavaScript 0.2%