Skip to content

Instantly share code, notes, and snippets.

View dexX7's full-sized avatar

dexX7

View GitHub Profile
@markblundeberg
markblundeberg / instaconf.md
Last active February 22, 2018 07:46
Buy your coffee with InstaConf: nearly trustless zero-confirmation guarantees

Buy your coffee with InstaConf: nearly trustless zero-confirmation guarantees

A proposal by Dr. Mark B Lundeberg, 2018 Feb 21 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This is a proposal for reducing the risk of accepting unconfirmed (zero-conf) transactions in Bitcoin-like cryptocurrencies. Accepting such transactions is typically safe, however there is always the risk of [double-spending](

@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic

Actual TPS of Bitcoin

Counting on-chain transactions alone to illustrate pretty much anything is wrong. One should take into account at least TX batching.

A possibly better way is to calculate based on new UTXOs created excluding the change outputs.

Doing rough calculations, we assume the worst case of every TX having a change output, so the results are the most pessimistic version and actual numbers are better.

Month TXs UTXOs created Net UTXOs [1] Naive TPS [2] Actual TPS [3]

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.

@rubensayshi
rubensayshi / gist.md
Last active June 16, 2022 10:22
Bitcoin Script Overview

rundown of different scripts and what is what and what goes where.

  • the prevoutScript is the script of the output being spend
  • the redeemScript is the script that is used to solve the P2SH
  • the signatureScript is the script that is taken into the signatureHash for signing
  • the witnessRedeemScript is the script that is used to solve the P2WSH
  • the scriptSig is what goes into the input.scriptSig when serializing the TX
  • the witnessScript is what goes into the input.witness when serializing the TX

for a P2KH