Skip to content

Instantly share code, notes, and snippets.

View bitjson's full-sized avatar

Jason Dreyzehner bitjson

View GitHub Profile
@bitjson
bitjson / prueba
Created September 26, 2023 21:53 — forked from anonymous/prueba
We couldn’t find that file to show.
@bitjson
bitjson / 0_treeless-zce.md
Last active November 29, 2022 20:10
Treeless ZCE
@bitjson
bitjson / 0_readme.md
Last active September 28, 2023 16:38
Experimenting with Contract State Merkle Trees
@bitjson
bitjson / tapbch.md
Created August 18, 2021 21:08 — forked from markblundeberg/tapbch.md
How might Taproot be implemented in BCH, and do we need it?

Taproot is an interesting technology to enable multiparty privacy on a bitcoin. Currently, there is a problem with multiparty contracts in that they are obvious deviation from the most common script type (P2PKH), which hurts privacy. The script that gets used will typically indicate exactly what kind of protocol was at play. Also complex P2SH scripts take extra resources (transaction size and CPU cycles).

The basic idea with Taproot is that instead of P2SH where a script is committed by a hash, you can hide a script (or set of possible scripts) as a commitment within a normal-looking public key. Now there are two ways to spend from this public key:

  1. Create a normal transaction signature using the public key, or,
  2. Reveal the commitment, and provide parameters that satisfy the revealed script.

To do #1, it means you need to know the private key, or, you have a set of signers who are able to produce a signature (that's where Schnor

@bitjson
bitjson / 128-bit_integers.md
Created June 9, 2021 19:02
Tobias Ruck's 128-bit Integers Proposal
layout title date activation version author
specification
2020-NOV-15 128-bit integer specification
2020-01-14
2020-NOV-15
1.0
Tobias Ruck

Summary

@bitjson
bitjson / PMv3-BND-notes.md
Created May 27, 2021 20:15
PMv3 BCH Network Discussion Notes (June 1, 2021)

1. Problem Statement/Use Case

Without going into any history or context, what are the practical implications of solving the problem you’re trying to solve?

Bitcoin Cash already has a very powerful programming language – by solving an issue with how transactions are formatted, we'll be able to build advanced, Decentralized Finance (DeFi) applications which scale better than those on "global state" networks like Ethereum.

What use-cases would be enabled, and why should they be accommodated?

PMv3 would allow BCH developers to build almost any kind of decentralized application currently possible on other "smart contract"-focused cryptocurrency networks, including prediction markets, synthetic assets, and decentralized exchanges.

@bitjson
bitjson / 0_cashtoken_v0_corp.md
Last active February 2, 2024 06:30
PMv3-Based CashTokens (Withdrawn)
@bitjson
bitjson / example.ts
Created February 10, 2020 17:58
CashAddress Encoding, Decoding, and Error Correction in Javascript
import { instantiateSecp256k1, hexToBin, instantiateRipemd160, encodeCashAddress, CashAddressType, instantiateSha256, encodeCashAddressFormat, attemptCashAddressFormatErrorCorrection, decodeCashAddress, decodeCashAddressFormat, stringify } from 'bitcoin-ts';
(async () => {
const secp256k1 = await instantiateSecp256k1();
const sha256 = await instantiateSha256();
const ripemd160 = await instantiateRipemd160();
// Create an address from a private key
const privateKey = hexToBin('f85d4bd8a03ca106c9deb47b791803dac7f0333809e3f1dd04d182e0aba6e553');
const publicKey = secp256k1.derivePublicKeyCompressed(privateKey);
@bitjson
bitjson / 0_cashchannels.md
Last active August 19, 2024 20:50
CashChannels: Recurring Payments for Bitcoin Cash