Skip to content

Instantly share code, notes, and snippets.

View zmanian's full-sized avatar

Zaki Manian zmanian

View GitHub Profile

#Encrypted Communication things to learn about?

##ECC

  • What's the difference between X25519 and ed25519?

  • What are prekeys?

  • What is the difference between a deniable and irrepudiable shared secret?

Survey/ Review papers on Ring Learning with Error
http://www.cims.nyu.edu/~regev/papers/lwesurvey.pdf ( Very good introduction with diagrams)
https://www.imperialviolet.org/2015/12/24/rlwe.html
https://eprint.iacr.org/2015/939 (Insanely comprehensive)
Hybrid Protocols
https://eprint.iacr.org/2014/599 ( First shot at hybrid TLS)
https://eprint.iacr.org/2015/1092.pdf ( A New Hope) (Peter's Paper)
  1. Develop chaincode and unit test
  2. Verify the chaincode works locally under "peer peer --chaincode-dev"
  3. Vendor all dependencies into /vendor
  4. Create a temporary $GOPATH. Copy source to either "$GOPATH/src/build-chaincode" or "$GOPATH/src/[your aboslution go path]"
  5. "go install build-chaincode" or "go install [your chaincode path]". Think about editing hfc.js 1231-1235 if you have issues here or use the REST API
  6. Ready for deployment to hyperledger instance
  • The two options for the paths depende on whether or not you plan to deploy with the SDK or REST api
@zmanian
zmanian / bn.magma
Created September 25, 2016 19:21
/**
* Compute the apparent security level of BN curves,
* according to Kim-Barbaulecu "Extended Tower Number Field Sieve:
* A New Complexity for the Medium Prime Case" -- CRYPTO 2016.
*/
function ApparentSecLevel(n,c)
k:= 12; //embedding degree of BN Curve
ln_m := k*n*Log(2); ln_ln_m := Log(ln_m);
return Log(2, Exp(c*(ln_m*ln_ln_m^2)^(1/3))); // section 4.1
end function;

Building enduring value from the ICO boom

The ICO boom is precipitating a profound sea change in the availability of resources for blockchain Research and Development. For the 1st time, the sector has a entry level resources for developing a radical new set of tools for the global(solar system?) economy.

Our goal in 10 -15 years is pretty clear- Blockchain based systems should be the most useful and powerful liquidity rails for all kinds of assets. We have a lot of works to do fulfill the nascent potential of the blockchain space.

Here is a non-comprehensive list all the things we need to get to the moon.

Cryptographic Engineering

  • Safe, mature libraries for implementing complex protocols. NACL and libsodium aren’t going to cut it. Bitcoin-Core’s libsecp256k1 and Isis & Henry’s curve25519- Dalek are the way forward
  • Zero knowledge proof libraries need to be substantially matured. Libsnark and the forthcoming STARK work need mature, battle tested domain specific languages and compilers for securely

Generating an address for an ed25519 public key

    const TypeDistinguisher = HexToBytes("1624de6220")


    //prepend the TypeDistinguisher as Bytes
    SerializedBytes = TypeDistinguisher ++ PubKey.asBytes()

This expects that your have a cosmos node running on localhost and opened ports 80 and 443 on your firewall and assigned a domain name to your server's public ip address.

  1. Download Traefik

https://github.com/containous/traefik/releases

wget https://github.com/containous/traefik/releases/download/v1.6.0/traefik

  1. Create a traefik config from the example below. Change the domain at #MUSTCHANGE to yours

Starfish: Collecting Genesis bonding transactions

Initializing a proof of stake blockchain is a high risk moment in the chain life cycle.

The purpose of the StarFish tool is to allow Cosmos community members who control an address in the recommended genesis allocation to declare and bond validators.

The finally genesis state of the network should include all valid candidacy with. 2/3 +1 of the top 100 validators sorted by bond need to come online to start the network. We ask that any community member who wants to participate be available to start their equipment within 12 hours of publication of the genesis state.

We also ask that community members who participate optionally broadcast their intentions and the tx id of their genesis bonding via twitter or some other broadcast to provide additional accountability to the ICF.

E[07-29|15:20:36.482] CONSENSUS FAILURE!!! module=consensus err="should not already be unbonded, validator: {974A7590D8BC1B9D323F7A9770D5388D324DA0E7 PubKeyEd25519{C1D509AC04DB20DEC2F698330F3681678580350CD02FEFEBFB7EB25EA0DD7824} false 0 5/1 5/1 {fullnode04 [do-not-modify] [do-not-modify] [do-not-modify]} 27237 0 0/1 0/1 0/1 0/1 0/1}\n" stack="goroutine 131181 [running]:\nruntime/debug.Stack(0xc427b0bb58, 0xd014a0, 0xc424bc1cc0)\n\t/snap/go/2130/src/runtime/debug/stack.go:24 +0xa7\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine.func1(0xc420112600)\n\t/home/zaki/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:558 +0x57\npanic(0xd014a0, 0xc424bc1cc0)\n\t/snap/go/2130/src/runtime/panic.go:502 +0x229\ngithub.com/cosmos/cosmos-sdk/x/stake/keeper.Keeper.unbondValidator(0x105db80, 0xc42003ef10, 0xc4200e2460, 0x105db80, 0xc42003eef0, 0xfe7850, 0xc4200e2460, 0x4, 0x1065880, 0xc42741