Skip to content

Instantly share code, notes, and snippets.

View cpacia's full-sized avatar

Chris Pacia cpacia

View GitHub Profile
@cpacia
cpacia / auction.md
Last active October 13, 2023 22:34
Auction contract
```lisp
;; This is an example of an auction contract. Users can place new bids by calling
;; the bid method with the appropriate inputs and outputs:
;;
;; Bid tx-format:
;; --------------
;; Input-0: This contract
;; Input-1: Bid input
;;
;; Output-0: This contract
@cpacia
cpacia / vault.md
Last active October 6, 2023 15:44
Vault script
```lisp
;; This is an example of a vault script. The general concept is to have two keys — a
;; hot key and a cold key. The cold key is allowed to spend from the script at any
;; time. If a spend is initiated using the hot key, a timer is started. The hot key
;; is allowed to spend the funds after the timer expires. At any time before the timer
;; expires the cold key can spend the funds.
;; The script allows the following list of custom parameters:
;;(<hot-key (num)> <cold-key (num)> <fee (num)> <recovery-window (num)> <required-precision (num)>)
;;
@cpacia
cpacia / enigma.go
Last active December 17, 2021 03:20
package main
import (
"errors"
"fmt"
"log"
"regexp"
"strings"
)
@cpacia
cpacia / main.go
Created July 18, 2021 22:40
Hello World
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
@cpacia
cpacia / install.md
Last active July 18, 2021 15:55
Installing Go

Go

There are three main parts to the Go installation:

  • The go binary:

    This is the main executable file that you will use to compile programs.

  • The standard library:

@cpacia
cpacia / terminal_basics.md
Last active July 15, 2021 16:12
Terminal Basics

TERMINAL BASICS

In this tutorial we are going to cover some basics of using the terminal. Hopefully you will be using either linux or mac as the terminal syntax will be the same as I cover here. On windows you can do the same things but the syntax is different. You'll need google how to do these things on windows as I don't know them off the top of my head.

Browsing Files

When you open the terminal you will see a comand prompt. Mine looks like this:

chris@chris-Yoga:
@cpacia
cpacia / musig.go
Created March 3, 2020 22:52
Go MuSig Example
package main
import (
"crypto/rand"
"fmt"
"github.com/gcash/bchd/bchec"
"log"
)
func main() {
@cpacia
cpacia / csw addrs
Last active November 29, 2019 10:51
package main
import (
"encoding/binary"
"fmt"
"github.com/gcash/bchd/bchrpc/pb"
"github.com/gcash/bchd/txscript"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
@cpacia
cpacia / rs.md
Last active June 8, 2019 16:17
SLP redeem script
var prevRedeemScript = readFromStack()

var preimage = readFromStack()
validatePreimage(preimage)

var outputTransfers = readFromStack()

var siganture = readFromStack()
@cpacia
cpacia / bchd-neutrino.md
Last active April 3, 2019 18:35
Connecting neutrino wallet to your own bchd full node

You should start bchd with a least the following options: bchd -u yourUsername -P yourPassword --rpclisten=0.0.0.0 --externalip=your_ip_here

Alternatively you can put these options in the config file found at ~/.bchd/bchd.conf so you don't need to enter them at start.

rpcuser=your_username
rpcpass=your_loooooonnng_password
rpclisten=0.0.0.0
externalip=your_ip_here