• Stars
    star
    243
  • Rank 166,489 (Top 4 %)
  • Language
    C
  • Created almost 6 years ago

Reviews

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

Repository Details

Simplicity is a blockchain programming language designed as an alternative to Bitcoin script.

Simplicity

Simplicity is a blockchain programming language designed as an alternative to Bitcoin script.

The language and implementation is still under development.

Contents

This project contains

  • A Haskell implementation of Simplicity's language semantics, type inference engine, serialization functions, and some example Simplicity code.
  • A Coq implementation of Simplicity's formal denotational and operational semantics.

Build

Building with Nix

Software artifacts can be built using Nix.

  • To build the Haskell project, run nix-build -A haskell.
  • To use the Haskell project, try nix-shell -p "(import ./default.nix {}).haskellPackages.ghcWithPackages (pkgs: [pkgs.Simplicity])".
  • To build the Coq project, run nix-build -A coq.
  • For a Simplicity-Haskell development environment, type nix-shell --arg coq false.
  • Typing nix-shell will provide a full C, Coq and Haskell development environment.

Building the C project manually

Install the GNU Compiler Collection and GNU Make. Binary packages are available for Debian (apt install gcc make) and other Linux distributions.

  1. Open a command line.
  2. Change directory to the C directory of this repository.
  3. To run tests: make check
  4. To install globally: make install
  5. To install locally: make install out=/path/to/dir
  6. To remove generated files: make clean

Building the Coq project manually

Requires Coq 8.15.0, CompCert 3.11 and VST 2.11. Packages in the Coq ecosystem are managed by the opam package manager.

Installing Coq

  1. Install opam using your distribution's package manager.
  2. opam init
  3. eval $(opam env)
  4. opam pin -j$(nproc) add coq 8.15.0

Optional: Installing CoqIDE

CoqIDE is a user-friendly GUI for writing proofs in Coq.

  1. opam install -j$(nproc) coqide

Installing CompCert

  1. opam repo add coq-released https://coq.inria.fr/opam/released
  2. opam install -j$(nproc) coq-compcert

Installing VST

We need a custom build and cannot use opam for this step.

  1. wget -O - https://github.com/PrincetonUniversity/VST/archive/v2.11.tar.gz | tar -xvzf -
  2. cd VST-2.11
  3. make -j$(nproc) default_target sha
  4. make install
  5. install -d $(coqc -where)/user-contrib/sha
  6. install -m 0644 -t $(coqc -where)/user-contrib/sha sha/*.v sha/*.vo

Building the Simplicity Coq library

  1. Change into the Coq directory of this repository
  2. coq_makefile -f _CoqProject -o CoqMakefile
  3. make -f CoqMakefile -j$(nproc)

Optional: Installing the library

  1. make -f CoqMakefile install

Building the Haskell project manually

Install the Glasgow Haskell Compiler and Cabal. Binary packages are available for Debian (apt install ghc cabal-install) and other Linux distributions.

  1. Open a command line.
  2. Change directory to the root directory of this repository.
  3. cabal repl Simplicity
  4. Cabal will build the project and open a GHCi prompt.

Documentation

Detailed documentation can be found in the Simplicity-TR.tm TeXmacs file. A recent PDF version can be found in the pdf branch.

Further Resources

Contact

Interested parties are welcome to join the Simplicity mailing list. Issues and pull-requests can be made through GitHub's interface.

More Repositories

1

lightning

Core Lightning β€” Lightning Network implementation focusing on spec compliance and performance
C
2,829
star
2

elements

Open Source implementation of advanced blockchain features extending the Bitcoin protocol
C++
1,044
star
3

lightning-charge

A simple drop-in solution for accepting lightning payments
JavaScript
553
star
4

secp256k1-zkp

Experimental fork of libsecp256k1 with support for pedersen commitments and range proofs.
C
288
star
5

libwally-core

Useful primitives for wallets
C
271
star
6

paypercall

Charge for HTTP APIs on a pay-per-call basis with Bitcoin and Lightning ⚑
JavaScript
147
star
7

scriptless-scripts

Documentation about scriptless scripts
TeX
130
star
8

filebazaar

Sell digital files with Bitcoin & Lightning ⚑
JavaScript
120
star
9

woocommerce-gateway-lightning

A WooCommerce gateway for lightning payments
PHP
115
star
10

nanopos

A simple Lightning ⚑ point-of-sale system, powered by Lightning Charge
JavaScript
108
star
11

peerswap

Go
96
star
12

elementsproject.org

Source code for the ElementsProject.org website
CSS
90
star
13

nanotip

⚑ Lightning Tip Box ⚑
JavaScript
85
star
14

lightning-charge-client-js

JavaScript client for lightning-charge
JavaScript
64
star
15

ifpaytt

If Pay Then That ⚑ Trigger IFTTT actions with Bitcoin Lightning payments
JavaScript
56
star
16

wordpress-lightning-publisher

⚑ Lightning Publisher for WordPress
PHP
54
star
17

rust-elements

Rust support for Elements transaction/block deserialization
Rust
51
star
18

reserves

Proof-of-Reserves tool for Bitcoin
Rust
46
star
19

confidential-assets-demo

Confidential Assets Demo built on the Elements blockchain platform
Go
36
star
20

cross-input-aggregation

Thoughts on cross-input (signature) aggregation for Bitcoin
Rust
35
star
21

lightning-jukebox

A Lightning powered Jukebox ⚑ Pay with Bitcoin to choose your music.
JavaScript
35
star
22

rust-simplicity

C
34
star
23

elementsproject.github.io

https://elementsproject.org website
HTML
28
star
24

dicemix

Rust
24
star
25

lightning-charge-client-php

PHP client for lightning-charge
PHP
24
star
26

rust-secp256k1-zkp

C
23
star
27

cln-application

Core lightning application on Umbrel
TypeScript
21
star
28

ELIPs

Elements Improvement proposals
12
star
29

elements-miniscript

Rust
11
star
30

glightning

Go
7
star
31

peerswap-spec

7
star
32

borromean-signatures-writeup

TeX
6
star
33

elements-assets-exchange-demo

OTC-style exchange based on atomic swaps using Elements and confidential assets
JavaScript
5
star
34

qa-assets

Elements-related blobs used for quality assurance.
3
star
35

elementsbp-api-reference

[DEPRECATED: Moved to https://github.com/ElementsProject/elements/blob/elements-0.14.1/doc/elements-api.md] API Reference Documentation for the Elements Blockchain Platform
3
star
36

lightning-demos

2
star