Skip to content

Instantly share code, notes, and snippets.

View portlandhodl's full-sized avatar
🍊
💊

Portland.HODL portlandhodl

🍊
💊
View GitHub Profile
@portlandhodl
portlandhodl / README.md
Last active July 24, 2026 17:21
BIP 54 x 110 | Security. Who does it better?

BIP 110 vs. BIP 54

Poison Blocks, Sigop DoS Attacks, and Consensus Hardening


1. The Common Thread

Both BIP 110 and BIP 54 address the possibility of constructing valid Bitcoin blocks that are intentionally expensive to validate.

@portlandhodl
portlandhodl / README.md
Created March 28, 2026 13:16
Can Bob Burnett Activate BIP-110 by Himself ....

Can Bobs 1/2016th of Bitcoin's Hashrate 55% the Network though luck into a BIP110 activation?

tl;dr No. The probability is approximately 10⁻²⁸⁵³ — effectively zero.


Setup

  • Network hashrate: H
  • Miner's hashrate: h = H / 2016
@portlandhodl
portlandhodl / BLOCKS.md
Last active March 5, 2026 13:03
PortlandHODL Blocks

Blocked Accounts

Name Handle Comments
BoozyTheClown @TheBoozles
ANTON @Anton__BTC
PlanB @100trillionUSD Scammer
MMCrypto @MMCrypto Scammer
Daniel Donavan @caoimhinllc
Greg Tonoski @GregTonoski Intellectually Dishonest
@portlandhodl
portlandhodl / README.md
Last active January 29, 2026 22:59
X Bitdevs - Notes and Topics

Bitcoin Dev Topics

  • Mempool Editor
    • Repo
    • Notes
      • Written in rust
      • Splits the TUI from the core logic
  • Deserialize logic! (Go over this!)
@portlandhodl
portlandhodl / README.md
Last active November 20, 2025 20:32
Thoughts about Bitcoin Core. Things that might be useful?

Features

  • Startup flags printout
  • Log manipulation - Viewer

Test

test_mempool_accept.py fails for the wrong reason on line 308 when ScriptSig size is extended because the push style in the test is pushing more than 520 bytes.

@portlandhodl
portlandhodl / bitcoin.sh
Created July 31, 2025 18:20
Bitcoin Core Setup Bash Script
#!/bin/bash
# Bitcoin daemon setup script
# This script sets up bitcoind with proper user, directories, and systemd service
set -e # Exit on error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
@portlandhodl
portlandhodl / knots-slayer.sh
Created May 31, 2025 18:58
Unix cron script to automatically disconnect Bitcoin Knots peers.
#!/bin/bash
# Get peer info and disconnect any peer with "knots" in the subver field
bitcoin-cli getpeerinfo | jq -r '.[] | select(.subver | ascii_downcase | contains("knots")) | .id' | while read peer_id; do
if [ ! -z "$peer_id" ]; then
echo "Disconnecting peer ID $peer_id with knots client"
bitcoin-cli disconnectnode "" "$peer_id"
fi
done
@portlandhodl
portlandhodl / smt.md
Last active March 8, 2025 12:22
Sparse Merkle Trees

Notes about Sparse Merkle Trees

  • The primary issue with a SMT is the calculation between each leaf and their intersection with other leaves.
  • A tree with a single sparse element is very easy as you just can add that element in an calculate the path up the tree.
  • When you have multiple keys then you need to make sure when you calculate the path up the tree you need to consider the impact other leaves have on your path to get to the root.
@portlandhodl
portlandhodl / sha256_test.cpp
Last active February 8, 2025 21:11
Double Sha256 Benchamrk w/ Hardware Support
#include <iostream>
#include <chrono>
#include <openssl/sha.h>
#include <cpuid.h>
bool check_sha_support() {
unsigned int eax, ebx, ecx, edx;
if (__get_cpuid(7, &eax, &ebx, &ecx, &edx)) {
return (ebx & (1 << 29)) != 0; // Check bit 29 for SHA extensions
}
@portlandhodl
portlandhodl / main.rs
Created December 17, 2024 23:48
Get Block Template Rust Example 1
use actix_web::{get, web, App, HttpResponse, HttpServer, Responder};
use bitcoincore_rpc::{Auth, Client, RpcApi};
use serde_json::Value;
struct AppState {
btc_client: Client,
}
#[get("/blocktemplate")]
async fn get_block_template(data: web::Data<AppState>) -> impl Responder {