• Stars
    star
    2,040
  • Rank 22,678 (Top 0.5 %)
  • Language
  • Created over 10 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Overview of Bitcoin's Stacks layer.

Stacks: A Bitcoin Layer for Smart Contracts

Stacks is a Bitcoin layer for smart contracts; it enables smart contracts and decentralized applications to trustlessly use Bitcoin as an asset and settle transactions on the Bitcoin blockchain.

โžก๏ธ Read the Stacks whitepaper html pdf
โžก๏ธ Read the sBTC whitepaper html pdf
>> See the Stacks overview slides (slightly outdated).

The initial version of Stacks, launched in early 2021, introduced Bitcoin settlement of transactions, the Clarity language for safe contracts that can respond to Bitcoin transactions, and atomic swaps of assets with BTC. The next major proposed upgrade of Stacks, the Nakamoto release (see SIP-021), adds important capabilities that will enhance the power of Stacks as a Bitcoin layer: (a) a trustless, two-way Bitcoin peg to move BTC in/out of the layer and write to Bitcoin, (b) transactions secured by Bitcoin finality, and (c) fast transactions in between Bitcoin blocks. The resulting Stacks layer makes Bitcoin a fully programmable asset in a trustless manner. This can make hundreds of billions of dollars of passive Bitcoin capital productive, and make Bitcoin the backbone of a more secure web3.

The Stacks layer for smart contracts has the following innovations that make it unique:

S โ€“ Secured by the entire hash power of Bitcoin (Bitcoin finality).
T โ€“ Trustless Bitcoin peg mechanism; write to Bitcoin.
A โ€“ Atomic BTC swaps and assets owned by BTC addresses.
C โ€“ Clarity language for safe, decidable contracts.
K โ€“ Knowledge of full Bitcoin state; read from Bitcoin.
S โ€“ Scalable, fast transactions that settle on Bitcoin.

Why Bitcoin? Bitcoin is the most durable and secure blockchain. Bitcoin is minimal by design and is meant to not change. Stacks layer brings more functionality to Bitcoin without modifying Bitcoin L1. Thousands of transactions at the Stacks layer result in a settlement at the Bitcoin L1, and Stacks microblocks offer fast confirmations of streaming transactions. Bitcoin is used as a settlement layer and fast transactions in-between two Bitcoin blocks are proposed for the Nakamoto release (SIP-21). Further, scalability is enabled as subnets, amongst other scalability solutions (like appchains).

Bitcoin's Stacks layer makes BTC productive in two ways:

  • Stacks consensus enables a trust-minimized Bitcoin peg mechanism, called sBTC. A dynamic group of economically incentivized actors operate the peg. See the sBTC page for more details.
  • Further, through atomic swaps BTC can be trustlessly swaped and deployed into DeFi applications, NFT marketplaces etc. For example, see Magic BTC atomic swaps and Catamaran BTC atomic swaps, and Lightning swaps.

You can see some applications built using Stacks here.

Stacks asset (STX) is used for mining incentives (block subsidy for miners) of the Stacks layer and for incentives for sBTC peg-out signing. These miners secure the global ledger of the Stacks layer. This data cannot be stored at the Bitcoin main chain and needs to be stored outside Bitcoin. STX is also used as gas for smart contract execution. STX is a unique crypto asset that can be locked by STX holders to earn Bitcoin rewards from the protocol. More details on earning Bitcoin rewards are at stacking.club.

STX was distributed to the general public through the first-ever SEC qualified token offering in US history. The project decentralized before the mainnet launch in Jan 2021. There are 30+ independent companies that work in the ecosystem.

Clarity Language for Smart Contracts

Clarity is a new language for smart contracts that focuses on safety. Clarity is a decidable language, meaning you can know, with certainty, from the code itself what the program will do. Clarity is interpreted (not compiled) and the source code is published on the blockchain (see this deployed code for the PoX contract).

For details, see the Clarity book and Clarity website.

Proof-of-Transfer (PoX)

PoX consensus is a new algorithm that spans consensus between the Bitcoin blockchain and the Stacks layer. Unlike burning electricity in proof-of-work, miners bid by spending BTC and get a random probability for becoming a leader. Leader election happens on Bitcoin and new blocks are written on the Stacks layer. Miners use BTC to mine newly minted STX. PoX recyles proof-of-work energy to provide Nakamoto-style consensus for the Stacks layer.

See this post on PoX for more details.

Resources

Some resources for further details:

Code

Check out the latest docs for the easiest way to get started!

If you're just starting with Stacks, here are the main software repositories you should checkout:

How to Help

  • Contribute open-source code - send us pull requests with improvements! See some good first issues.
  • Help with software testing - we encourage the community to run the software and file issues.
  • Become a community evangelist - join community leaders around the world supporting our mission.
  • Weekly Stacks meetings on Discord.

Resources

More Repositories

1

stacks-core

The Stacks blockchain implementation
Rust
3,010
star
2

sbtc-developer-release

sBTC primitives, signer components, helper tools
Rust
1,983
star
3

blockstack-browser

The Blockstack Browser
JavaScript
1,129
star
4

gaia

A decentralized high-performance storage system
TypeScript
762
star
5

pybitcoin

A Bitcoin python library for private + public keys, addresses, transactions, & RPC
Python
274
star
6

sbtc

Repo containing sbtc
Rust
204
star
7

docs

Unleash Bitcoin's full potential with decentralized apps and smart contracts. The documentation covers key aspects of the Stacks network and technology and provides tutorials and other helpful content for developers.
JavaScript
157
star
8

blockstack.org

The Blockstack website
JavaScript
135
star
9

radiks

A client-side framework for building model-driven decentralized applications.
TypeScript
97
star
10

virtualchain

