bn256 for bitcoin is totally possible without branches
don't believe me?
see below
bn256 for bitcoin is totally possible without branches
don't believe me?
see below
zkCoins is a novel blockchain design with strong privacy and scalability properties. It combines client-side validation with a zero-knowledge proof system. The chain is reduced to a minimum base layer to prevent double spending. Most of the verification complexity is moved off-chain and communicated directly between the individual sender and recipient of a transaction. There are very few global consensus rules, which makes block validation simple. Not even a global UTXO set is required.
In contrast to zk-rollups there is no data availability problem, and no sequencer is required to coordinate a global proof aggregation. The protocol can be implemented as an additional layer contained in Bitcoin's blockchain (similar to RGB[^5] or Taro[^6]) or as a standalone sidechain.
The throughput scales to hundreds of transactions per second without sacrificing decentralization.
The core design principle is to *"use the chain for what the chain is good for, which is an immutable order
// plz give me credits if for some reason you use this | |
// MIT License or shout out @cmpeq in the code <3 | |
OP_1 | |
<1438064771> | |
OP_0 | |
<170099639> | |
OP_1 | |
<1522642839> | |
OP_1 | |
<1467629419> |
/* | |
function ch(x: number, y: number, z: number) { | |
return z ^ (x & (y ^ z)); | |
} | |
*/ | |
b.OP_TUCK(); | |
b.OP_NUMNOTEQUAL();//.tag("y ^ z"); | |
b.OP_ROT(); | |
b.OP_BOOLAND();//.tag("(x & (y ^ z))"); |
# Script to generate a new block every minute | |
# Put this script at the root of your unpacked folder | |
#!/bin/bash | |
echo "Generating a block every minute. Press [CTRL+C] to stop.." | |
address=`./bin/bitcoin-cli getnewaddress` | |
while : | |
do |
This repository contains the code snippets from the tutorial A Hackers Guide to Layer 2: Zero Merkle Trees from Scratch.
Thanks to OAS for sponsoring this tutorial series.
Copyright 2023 Carter Jack Feldman
// root | |
<0x227c4fdcd6c57bf13f6af315dfeebfab6976e46276f11cc6160bbd0fb5ee22ec> | |
// sibling_1 | |
<0x8869ff2c22b28cc10510d9853292803328be4fb0e80495e8bb8d271f5b889636> | |
// sibling_2 | |
<0x848930bd7ba8cac54661072113fb278869e07bb8587f91392933374d017bcbe1> | |
// sibling_3 | |
<0x7cdd2986268250628d0c10e385c58c6191e6fbe05191bcc04f133f2cea72c1c4> | |
// sibling_4 |
// Blake 3 for Bitcoin Core | |
/* | |
Copyright 2024 Carter Feldman | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WIT |
/* | |
Multiplication using U15 Arithmetic | |
X = a*2^15 + b | |
Y = c*2^15 + d | |
Z = X*Y = e*2^45+f*2^30+g*2^15+h | |
Solve for e,f,g,h such that e,f,g,h are each less than 2^15 | |
h = (b*d).lo | |
g = ((a*d).lo+(b*d).hi)+(b*c).lo |
// these aren't _quite_ functional tests, | |
// and should all be compile_fail, | |
// but may be illustrative | |
#[test] | |
fn concurrent_set() { | |
use std::sync::Arc; | |
let x = Arc::new(Cell::new(42)); | |
let x1 = Arc::clone(&x); | |
std::thread::spawn(move || { |