Clarity Language
Clarity is a new language that brings smart contracts to Bitcoin. It is a decidable language, meaning you can know, with certainty, from the code itself what the program will do. Clarity is interpreted (not compiled) & the source code is published on the blockchain. Clarity gives developers a safe way to build complex smart contracts. The Clarity open-source project is supported by the Stacks ecosystem, Hiro PBC, & Algorand.
HIGH-STAKES TRANSACTIONS
Why Clarity?
Predictable
The Clarity language uses precise and unambiguous syntax that allows developers to predict exactly how their contracts will be executed.
Secure
The Clarity language allows users to supply their own conditions for transactions that ensure that a contract may never unexpectedly transfer a token owned by a user.
No compiler
Contracts written in Clarity are broadcasted on the blockchain exactly as they are written by developers. This ensures that the code developers wrote, analyzed, and tested, is exactly what gets executed.
WSIWYG
Clear code
01
02
03
04
05
06
07
08
09
10
11
12
13
14
(define-data-var counter int 0)

(define-public (increment)
(begin
(var-set counter (+ (var-get counter) 1))
(ok (var-get counter))))
(define-public (decrement)
(begin
(var-set counter (- (var-get counter) 1))
(ok (var-get counter))))
(define-read-only (get-counter)
(var-get counter))
RESOURCES
Getting Started
The future of Smart Contracts
Clarity recognizes the need for smart contract languages that are more safe, secure, and predictable. Our goal is to help the smart contract industry mature beyond its current state. Clarity is designed by scientists from Princeton and MIT, and the open-source project is initially supported by Blockstack and Algorand. We welcome other projects and developers to join this effort and help contribute!
LIGHT MODE