Skip to content

Instantly share code, notes, and snippets.


David Wong mimoo

View GitHub Profile
View gist:2878889192e54f9650215414470e98a8
  • process_local_timeout(round: Round)
    • if round_state.round does not match round, return
    • (if the timer is an interval timer, we do not need this step)
    • if round_state.vote_sent is empty, this is the first timeout this round (we haven't already voted for a timeout):
      • create a NIL block by calling nil_block = proposal_generator.generate_nil_block(round)
      • execute and store the block by calling executed_block = block_store.execute_and_insert_block(nil_block)
      • obtain a signed vote by calling
      • store the vote in round_state.vote_sent
    • if has an empty timeout_signature:
      • create a timeout payload with the current epoch and round:
mimoo /
Last active Jun 6, 2020
broadcast protocols

Broadcast Protocols


  • broadcast protocols are about sending a request to enough peers, and the peers successfuly receiving it

  • there are different types of broadcasts protocols, and byzantine broadcast protocols work in the presence of adversaries

  • an atomic broadcast is what people refer to as a consensus protocol

  • byzantine broadcast protocols

    • the sender can be byzantine
mimoo /
Last active May 31, 2020
Short Authenticated Strings


cross-authentication protocols using short authenticated strings:

  • pretty much an unauthenticated key exchange between two devices
  • followed by comparing a short value (6 digits usually) displayed by the devices to authenticate the transcript/output of the key exchange
  • this short value is public, but cannot be tampered with

Attacker Model


1. learn your ingredients

To cook great food, you need to know what are the different spices at your disposition, the different types of herbs, roots, mushrooms, and sauces. All of that.

example: how boring would cooking be if coconut milk didn't exist? or choriander? or fish sauce? etc.

Not only this: you must understand how they taste, how they taste on their own, how they taste when mixed with others, and how they taste raw, once heated, boiled, grilled, etc.

mimoo /
Last active Apr 8, 2020
patents in crypto

Infamous patents in cryptography

  • 1976-1977 - Diffie-Hellman - the patent was filled more than a year after the idea was circulated/published, thus was invalid. The invalid patent expired in 1997.
  • 1991 - Schnorr signatures - Schnorr is obviously the best signature scheme we have, yet the NIST went ahead and standardized the sub-primitives DSA and ECDSA to circumvent Schnorr's patents (Schnorr was not happy 1, 2). In 2008 the patents expired and EdDSA and other schnorr-based signatures started flourishing again.
  • 1996 - NTRU - The algorithm was placed in the public domain in 2017.

    A note on patents. One reason that NTRU is not more widely deployed is that there have been patents restricting its usage fo


User <-> Machine Authentication


  • PKI
  • PAKE
  • SAS


mimoo / evcxr_jupyter_tour.ipynb
Created Jan 5, 2020
View evcxr_jupyter_tour.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View LBFT.html
<!DOCTYPE html>
<meta charset='utf-8'>
<title>LibraBFT Specification</title>
<script src='' class='remove'></script>
<script class='remove'>
async function loadRust() {
//this is the function you call in 'preProcess', to load the highlighter
mimoo / hljs-proto.js
Last active Dec 5, 2019
HLJS browser shims for different languages (to be used with gitraw)
View hljs-proto.js
Language: Protocol Buffers
Author: Dan Tao <>
Description: Protocol buffer message definition format
Category: protocols
var module = module ? module : {}; // shim for browser use
mimoo /
Last active Jan 2, 2020
End-to-end encryption

End-to-End encryption


  • 1981 - RFC 788 - Simple Mail Transfer Protocol (SMTP) is published, the standard for email is born.
  • 1991 - The US government introduces the 1991 Senate Bill 266, which attempts to allow "the Government to obtain the plain text contents of voice, data, and other communications when appropriately authorized by law" from "providers of electronic communications services and manufacturers of electronic communications service equipment". The bill fails to pass into law.
  • 1991 - Pretty Good Privacy (PGP) - released by Phil Zimmermann.
  • 1993 - The US Government launches a criminal investigation against Phil Zimmermann for sharing a cryptographic tool to the world (at the time crypto exporting laws are a thing).
  • 1995 - Zimmermann publishes PGP's source code in a book via MIT Press, dodging the criminal investigation by using the first ammendment's protection of books.
  • 1995 - The RSA Data Security company proposes S/MIME as an
You can’t perform that action at this time.