Skip to content

Instantly share code, notes, and snippets.

View mikedotexe's full-sized avatar
🤙
hakuna matata

Mike Purvis mikedotexe

🤙
hakuna matata
View GitHub Profile
@mikedotexe
mikedotexe / mirrortime-dfd.md
Created August 26, 2025 21:41
MirrorTime³ draft, taking in Density Field Dynamics paper

MirrorTime³ × Cubic Time Field Theory × DFD

A comparative note and proposal for joint exploration
Date: 2025-08-26


Executive Summary

  • MirrorTime³ (algorithmic): A quantum‑algorithmic lens that “mirrors” stepwise dynamics into phase space. Using Quantum Phase Estimation (QPE), we recover hidden cycle structure from the interference pattern of a unitary (e.g., multiply‑by‑a mod N). The measurable object is the phase (\theta = k/L), from which the cycle length (L) is inferred via continued fractions and LCM aggregation.
@mikedotexe
mikedotexe / crypto-verify-stuff.js
Created August 12, 2025 04:17
noble and crypto stuff.js
// crypto-verify.js
// Usage:
// import { verifyEd25519, verifySecp256k1 } from './crypto-verify.js'
// const ok1 = await verifyEd25519(msgBytes, sig64, pub32);
// const ok2 = await verifySecp256k1(msgBytes, sig64, pub33or65);
import * as secp from '@noble/secp256k1';
import * as ed from '@noble/ed25519';
export async function verifyEd25519(message, signature, publicKey) {
@mikedotexe
mikedotexe / CLAUDE.md
Created July 2, 2025 23:55
Helpful CLAUDE.md section whilst developing software with build cycles where the build errors beget information-rich context

CLAUDE.md — AI-Optimized Documentation for Claude Code

This file provides comprehensive guidance to Claude Code (claude.ai/code) when working with this repository. It emphasizes technical continuity, autonomous development workflows, and architectural understanding.

Critical Context for AI Sessions

Autonomous Development Workflow

Available Scripts

  • yarn dev (port 3001) - Development server for human developers
@mikedotexe
mikedotexe / cheesy-429-dodge.js
Created June 4, 2025 03:42
Cheesy hack to add timeout avoiding 429s
// this was a hacky replacement because this tool is busted:
// https://github.com/near/account-lookup
import "regenerator-runtime";
import * as nearAPI from "near-api-js";
import BN from "bn.js";
import sha256 from "js-sha256";
import { decode } from "bs58";
import Mustache from "mustache";
@mikedotexe
mikedotexe / index.html
Created May 10, 2025 19:30
npx serve .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NEAR Validator Balances</title>
<style>
:root {
--bg-gradient: linear-gradient(135deg, #131f37 0%, #1c2942 100%);
--text: #ffffff;
@mikedotexe
mikedotexe / prime-zeroes9.py
Created April 6, 2025 21:19
prime sieve formatted by symmetric zero-padding
#!/usr/bin/env python3
import math
import time
from itertools import product
import multiprocessing as mp
from collections import defaultdict, Counter
import random
def is_probable_prime(n, rounds=20):
"""
@mikedotexe
mikedotexe / dev tools console.nothing
Created October 24, 2024 05:33
messing around with SubtleCrypto
const newEd25519Key = await window.crypto.subtle.generateKey('Ed25519', true, ['sign', 'verify']);
const encoder = new TextEncoder();
const messageUtf8Bytes = encoder.encode("aloha honua");
const signature = await window.crypto.subtle.sign("Ed25519", newEd25519Key.privateKey, messageUtf8Bytes);
console.log('signature', signature);
const pkcs8PrivateKey = await window.crypto.subtle.exportKey('pkcs8', newEd25519Key.privateKey);
const pkcs8PrivKeyArr = new Uint8Array(pkcs8PrivateKey)
console.log('pkcs8PrivKeyArr', pkcs8PrivKeyArr);
@mikedotexe
mikedotexe / yarn.config.cjs
Created October 17, 2024 08:05
Yarn 4.5.0 constraint (`yarn set version berry` has to be run)
module.exports = {
async constraints({ Yarn }) {
// get the root-level package.json's version
// then update all the packages' versions
/* The line below returns something like
{
cwd: '.',
ident: '@meer-js/monorepo',
@mikedotexe
mikedotexe / get-mpc-signature-from-tx-hash.js
Created May 14, 2024 22:00
Get MPC signature pieces from a transaction hash, like one returned from MyNEARWallet as a URL param
// run with "node get-mpc-signature-from-tx-hash.js" or whatever name
const { connect, keyStores } = require('near-api-js')
const mockKeyStore = new keyStores.InMemoryKeyStore()
const nearConfig = {
keyStore: mockKeyStore,
networkId: 'testnet',
nodeUrl: 'https://archival-rpc.testnet.near.org',
}
@mikedotexe
mikedotexe / chain-siggy.js
Created March 13, 2024 01:06
Chain signatures (shell of BOS frontend)
const ProgressBar = VM.require("mike.near/widget/ProgressBar");
console.log('props', props);
const yoctoZeroes = "000000000000000000000000";
const [stakingAmount, setStakingAmount] = useState("6");
const [unstakingWithdrawlAmount, setUnstakingWithdrawlAmount] = useState("19");
const StakeUnstakeWithdraw = ({ validator, method, amount }) => {
const openAnotherModal = ({validator, method, amount}) => {
// Let's explicitly have these in a switch so no one tries any funny business with methods
switch (method) {