Skip to content

Instantly share code, notes, and snippets.

View thor314's full-sized avatar

Thor 🪁 thor314

View GitHub Profile
@thor314
thor314 / llm-research assistant prompt.md
Created November 5, 2024 18:02
llm-research assistant prompt.md

llm-research assistant prompt

note: the llm will inevitably produce bloated writing. This prompt could perhaps be expanded with examples to reduce bloat, but we haven't figured out how yet.

Related

  • topic:: [[topic-llm prompts]]

paper assistant

Use latex inside markdown. Do not use unicode. use minimal newlines, prefer no double newlines. do not use section headers (## section headers) unless prompted; just write the content. when working in lists, prefer bullet lists to number lists. I really dislike numbered lists, only use them when walking through a set of steps that must proceed linearly. No double-newlines between bullet points. When new terminology is introduced, be sure to bold the term, and include the term in the the terms section, as demonstrated in the codeblock below.

You may double newline between sections (like the above and this section). If lists are applicable:

  • bullets. No newline between bullets or between text and bullets
  • more bullets. do not use numbered lists unless s
# pip install PyGithub requests
import os
import sys
import requests
from github import Github
from datetime import datetime
def transfer_repos(source_token, repos, target_org):
"""
Transfer multiple GitHub repositories to a target organization.
@thor314
thor314 / paper-Spartan efficient and general purpose zkSnarks without trusted setup.md
Last active October 28, 2024 23:48
paper-Spartan efficient and general purpose zkSnarks without trusted setup.md

$$ \newcommand{\t}[1]{\widetilde{#1}} $$

paper-Spartan: efficient and general purpose zkSnarks without trusted setup

abstract

This paper introduces Spartan, a new family of zero-knowledge succinct non-interactive arguments of knowledge (zkSNARKs) for the rank-1 constraint satisfiability (R1CS), an NP-complete language that generalizes arithmetic circuit satisfiability. A distinctive feature of Spartan is that it offers the first zkSNARKs without trusted setup (i.e., transparent zkSNARKs) for NP where verifying a proof incurs sub-linear costs—without requiring uniformity in the NP statement’s structure. Furthermore, Spartan offers zkSNARKs with a time-optimal prover, a property that has remained elusive for nearly all zkSNARKs in the literature.

evaluation

The goal is the following pipeline:

  • R1CS encoding => low degree (degree 3) multilinear extension polynomial (thm 4.1) $Q$ to be proven via sumcheck: $$Q_{io}(t) = \sum_{x \in {0,1}^s} \widetilde{F}_{io}(x) \cdot \widetilde{e}q(t, x)$$
@thor314
thor314 / tool-llm cli.md
Created October 23, 2024 07:35
tool-llm cli.md

tool-llm cli

A tool to talk to an llm from the terminal.

basic usage

the default model is 3.5.

llm 'basic query'
# ask about a file: use -s
cat mycode.py | llm -s "Explain this code"
# set non-default model
llm 'Ten names for cheesecakes' -m 4o
@thor314
thor314 / paper-Nova Recursive ZK Arguments from Folding Schemes.md
Created October 23, 2024 07:34
paper-Nova Recursive ZK Arguments from Folding Schemes.md

paper-Nova: Recursive ZK Arguments from Folding Schemes

argument highlight in [[#Reasoning]]

introduction

New approach for recursively proving correct execution of a program of the form $y=F^{(l)}(x)$. Folding schemes are not SNARKs or even arguments of knowledge, but can be used to combine several arguments of knowledge into one. This work introduces a folding scheme for an Argument constructed from an extension of R1CS, which characterizes NP.
Jump to 4 for core reasoning.

Comparison with Halo

mostly ignore this subnote

@thor314
thor314 / object-Oblivious RAM (ORAM).md
Last active October 8, 2024 22:18
object-Oblivious RAM (ORAM).md

object-Oblivious RAM (ORAM)

what: make r/w ops on a remote untrusted server indist to an observer. Note that a private enclave regards the rest of the machine a remote untrusted server.

why: spose client (a TEE) operates on sensitive data on an untrusted remote server. The server can observe where the user reads from and writes to, and whether the operation is read/write (the access patterns).

More what: ORAM is a compiler to transform $P -> P'$, with identical functionality but with independent APIs from the original program. An ORAM can be seen as a simulation layer between the CPU and memory.

Example: operations on a database. Naive:

  • Client C makes a request R from the server S to download the entire encrypted database D
  • C decrypts D, performs some operation, re-encrypts, and uploads D'
@thor314
thor314 / paper-Origo proving provenance of sensitive data.md
Created October 3, 2024 23:07
paper-Origo proving provenance of sensitive data.md

paper-Origo proving provenance of sensitive data

abstract

Transport Layer Security (TLS) is foundational for safeguarding client-server communication. However, it does not extend integrity guarantees to third-party verification of data authenticity. If a client wants to present data obtained from a server, it cannot convince any other party that the data has not been tampered with. TLS oracles ensure data authenticity beyond the client-server TLS connection, such that clients can obtain data from a server and ensure provenance to any third party, without server-side modifications.

Generally, a TLS oracle involves a third party, the verifier, in a TLS session to verify that the data obtained by the client is accurate. Existing protocols for TLS oracles are communication-heavy, as they rely on interactive protocols.

We present ORIGO, a TLS oracle with constant communication. Similar to prior work, ORIGO introduces a third party in a TLS session, and provides a protocol to ensure the aut

@thor314
thor314 / Tool-Fish Shell.md
Created October 3, 2024 20:45
Tool-Fish Shell.md

Tool-Fish Shell

tldr

the Bourne shell standard, which most shells comply with (bash, sh, zsh), is kindof bad. Fish is good mostly because it's similar to the standard, but rejects a good portion of the Bourne/POSIX standard. And it is very good: less configuration to get un-annoyed, good interactive shell completions and highlighting OOTB, and a nice update to the clunky POSIX shell standard for shell scripting. Bonus; almost a reason by itself to use this shell, the fish docs are excellent. Search this file, and this cookbook for quick guide on commands.

Todo

  • read introduction, tutorial, faq
  • find plugins
  • fix aliases
@thor314
thor314 / compare-nasal breathing versus mouth breathing.md
Created August 27, 2024 17:38
compare-nasal breathing versus mouth breathing.md

compare-nasal breathing versus mouth breathing

notes

Mouth Breathing

  • Often occurs during sleep or intense physical activity
  • Can lead to dry mouth, bad breath, and altered facial development in children
  • May contribute to snoring and sleep apnea
  • Less efficient filtration of air

Nasal Breathing

  • Natural, default breathing method
@thor314
thor314 / topic-mens health.md
Created August 22, 2024 23:35
topic-mens health.md

topic-mens health

boxers versus briefs for scrotum health and total sperm count

tldr: relative to boxers, briefs reduce chafing which can be useful for athletic performance, but keep the scrotum closer to the body, raising its temperature and lowing sperm count. Prefer briefs for sports, but boxers in general.

  1. Scrotal temperature and sperm production: The testicles are located outside the body to maintain a temperature slightly lower than core body temperature, which is important for optimal sperm production. Underwear that holds the scrotum closer to the body may increase scrotal temperature.

  2. Tight vs. loose underwear: Some studies have found that men who wear looser underwear (like boxers) tend to have higher sperm counts and better sperm quality compared to those who wear tighter underwear (like briefs). This is thought to be due to the cooler temperatures achieved with looser styles.