Skip to content

Instantly share code, notes, and snippets.

View jMyles's full-sized avatar

Justin Holmes jMyles

View GitHub Profile
@jMyles
jMyles / sort_by_token_choice.py
Created June 24, 2023 14:01
Sort tokens by choice
bidders = {
'joe': [0, 1, 50],
'sue': [0, 1, 60],
'joan': [0, 1, 10],
'bill': [42, 0, 100],
'john': [42, 1, 50],
'jane': [17, 0, 10]
}
@jMyles
jMyles / rollups_release.py
Created May 2, 2023 00:34
Discord bot to use Threshold CBD
import os
import time
from ferveo_py import Ciphertext
from ferveo_py.ferveo_py import DkgPublicKey
from pathlib import Path
import nucypher
from nucypher.blockchain.eth.agents import CoordinatorAgent
from nucypher.blockchain.eth.registry import LocalContractRegistry
@jMyles
jMyles / rollups_release.py
Created May 2, 2023 00:02
Simple CBD Discord Bot
import os
import time
from ferveo_py import Ciphertext
from ferveo_py.ferveo_py import DkgPublicKey
from pathlib import Path
import nucypher
from nucypher.blockchain.eth.agents import CoordinatorAgent
from nucypher.blockchain.eth.registry import LocalContractRegistry
@jMyles
jMyles / gist:388549b9eff08ccaa9ef4af7553ee79a
Created May 2, 2023 00:02
Simple CBD bot for discord
import os
import time
from ferveo_py import Ciphertext
from ferveo_py.ferveo_py import DkgPublicKey
from pathlib import Path
import nucypher
from nucypher.blockchain.eth.agents import CoordinatorAgent
from nucypher.blockchain.eth.registry import LocalContractRegistry
import os
import time
from ferveo_py import Ciphertext
from ferveo_py.ferveo_py import DkgPublicKey
from pathlib import Path
import nucypher
from nucypher.blockchain.eth.agents import CoordinatorAgent
from nucypher.blockchain.eth.registry import LocalContractRegistry
@jMyles
jMyles / threshold-commons-policy.md
Created March 13, 2023 06:58
A Policy type to facilitate release of material to RobertPublica, rather than to individual qualified Bobs.

This is a very basic flow for CBD-as-release-to-commons (I'd suggest we call it CBDC but that's... no that's not funny today). Maybe we just go back to "Threshold Publishing" as a working name.

It lacks some fairly obvious >v1 features for the sake of simplicity.

Since the impetus for this Policy is the release of my upcoming album, I'll use the phrase "The Album" as the payload, but my intention is for this to be tuned for payloads with similar size and latency characteristics.

The procedure

  1. Alice the artist creates and encrypts The Album with a symmetric key (classic key-and-capsule method).

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jMyles
jMyles / hypergeometric_distribution_loop.py
Created February 15, 2021 14:49
A simple loop to calculate the combine hypergeometric distribution of repeated node selection to show a probability of selecting a malicious node
import math
def calculate_combined_probability_with_hypergeometric_distribution(total_population,
sample_size,
malicious_population,
failure_threshold):
failure_modes = {}
sample_coefficient = math.comb(total_population, sample_size)
for failure_sample in range(failure_threshold, sample_size + 1):
label onto
# Branch Merging-the-revised-tests-with-the-shim-commit-31f001f2e-
reset 28cce2fcc # Reorganize tests into multiple suites.
pick 31f001f2e This will be the basis of a merge commit in the rebase of these tests. One of them reactivates Vladimir; the other fixes the method for testing the presence of Treasure Maps.
label Merging-the-revised-tests-with-the-shim-commit-31f001f2e-
# Branch jMyles-†reasure-ïsland-ss-pi®ate-ß̆çh
reset 523ea089f # Merge pull request #2098 from KPrasch/enrico
pick 811549d1b Get Alice's checksum address for a given Policy.
(nucypher) jmyles@lurkoza:~/projects/nucypher/nucypher/scripts/circle$ sudo ./run_finnegans_wake_demo_docker-circle.sh
[sudo] password for jmyles:
Starting Up Finnegans Wake Demo Test...
working in directory: /home/jmyles/projects/nucypher/nucypher/scripts/circle
Starting nucypher-circle-dev ... done
Starting circleursula1 ... done
Starting circleursula11 ... done
Starting circleursula6 ... done
Starting circleursula8 ... done
Starting circleursula9 ... done