Skip to content

Instantly share code, notes, and snippets.

View siv2r's full-sized avatar

Sivaram siv2r

View GitHub Profile

SignersContext Protocol Design Analysis

This document analyses how SignersContext flows through the BIP-445 FROST signing protocol, whether the implementation matches the stated design intent, what attacks a malicious coordinator can mount by equivocating on signers_ctx, how RFC 9591 compares, and what improved designs exist.


1. What the Design Says

@siv2r
siv2r / sync-bip-frost-signing.sh
Last active February 1, 2026 09:36
Update the BIP FROST Signing pull request (in bitcoin/bips) with latest changes
#!/bin/bash
set -e
REPO_URL="https://github.com/siv2r/bip-frost-signing.git"
BRANCH="master"
TARGET="bip-0445"
git fetch "$REPO_URL" "$BRANCH"
REF="FETCH_HEAD"
@siv2r
siv2r / partialsig-forgery.md
Created January 8, 2026 06:38
Partial signature forgery [BIP FROST Signing]

This is an adaptation of the MuSig2's partial signature forgery for the FROST protocol, described by Adam Gibson. You can find the original write-up here.

In FROST signing, a malicious participant could forge the partial signature (i.e., PartialSigVerify on it will succeed) of another participant without knowing their secret share, but only under the following conditions:

  • The victim does not participate in the signing.
  • The malicious participant impersonates the victim while also participating with their original share, making it appear as if two different participants are involved in the signing.

As a consequence, the malicious signing participant will be unable to create a valid partial signature for their original secret share.

Key Setup: Let's consider a 3-of-5 FROST policy among a group of participants ${P_1, P_2, P_3, P_4, P_5}$ with the following details:

@siv2r
siv2r / strauss_algorithm.md
Created December 26, 2025 09:31
Strauss Algorithm

Strauss Algorithm Analysis

This document provides a detailed analysis of the Strauss multi-scalar multiplication algorithm as implemented in libsecp256k1's src/ecmult_impl.h.

1. Overview

The Strauss algorithm computes multi-point scalar multiplication:

R = n_1*P_1 + n_2*P_2 + ... + n_k*P_k + n_g*G
@siv2r
siv2r / pr1782bench.py
Created December 15, 2025 18:36
Python script for benchmarking PR 1782
#!/usr/bin/env python3
import subprocess
import os
import sys
import time
from openpyxl import Workbook
from openpyxl.styles import Font, Alignment
def run_command(cmd, log_file=None):
#!/usr/bin/env python3
import subprocess
import os
import sys
import time
from openpyxl import Workbook
from openpyxl.styles import Font, Alignment
def run_command(cmd, log_file=None):

This document provides specific instructions for your operation within this codebase. Please adhere to these guidelines strictly.

Planning Before Implementation (Important)

Before writing any code, you must create an implementation plan and get it approved.

  • Create PLAN.md: Write your step-by-step plan to a PLAN.md file in the root directory. If there already exists a PLAN.md, overwrite it.
  • Wait for Approval: Do not start implementing until the plan has been reviewed and approved.- Outline Different Approaches: If there are multiple, fundamentally different implementation strategies, present them in the plan. For each, list the pros and cons. Do not include minor variations.

Plan.md Template

## Context
<what we’re changing and why>
@siv2r
siv2r / 2022-nix-book.md
Created November 25, 2023 17:49 — forked from fricklerhandwerk/2022-nix-book.md
Summer of Nix 2022: The Nix Book

Summer of Nix 2022: The Nix Book

tl;dr

Goals

  • Improve the autodidactic Nix onboarding experience to increase community growth
  • Provide a clear learning path from first impression down to source code

Tasks

@siv2r
siv2r / libsecp_sha256.c
Last active December 11, 2021 11:19
using secp256k1_sha256 internal api
/* this is the main function of test.c of libsecp */
/* you can find my complete code here: https://github.com/siv2r/secp256k1/commit/b3a1437f715dad7478515a55728ecb12aaf4dad1 */
#include "modules/debug/main_impl.h"
int main() {
unsigned char msg[40] = "Hey, this message is going to be hashed";
unsigned char out[32];
secp256k1_sha256 hash;