Skip to content

Instantly share code, notes, and snippets.

View dhruv's full-sized avatar

dhruv

View GitHub Profile

L2 protocols

Trust protocols (not always auditable)

  • Full custody (Coinbase)
  • 2-of-3 arbitration / DLC
  • Threshold multisig (ecash, Liquid)
  • Off-chain peg-out tx (statechains)
  • Collateralized custody

Payment channels

Softchains: Sidechains as a Soft Fork via Proof-of-Work Fraud Proofs

Originally posted on bitcoin-dev.

This post describes a fully decentralized two-way peg sidechain design. Activating new sidechains requires a soft fork, hence the name softchains. The key aspect is that all softchains are validated by everyone via Proof-of-Work Fraud Proofs (PoW FP) -- a slow but very efficient consensus mechanism that only requires the validation of disputed blocks. This does increase the validation burden of mainchain full nodes, but only by a minimal amount (~100MB per chain per year). It's similar to [drivechains][0], but without the major downside of having to rely on miners, since all Bitcoin full node users can efficiently validate each sidechain.

Proof-of-Work Fraud Proofs

Last year I posted the idea of [PoW FP to the Bitcoin mailing list][1] ([follow-up here][2]). The idea is that we can use the existence of a fork in Bitc

@fernandonm
fernandonm / softpeg.md
Last active November 25, 2021 17:35
Soft pegged sidechains

Soft pegged sidechains

Sidechains have been the Holy Grail to scale and try new features on Bitcoin for a long time. But the trade-offs of the different proposals relying on Bitcoin modifications (SPV two-way peg, drivechains, etc) prevented them from being adopted.

Only proposals not requiring of any change to Bitcoin, like federated sidechains (e.g. Liquid Network), have seen some adpotion. Although they imply significant trust requirements.

I have always found in sidechains the most honest way to explore other applications of Bitcoin technology. E.g. Namecoin, a network with greater privacy, a distributed oracle, or a network with different trade-offs for high velocity money (low fees), etc. So I have tried (in multiple ocasions) to figure out a trust minimized solution for the two way peg problem that did not require changes to Bitcoin.

[Statechains](https://medium.com/@RubenSomsen/statechain

@githubcom13
githubcom13 / Protonmail.md
Last active April 14, 2024 20:51 — forked from ibaiul/Protonmail.md
Configure the protonmail bridge linux client on Ubuntu 20.04 and Debian 10 server

Protonmail on Ubuntu 20.04 and Debian 10 server

#protonmail #debian #linux

Before you start

Currently protonmail bridge for linux is distributed as part of an open beta program, but soon it will be made public (https://protonmail.com/bridge/install).

Consider that the bridge linux client requires a paid protonmail account to work.

Get the protonmail bridge linux installer

@RubenSomsen
RubenSomsen / BMM.md
Last active November 14, 2023 02:21
Blind Merged Mining with covenants ( sighash_anyprevout / op_ctv )

Blind Merged Mining with covenants ( sighash_anyprevout / op_ctv )

Update: the content of this gist is also explained in this Spacechains video.

This write-up was also published on bitcoin-dev.

Blind Merged Mining (BMM) is the idea of committing the hash of another blockchain into a unique location on the Bitcoin blockchain, and paying a Bitcoin fee to miners for the privilege of deciding this hash and capturing the fees inside the other blockchain. Since miners don’t have to know what the hash represents and are simply incentivized to choose the highest bidder, it requires no extra validation on their part (“blind”). This idea was originally conceived of by Paul Sztorc, but required a specific soft fork. [0]

In essence, BMM is a mechanism that allows external blockchains (altcoins, tokens) to outsource their mining to the Bitcoin blockchain. Instead of burning electricity with ASICs, th


  BIP: 324
  Layer: Peer Services
  Title: Version 2 Peer-to-Peer Message Transport Protocol
  Author&#58; Jonas Schnelli <dev@jonasschnelli.ch>
          Dhruv Mehta <dhruvkaran@pm.me>
  Status&#58; Draft
  Type&#58; Standards Track
  Created&#58; 2019&#45;03&#45;08
  License&#58; PD

@leolord
leolord / vim.sh
Last active August 4, 2021 19:45
Compiling vim on Ubuntu 18 with LUA-support
# Remove previous installations
sudo apt-get remove vim vim-runtime vim-tiny vim-common
# Install dependencies
sudo apt-get install libncurses5-dev python-dev liblua5.3-dev lua5.3 python3-dev
# Fix liblua paths
# You have to compile luajit for yourself.
sudo ln -s /usr/include/lua5.3 /usr/include/lua
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/local/lib/liblua.so
@kristovatlas
kristovatlas / README.md
Created April 16, 2018 01:22
How to verify Trezor Bridge on MacOS (and maybe other operating systems)

Background reading

Verification Steps

  1. Visit https://wallet.trezor.io/data/bridge/latest/index.html. For MacOS, you download a .pkg file.
  2. From https://wallet.trezor.io/data/bridge/latest/index.html also download the PGP signature file.
  3. The Satoshi Labs CTO signs the Bridge releases. Download his PGP key from his Keybase signature: https://keybase.io/stick This means at least that someone created an account with his identity and bothered to link a specific PGP key. If you retain this key over time, you can be sure that it wasn't recently swapped out. You can find same PGP under his identity in various places on the web: https://duckduckgo.com/?q=Pavol+Rusn%C3%A1k+pgp+key&ia=web
@tehmachine
tehmachine / vim_lua.md
Last active February 16, 2024 19:35
Compile Vim with Lua

Original issue: Shougo/neocomplete.vim#31

@JohanTan From my experience, this is how it will work (only tested on Ubuntu):

sudo apt-get install liblua5.1-dev
sudo cp -r /usr/include/lua5.1/* /usr/include/lua5.1/include/
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so /usr/local/lib/liblua.so
@ryanxcharles
ryanxcharles / stealth.md
Last active June 14, 2023 13:35
Stealth Addresses, Transactions and Messages

Stealth Addresses, Transactions and Messages

Normal bitcoin addresses cannot be published in public without losing all privacy, since all transactions to that address can be seen by anybody. Stealth addresses let us publish an address in public which can be used by payers to derive a new address that the payee has access to, but no one else knows is associated with the stealth address. The trick is that the payer must use a nonce to derive the address paid to, and this nonce must be delivered to the payee so they know how to recover the funds. This nonce can be delivered in the transaction, so that no separate channel is required to communicate the nonce.

The same technology can also be used to construct new public keys to send encrypted messages to.

We will discuss four methods:

  1. The simplest form of stealth addresses, which has some drawbacks that can improved upon.