Skip to content

Instantly share code, notes, and snippets.

Litecoin Cash (LCC) was 51% attacked

Preamble

Litecoin Cash is a Bitcoin Core clone which uses a hybrid Proof-of-Work/Proof-of-Stake consensus algorithm in an attempt to aleviate 51% attacks on its network. LCC's PoW algorithm is SHA256 but its network hashrate is many orders of magnitude smaller than Bitcoin's, making it highly vulnerable to 51% attacks, as was demonstrated last year. The LCC whitepaper describes a system they call "Hive Mining", which is effectively a PoS lottery in which users can purchase "bees" (lottery tickets) that have the potential to be eligible to propose a PoS block for each new PoW block. In the paper, the authors claim this scheme provides "protection" from 51% attacks by interlacing PoW and PoS blocks, and giving PoS blocks more relative weight than PoW blocks in the chain-work calculation for selecting the most-work block.

The Attac

@nadavrot
nadavrot / Matrix.md
Last active October 5, 2025 04:10
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@AndyShiue
AndyShiue / CuTT.md
Last active July 4, 2025 05:39
Cubical type theory for dummies

I think I’ve figured out most parts of the cubical type theory papers; I’m going to take a shot to explain it informally in the format of Q&As. I prefer using syntax or terminologies that fit better rather than the more standard ones.

Q: What is cubical type theory?

A: It’s a type theory giving homotopy type theory its computational meaning.

Q: What is homotopy type theory then?

A: It’s traditional type theory (which refers to Martin-Löf type theory in this Q&A) augmented with higher inductive types and the univalence axiom.

@ObserverOfTime
ObserverOfTime / BDLinux.md
Last active October 7, 2025 14:10
Install BetterDiscord on Linux

Install BetterDiscord on Linux

This Gist contains simple instructions on how to install, update, and uninstall BetterDiscord on Linux.

For more thorough documentation, take a look at betterdiscordctl's README.

Do NOT submit issues here as I don't check the comments. You should submit them here instead.

@josephjunker
josephjunker / boolean-expression-ast.js
Created July 29, 2017 02:53
BooleanExpr recursion scheme example
// @flow
import type { Functor } from "flow-static-land/lib/Functor";
import type { HKT } from "flow-static-land/lib/HKT";
import type { Fix } from "static-land-recursion-schemes/lib/Fix";
import { In } from "static-land-recursion-schemes/lib/Fix";
import { Paren } from "./functorized-expression-ast";
@Dinnerbone
Dinnerbone / minecraft_commands.txt
Last active August 29, 2024 17:22
Minecraft Java Edition 1.13 changes
advancement grant <targets> everything
advancement grant <targets> from <advancement>
advancement grant <targets> only <advancement>
advancement grant <targets> only <advancement> <criterion>
advancement grant <targets> through <advancement>
advancement grant <targets> until <advancement>
advancement revoke <targets> everything
advancement revoke <targets> from <advancement>
advancement revoke <targets> only <advancement>
advancement revoke <targets> only <advancement> <criterion>
@0x277F
0x277F / klass.md
Last active April 18, 2021 12:22
Java klass.hpp memory layout
Index Field Name Size Offset Completely Useless Column Field Type
1 Header 8 +0 +0 Unknown
2 Klass Pointer Size +8 +8 *Klass to java/lang/Class
3 C++ Vtbl Pointer Size +16 +12 Unknown Pointer
4 Layout Helper 4 +24 +16 i32
5 Super Offset 4 +28 +20 u32
6 Name Pointer Size + 32 +24 *Symbol (linked list type?)
7 Secondary Super Cache Pointer Size +40 +28 *Klass
8 Secondary Supers Pointer Size +48 +32 Array&lt;*Klass&gt;
@hthh
hthh / mac-exploit.cc
Last active September 4, 2019 21:28
Dolphin Mac Exploit
#include <stdint.h>
extern "C" {
// entry point
void my_main(void);
}
// types
typedef uint8_t u8;
typedef uint16_t u16;
@captn3m0
captn3m0 / cert-chain-dump.txt
Last active July 15, 2016 15:57
airtel-piratebay-mitm
% openssl s_client -showcerts -servername thepiratebay.org -connect thepiratebay.org:443
CONNECTED(00000003)
depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root
verify return:1
depth=2 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO ECC Certification Authority
verify return:1
depth=1 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO ECC Domain Validation Secure Server CA 2
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL Multi-Domain, CN = sni154519.cloudflaressl.com