Library for scanning blockchains and running Blockstack state engines
Python
95
star
11

reading-list

Reading list of research papers on blockchains, P2P networks, consensus etc
79
star
12

clarity-js-sdk

Javascript SDK for interacting with Clarity smart contracts
TypeScript
63
star
13

blockstack-explorer

A block explorer for Blockstack
JavaScript
62
star
14

radiks-server

A server for indexing data in decentralized applications
TypeScript
55
star
15

zone-file-py

DNS Zone File Converter
Python
50
star
16

app-mining

For App Mining landing page development and App Mining operations.
49
star
17

jsontokens-js

Library for encoding, decoding, and verifying JSON Web Tokens (JWTs) in node.js
TypeScript
46
star
18

blockstack-android

The Blockstack Android library for identity, auth and storage
JavaScript
45
star
19

animal-kingdom

JavaScript
44
star
20

key-encoder-js

Library for encoding and decoding ecdsa private keys and converting between formats
TypeScript
44
star
21

blockstack-app-generator

Blockstack app generator
JavaScript
43
star
22

blockstack-ios

The Blockstack iOS library for identity, auth and storage
JavaScript
42
star
23

atlas

The Atlas peer network
CSS
41
star
24

app.co

The universal dapp store
JavaScript
39
star
25

blockstack-react-native

SDK for React Native
Kotlin
34
star
26

stacks-blockchain-docker

Stacks-blockchain with API using docker compose
Shell
28
star
27

blockstack-ruby

The Blockstack Ruby library for auth and identity
Ruby
26
star
28

designs

Blockstack designs
HTML
26
star
29

subdomain-registrar

Subdomain registrar for the Stacks network
JavaScript
20
star
30

stacks-transactions-js

The JavaScript library for generating Stacks 2.0 transactions
TypeScript
19
star
31

blockstack-proofs-py

For verifying proofs (twitter, github, domains etc) linked to a blockchain ID
Python
19
star
32

keychain-manager-js

A key system for hierarchical deterministic (HD / BIP32) keychains
JavaScript
15
star
33

python-utilitybelt

Miscellaneous python utilities.
Python
15
star
34

cli-blockstack

Node.js CLI for Blockstack, built on blockstack.js
TypeScript
14
star
35

sbtc-bridge-web

Web tool to facilitage peg operations for sBTC
Svelte
14
star
36

clarity-wasm

`clar2wasm` is a compiler for generating WebAssembly from Clarity.
Rust
13
star
37

keylib-py

Library for elliptic curve (ECDSA) private keys, public keys, and bitcoin addresses.
Python
12
star
38

blockstack-files

End-to-end encrypted file sharing with Blockstack
Python
12
star
39

omniauth-blockstack

OmniAuth Blockstack plugin
Ruby
11
star
40

c32check

Crockford base-32 encoding with 4-byte checksum
TypeScript
11
star
41

evangelists

10
star
42

blockstack-collections

TypeScript
10
star
43

BlockstackCoreApi-iOS-deprecated

The Blockstack Core API for iOS [deprecated]
Swift
10
star
44

sbtc-docs

Documentation about sBTC
JavaScript
9
star
45

daily-scrum

What community members are working on today
9
star
46

blockstack-utxo

Library for interfacing with various UTXO providers, including ones for testing purposes.
Python
9
star
47

discord-automod

Discord Bot for community moderation
JavaScript
9
star
48

discourse-blockstack

A discourse plugin to enable log in with Stacks
Ruby
9
star
49

blockstack-stats

A site for displaying live Blockstack stats
CSS
9
star
50

blockstack.go

Go
8
star
51

packaging

Packaging utilities for Blockstack repositories
Python
8
star
52

stacks-utils

Utilities for the Stacks blockchain.
JavaScript
6
star
53

stats

A client/server package for privacy-preserving analytics
JavaScript
6
star
54

sbtc-bridge-api

TypeScript
6
star
55

blockstack-search-indexer

Search indexer for Blockstack names and profiles
JavaScript
6
star
56

blockstack-storage-js

Blockstack storage API access for Javascript clients
JavaScript
6
star
57

clarity-vscode

VSCode extension for: Clarity Language Syntax Highlighting
6
star
58

send-many-stx-cli

A simple CLI for making a bulk STX transfer in one command.
TypeScript
6
star
59

blockstack.org-api

The proxy API for blockstack.org
Python
5
star
60

blockstack-explorer-api

TypeScript
5
star
61

blockstack-consensus-data

Test traces from prior versions to verify consensus continuity on hard forks
5
star
62

blockchainprotocols.org

Blockchain protocol stats
JavaScript
4
star
63

design-system

4
star
64

app.co-api

JavaScript
3
star
65

stacks-blockchain-testground

Go
3
star
66

.github

Repository to hold defaults such as CONTRIBUTING and CODE_OF_CONDUCT
3
star
67

stacks-test-tools

Repo for testing
TypeScript
3
star
68

whitepapers

Stacks whitepapers
3
star
69

stackit

UNDER CONSTRUCTION: Sample Application for Blockstack
JavaScript
2
star
70

atlas-monitor

Network monitoring for Blockstack's Atlas network
CSS
2
star
71

transaction-broadcaster

Transaction and Zonefile Broadcaster Service for Blockstack
JavaScript
2
star
72

when-activation

HTML
2
star
73

updates.blockstack.org

Update server for the Blockstack macOS app
2
star
74

blockstack-app-android

Java
1
star
75

docs-api

JavaScript
1
star
76

bounties

1
star
77

blockstack-todos-vue

CSS
1
star
78

clarity-benchmarking

Jupyter Notebook
1
star
79

blockstack-ledger-signer

Library for signing Blockstack transactions with a Ledger
JavaScript
1
star