Skip to content

Instantly share code, notes, and snippets.

herberger tax with cat + tapscript
operations:
- set price
- pay tax
- auction or seize if taxes not paid
- anyone-can-buy at current price
@rot13maxi
rot13maxi / ctvUtils.ts
Created October 20, 2023 00:13
standard ctv hash in typescript
import { Transaction } from '@scure/btc-signer';
import { Buffer } from 'buffer'; // You may need to import the appropriate library for Buffer
import { sha256 } from '@noble/hashes/sha256';
function ser_compact_size(l: number): Buffer {
let r: Buffer = Buffer.from('');
if (l < 253) {
r = Buffer.from([l]);
} else if (l < 0x10000) {
Result: 12
Circuit Code:
40 24
2 8 8
1 8
2 1 0 8 48 ADD
2 1 48 0 49 ADD
2 1 49 0 40 ADD
2 1 0 8 50 ADD
2 1 50 48 50 ADD
@rot13maxi
rot13maxi / main.rs
Created June 4, 2023 20:31
adaptor fun
use rand_chacha::ChaCha20Rng;
use schnorr_fun::fun::{KeyPair, Scalar};
use schnorr_fun::{Message, nonce, Schnorr};
use schnorr_fun::adaptor::Adaptor;
use schnorr_fun::fun::marker::Public;
use schnorr_fun::musig::MuSig;
use sha2::Sha256;
fn main() {
// Little proof of concept. Doesn't actually do real transactions, but you get the idea.