Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@RandyMcMillan
RandyMcMillan / gcc-ur-languages.rs
Last active March 30, 2026 13:40 — forked from rust-play/playground.rs
gcc-ur-languages.rs
/*
* ⛓️ THE UR-LANGUAGES OF CONSENSUS: UNIFIED SPEC v1.2 ⛓️
* Architecture: BIP-64MOD + GCC
*/
#[allow(dead_code)]
#[derive(Debug, Clone, PartialEq)]
enum Opcode {
OpAdd,
OpEqual,
@RandyMcMillan
RandyMcMillan / ur-languages.rs
Last active March 30, 2026 13:11 — forked from rust-play/playground.rs
ur-languages.rs
/*
* ⛓️ THE UR-LANGUAGES OF CONSENSUS: A COMPARATIVE STUDY ⛓️
* --------------------------------------------------------
* This Rust Playground example serves as a functional reference for the
* "Sovereign Developer Stack" and BIP-64MOD context. It implements
* a mock "Consensus Engine" demonstrating how Bitcoin Script
* synthesized paradigms from Forth, MUMPS, APL, and COBOL.
*
* ARCHITECTURE: BIP-64MOD + GCC (Great Consensus Cleanup)
* DATE: March 2026
@RandyMcMillan
RandyMcMillan / BITCOIN-SPAM-LOGIC.cbl
Last active March 30, 2026 12:07
BITCOIN-SPAM-LOGIC.cbl
IDENTIFICATION DIVISION.
PROGRAM-ID. BITCOIN-SPAM-LOGIC.
AUTHOR. Grok (converted from pseudocode).
DATE-WRITTEN. 2026.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
@RandyMcMillan
RandyMcMillan / hash_self_macro.rs
Last active March 29, 2026 00:26 — forked from rust-play/playground.rs
hash_self_macro.rs
use sha2::{Sha256, Digest};
/// A macro that takes a file path string literal, hashes the embedded bytes
/// using SHA-256, and returns a hex-encoded String.
macro_rules! get_file_hash {
($file_path:expr) => {{
let bytes = include_bytes!($file_path);
let mut hasher = Sha256::new();
hasher.update(bytes);
let result = hasher.finalize();
@RandyMcMillan
RandyMcMillan / hash_self.rs
Created March 29, 2026 00:18 — forked from rust-play/playground.rs
hash_self.rs
use sha2::{Sha256, Digest};
use std::time::Instant;
fn main() {
// include_bytes! embeds the source code at compile time.
let src_bytes = include_bytes!("main.rs");
let start_time = Instant::now();
// Initialize the SHA-256 hasher
@RandyMcMillan
RandyMcMillan / rust-bitcoin-play.rs
Created March 15, 2026 17:48 — forked from chris-belcher/rust-bitcoin-play.rs
rust bitcoin play teleport coinswap
// 22/4/2021
// random various unrelated functions coded to help me figure out how to use rust-bitcoin
// should be useful for figuring out why certain things in teleport are coded the way they are
extern crate bitcoincore_rpc;
use bitcoincore_rpc::{Client, Error, RpcApi, Auth};
extern crate bitcoin_wallet;
use bitcoin_wallet::account::{
MasterAccount, Unlocker, Account, AccountAddressType
@RandyMcMillan
RandyMcMillan / coinswap-design.md
Created March 15, 2026 17:48 — forked from chris-belcher/coinswap-design.md
Design for a CoinSwap Implementation for Massively Improving Bitcoin Privacy and Fungibility

Design for a CoinSwap Implementation for Massively Improving Bitcoin Privacy and Fungibility

25/5/2020

Abstract

Imagine a future where a user Alice has bitcoins and wants to send them with maximal privacy, so she creates a special kind of transaction. For anyone looking at the blockchain her transaction appears completely normal with her coins seemingly going from address A to address B. But in reality her coins end up in address Z which is entirely unconnected to either A or B.

Now imagine another user, Carol, who isn't too bothered by privacy and sends her bitcoin using a regular wallet which exists today. But because Carol's transaction looks exactly the same as Alice's, anybody analyzing the blockchain must now deal with the possibility that Carol's transaction actually sent her coins to a totally unconnected address. So Carol's privacy is improved even though she didn't change her behaviour, and perhaps had never even heard of this software.

@RandyMcMillan
RandyMcMillan / byz_cascading_quorum_v2.rs
Last active March 1, 2026 17:03 — forked from rust-play/playground.rs
byz_cascading_quorum_v2.rs
#![allow(deprecated)]
use chrono::{DateTime, Duration, /*Local, */Timelike, Utc};
use num_bigint::BigUint;
use rand_0_8_5::{thread_rng as rng_legacy, Rng as RngLegacy};
use rand_0_9_2::{thread_rng as rng_latest, Rng as RngLatest};
use sha2::{Digest, Sha256};
// --- GIT-COMPLIANT SHA-1 ENGINE ---
fn git_sha1(data: &[u8]) -> String {
@RandyMcMillan
RandyMcMillan / det_rng_macro.rs
Created March 1, 2026 15:07 — forked from rust-play/playground.rs
det_rng_macro.rs
//! # Cryptographic Playground V2 - Seeded Edition
//! Demonstrates using recursive macros to generate entropy seeds for
//! deterministic RNG initialization while handling complex token trees.
#![allow(deprecated)]
#![allow(unused_attributes)]
#![allow(dead_code)]
use rand_0_8_5::{SeedableRng as SeedableLegacy, Rng as RngLegacy};
use rand_0_9_2::{SeedableRng as SeedableLatest, Rng as RngLatest};
@RandyMcMillan
RandyMcMillan / byz_cascading_quorum.rs
Last active March 1, 2026 03:00 — forked from rust-play/playground.rs
byz_cascading_quorum.rs
use chrono::{DateTime, Duration, Utc, Timelike};
use sha2::{Sha256, Digest};
// --- GIT-COMPLIANT SHA-1 ENGINE ---
fn git_sha1(data: &[u8]) -> String {
let mut h0: u32 = 0x67452301; let mut h1: u32 = 0xEFCDAB89;
let mut h2: u32 = 0x98BADCFE; let mut h3: u32 = 0x10325476;
let mut h4: u32 = 0xC3D2E1F0;
let mut padded = data.to_vec();
let bit_len = (padded.len() as u64) * 8;