Skip to content

Instantly share code, notes, and snippets.

View cpacia's full-sized avatar

Chris Pacia cpacia

View GitHub Profile
### Keybase proof
I hereby claim:
* I am cpacia on github.
* I am chrispacia (https://keybase.io/chrispacia) on keybase.
* I have a public key whose fingerprint is 0150 2502 DD3A 928D CE52 8CB9 B895 6DBF EE7C 105C
To claim this, I am signing this object:
Verifying I am +chrispacia on my passcard. https://onename.com/chrispacia
@cpacia
cpacia / openbazaar_enhancements.md
Last active May 26, 2016 23:57
OpenBazaar P2SH script ideas.

OpenBazaar P2SH Script Enhancements

We're currently in the middle of planning for the next major version of OpenBazaar. In the course of doing so we're taking a hard look at the entire app to find ways to improve user experience. What I want to do here is throw around some ideas to improve the checkout flow and solicit feedback.

The current checkout process

Currently, each vendor has an opportunity to add one or more "moderators" (basically escrow/arbitration agents) to his listings. The vendor chooses only moderators he trusts and those moderators are part of the goods/service bundle offered for sale.

During the checkout process, the buyer is first given the option to select either a direct payment (which sends the bitcoins directly to the vendor) or a moderated payment. If he chooses a moderated payment, in the next step he's asked to pick from the list of moderators the vendor selected. If he finds none acceptable, he can always decline to purchase. Assuming the buyer proceeds, the public key

@cpacia
cpacia / swagger_test
Last active September 11, 2016 19:10
swagger: '2.0'
schemes:
- http
- https
host: localhost:8080
basePath: /
info:
description: |
# Introduction
The OpenBazaar networking daemon combines a Kademlia DHT, IPFS node, Bitcoin wallet, and a peer-to-peer contracting system. This JSON API is the primary mechanism for controlling the node. It offers a RESTful api for building user interfaces as well as a number of RPC calls. In documentation you'll find a full list of API calls and example usages.

Each shipping option has a shipping rules section:

message ShippingOption {
        string name                         = 1;
        ShippingType type                   = 2;
        repeated CountryCode regions        = 3;
        ShippingRules shippingRules         = 4;
        repeated Service services           = 5;
}

Step 1: Move any Bitcoin Cash you have in the wallet out of the app

Step 2: Install the mainnet release

Step 3: Open a terminal/command prompt and enter the following command based on your operating system (the entire command is one line if even if Github displays it as two).

Mac: /Applications/OpenBazaar2.app/Contents/Resources/openbazaar-go/openbazaard convert -d /Library/Application Support/OpenBazaar2.0-bitcoincash bitcoincash

Windows (make sure to replace [Username] with your actual username):

@cpacia
cpacia / main.go
Created May 16, 2018 00:06
Bitcoin Cash tree signature
package main
import (
"fmt"
"github.com/btcsuite/btcd/btcec"
"encoding/hex"
"crypto/sha256"
"github.com/btcsuite/btcd/txscript"
"github.com/cpacia/bchutil"
"github.com/btcsuite/btcd/chaincfg"
@cpacia
cpacia / bip37.md
Last active December 21, 2018 03:47
Bip37

Here's an overview of the privacy issues with BIP37.

If you create a bloom filter and pack it with a bunch of addresses, it's not really possible for a third party to know what addresses are in the filter. At best they can say an address is in the filter with a given probability.

But everything changes if you create two (or more) separate filters with different sizes and/or fp rates containing the same addresses. Now the probability that a transaction would match both filters and still be a false positive is the false positive rate of filter A * the false positive rate of filter B (and filter C, D, E, etc). So in otherwords if someone creates more than one filter you can say with near certainty which addresses are in their filter.

@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
@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()