|
1 | 1 | ---
|
| 2 | +title: A typed, combinator-based, functional smart contract language without loops or recursion, designed for Bitcoin-like blockchains. |
2 | 3 | hide:
|
3 |
| - - navigation |
4 | 4 | - toc
|
5 |
| - - title |
6 | 5 | ---
|
7 | 6 |
|
8 |
| -## Key Features |
| 7 | +<div class="grid cards" markdown> |
9 | 8 |
|
10 |
| -### Expressive Smart Contracts |
| 9 | +- ### :material-code-braces: Expressive Smart Contracts |
| 10 | +Simplicity lets you define precise smart contracts with more structure than Bitcoin Script while remaining statically analyzable. Encode multi-step financial flows, conditional transfers, and asset logic in a form that can be reviewed and reasoned about. |
11 | 11 |
|
12 |
| -Simplicity allows developers to write contracts that go beyond the limitations of Bitcoin Script. Complex financial workflows, conditional payments, and tokenized assets can all be encoded efficiently and safely. |
| 12 | +- ### :material-gauge: Predictable Resource Usage |
| 13 | +Each program has a statically bounded cost. You know the upper execution bounds before funding a transaction, avoiding unpredictable fee dynamics. |
13 | 14 |
|
14 |
| -### Predictable Resource Usage |
| 15 | +- ### :material-microscope: Formally Specified |
| 16 | +The semantics are formally defined and suitable for machine-checked proofs. You can prove safety properties (e.g. no unauthorized spend path) and have high assurance the implementation matches the specification. |
15 | 17 |
|
16 |
| -Every Simplicity contract has clearly bounded computational costs. This ensures contracts run reliably on-chain without unexpected fees or execution failures. |
| 18 | +- ### :material-shield-check: Enhanced Security |
| 19 | +No loops or unbounded recursion, deterministic evaluation, and explicit control flow eliminate broad classes of runtime failure. Behavior matches the committed program; no hidden side effects. |
17 | 20 |
|
18 |
| -### Formally Specified |
| 21 | +- ### :material-link-variant: Seamless Bitcoin and Liquid Integration |
| 22 | +Designed for the Bitcoin-style networks. On Liquid you can bind assets and amounts while still benefiting from confidentiality at the transaction layer. |
19 | 23 |
|
20 |
| -Simplicity smart contracts can be formally specified using mathematical proof assistants, enabling rigorous verification of their behavior. This ensures that contracts behave exactly as intended, significantly reducing the risk of critical bugs and security vulnerabilities. |
| 24 | +- ### :material-source-branch: Support for Conditional Logic |
| 25 | +You can encode conditional payments, options, staged settlement, and automated triggers directly on-chain without relying on off-chain escrow logic or custodians. |
21 | 26 |
|
22 |
| -### Enhanced Security |
| 27 | +- ### :material-package-variant-closed: Compact and Efficient Design |
| 28 | +A small combinator core and Merkle-structured programs keep on-chain footprints low. Verification costs remain predictable and amenable to static analysis. |
23 | 29 |
|
24 |
| -Contracts are designed to behave exactly as written, reducing the risk of bugs or unintended outcomes. Users and institutions can trust that their rules and conditions will be enforced correctly. |
| 30 | +- ### :material-account-group: Compatibility with Multi-Party Workflows |
| 31 | +Multi-party spending policies, staged cooperation, and recovery paths are expressed as explicit branches. Participants retain sole control of their keys throughout. |
25 | 32 |
|
26 |
| -### Seamless Bitcoin and Liquid Integration |
| 33 | +</div> |
27 | 34 |
|
28 |
| -Simplicity is built for Bitcoin-style blockchains and Liquid, making it easy to integrate with existing blockchain infrastructure. Tokenized assets, settlements, and decentralized finance workflows can leverage its native compatibility. |
29 |
| - |
30 |
| -### Support for Conditional Logic |
31 |
| - |
32 |
| -Developers can encode conditional payments, options, and automated triggers directly into contracts. This enables more sophisticated financial products without relying on external intermediaries. |
33 |
| - |
34 |
| -### Compact and Efficient Design |
35 |
| - |
36 |
| -Contracts are optimized for on-chain execution, keeping size and operational overhead minimal. This allows for faster transaction processing and reduced blockchain load. |
37 |
| - |
38 |
| -### Compatibility with Multi-Party Workflows |
39 |
| - |
40 |
| -Simplicity can handle multi-party agreements, such as escrow-free marketplaces or collaborative finance operations. Parties can interact securely without giving up control to a central authority. |
41 |
| - |
42 |
| -## Example |
43 |
| - |
44 |
| -A basic pay-to-pubkey SimplicityHL program looks like this: |
45 |
| - |
46 |
| -```rust |
| 35 | +``` rust title="pay to pubkey" |
47 | 36 | fn main(pubkey: Pubkey, funds: Funds) -> Funds {
|
48 | 37 | let (witness = _, funds) = commit(
|
49 | 38 | Witness = ValidSignature(pubkey, funds),
|
50 | 39 | funds,
|
51 | 40 | );
|
52 | 41 | funds
|
53 |
| -} |
| 42 | +}// (1)! |
54 | 43 | ```
|
55 | 44 |
|
56 |
| -This compiles to Simplicity combinators that can be formally verified and executed on-chain. |
| 45 | +1. This compiles to Simplicity ready for on-chain execution. More involved scripts can execute [reverse Dutch auctions](https://delvingbitcoin.org/t/writing-simplicity-programs-with-simplicityhl/1900). |
| 46 | + |
0 commit comments