Coder Social home page Coder Social logo

sapio's Introduction

Sapio โ€ƒ Build Status

a framework for creating composable multi-transaction Bitcoin Smart Contracts.

Say hi to Jared

The root crate is a workspace for various Sapio Components such as:

  1. Sapio CLI: Easy to use interface for using and running sapio contracts.
  2. Sapio Language: Base Specification for Sapio Language and Contract Generation
  3. Plugin Example: Example Project for a Sapio Plugin
  4. Sapio Contrib: Contract modules / functionality made available for general use
  5. Plugin Framework: Library for bundling Sapio Plugins
  6. CTV Emulator: Emulation protocols and servers for CheckTemplateVerify.
  7. Sapio Front: Protocols for interacting with a compilation session
  8. Sapio Compiler Server: Binary for a websocket server running sapio-front

QuickStart:

Sapio should work on all platforms, but is recommend for use with Linux (Ubuntu preferred). Follow this quickstart guide to get going.

  1. Get rust if you don't have it already.
  2. Add the wasm target by running rustup target add wasm32-unknown-unknown in your terminal.
  3. Get the wasm-pack tool.
  4. Clone this repo: git clone [email protected]:sapio-lang/sapio.git && cd sapio
  5. Build the plugin cd plugin-example && wasm-pack build && cd ..
  6. Instantiate a contract from the plugin: cargo run --bin sapio-cli -- contract create 9.99 "{\"participants\": [{\"amount\": 9.99, \"address\": \"bcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw\"}], \"radix\": 2, \"fee_sats_per_tx\": "0"}" --file="plugin-example/pkg/sapio_wasm_plugin_example_bg.wasm" to see some magic!

You can use cargo run --bin sapio-cli -- help to learn more about what a the CLI can do! and cargo run --bin sapio-cli -- <subcommand> help to learn about subcommands like contract.

As a second experiment, try modifying the contract in plugin-example to one of the contracts from sapio-contrib! Remember to recompile plugin-example with wasm-pack build!

Still hungry for more? Implement your own smart contract idea -- you can use sapio-contrib for inspiration or as building blocks for something new!

Stuck? Run cargo doc --open --no-deps to build and open the documentation locally, or just shoot me a note and I'll guide you through it! Any and all feedback welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.