This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
herberger tax with cat + tapscript | |
operations: | |
- set price | |
- pay tax | |
- auction or seize if taxes not paid | |
- anyone-can-buy at current price | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |