Skip to content

Instantly share code, notes, and snippets.

View gokulsan's full-sized avatar
🐙
Polyglot Programming in Poetic Prismatics

Gokul Alex gokulsan

🐙
Polyglot Programming in Poetic Prismatics
View GitHub Profile
@gokulsan
gokulsan / 1_Storage.sol
Created February 20, 2021 10:40
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.4+commit.3f05b770.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.8.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
@gokulsan
gokulsan / OnewayAccumulators.txt
Last active July 30, 2020 15:35
Oneway Accumulators Decentralised Alternatives To DigitalSignatures
The combination of these two properties (quasi-commutativity and one-wayness) to develop a one-way uccurnulator
It can be used to provide space-efficient cryptographic protocols for time stamping and membership testing.
one-way hash functions exists if and only if one-way functions exist
which, in turn, exist if and only if secure signature schemes exist
It has also been shown that the existelice of one-way functions is equivalent
to the existence of secure pseudo-random number-generators.
A family of one-way accumulators is a family of one-way hash functions each of which is quasi-commutative.
@gokulsan
gokulsan / Ocaml_Expressions.ml
Created July 26, 2020 14:27
Enchanting Expressions in OCaml
# A Boolean True Expression Between Special Characters
{|"\\"|}="\"\\\\\"";;
# A Boolean True Expression Between Strong Literals
{delimiter|the end of this|}quoted string is here|delimiter}
= "the end of this|}quoted string is here";;
@gokulsan
gokulsan / FormalVerification_Ethereum_Part1.txt
Last active July 25, 2020 12:44
Formal Verification of Smart Contracts - Ethereum Engineering
References
https://github.com/pirapira/evmverif
https://yoichihirai.com/edcon-yoichi-hirai.pdf
Proof Checkers
Kepler Conjecture
Testing shows the presence, not the absence of bugs - E.W. Dijkstra
@gokulsan
gokulsan / gist:dee1040e2b001d9143a7ecbaaeb6968a
Created July 24, 2020 07:14
Differential Privacy and Database Queries
The whole paradigm of differential privacy is attaining broader significance in the event of contact tracing and social distancing applications.
The paradigm of differential privacy has evolved significantly in these three years.
Adding noise based on the sensitivity of a question is the heart of differential privacy.
At the moment, there are two approaches to differential privacy.
The noise that protects the data set is either added after the fact by the party that collected the information (known as centralized differential privacy) or the noise is directly built into the act of collecting data (local differential privacy, or random response). In the local version, there’s not even an original “true” database to safe keep — the holder of the information never got it in the first place.
Hence the need to customise the database engine is not always there in the contemporary approaches.
This repository contains a query analysis and rewriting framework to enforce differential privacy for general-purpose
An elliptic curve equation takes one of several standard forms, including (but not limited to) Weierstrass, Montgomery, and Edwards.
The curve E induces an algebraic group whose elements are those points with coordinates (x, y) satisfying the curve equation, and where x and y are elements of F.
This group has order n, meaning that there are n distinct points. Elliptic curves induce subgroups of prime order.
E : y^2 = x^3 + A * x + B,
where A, B are in F_p and satisfies 4 * A^3 + 27 * B^2 != 0 mod p.
Solutions (x,y) for an elliptic curve E, as well as the point at infinity, O_E are called the F_p rational points.
If P and Q are two points on the curve E, we can define R = P + Q as the opposite point of the intersection between the curve E and the line that intersects P and Q. We can define P + O_E = P = O_E + P as well.
Java Security Standard Algorithms
https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#secretkeyfactory-algorithms
OSSEC as SIEM
https://serverfault.com/questions/539342/ossec-as-a-siem/539918?newreg=bd75a320e8b84fd88874151efb0e2669
SMTP Port Scanning Techniques
https://support.en.kodak.com/app/answers/detail/a_id/37550/~/where-to-find-smtp-port-number-information-to-set-up-scan-to-email-profile/selected/true
TCP Port Scanning with NMAP
@gokulsan
gokulsan / Impala_Quick_Reference.txt
Last active May 26, 2019 18:39
Apache Impala as the Open Source SQL Engine
Impala and Big Data Ecosystem
When it comes to SQL-on-Hadoop, there are handful frameworks available in market. Hive and Impala are most widely used to build data warehouse on the Hadoop framework.
Impala Table Partioning
Partitioning Impala table technique physically divides the data based on the different values in frequently queried or used columns in the impala tables. This technique allows queries to skip reading a large percentage of the data in a table, thus reducing the I/O operation and speed-up overall performance.
Impala Schema Design
Difference between Ethereum and Polkadot
----------------------------------------
The difference between the current Ethereum and Polkadot is quite large.
Ethereum is a single chain which allows developers to extend its functionality through the deployment of blobs of code onto the chain (called smart contracts).
Polkadot, as described in the whitepaper, is a fully extensible and scalable blockchain development, deployment and interaction test bed.
It aims to be able to assimilate new blockchains, high-frequency chains, and even consortium chains with ease.
Tezos can instantiate any blockchain based protocol. Its seed protocol specifies a procedure for stakeholders to approve amendments to the proto- col, including amendments to the amendment procedure itself. Upgrades to Tezos are staged through a testing environment to allow stakeholders to recall potentially problematic amendments.
Tezos Transaction Management
A manager operation, such as a transaction, has 3 important parameters: counter, gas and storage limit.
The counter belongs to each account, it increases at each operation signed by that account and enforces some good intuitive properties:
In Tezos there are two kinds of accounts: implicit and originated.
The implicit accounts are the tz1 we have used up to now.
They are created with a transfer operation to the account public key hash. Originated accounts have addresses KT1 and are created with an origination operation.