Skip to content

Instantly share code, notes, and snippets.

View frenchypeanut's full-sized avatar
🍵

Charles BEYER frenchypeanut

🍵
View GitHub Profile
@DanielVF
DanielVF / compare_live.fish
Created June 27, 2023 14:03
Compare deployed contracts to version in local repo
#!/opt/homebrew/bin/fish
# Usage:
# ./compare_live.fish CONTRACT_ADDRESS
# Config
set SRC_DIR /PATH/TO/REPO/CONTRACTS
set OZ_DIR $SRC_DIR/node_modules
# Download
@CaliosD
CaliosD / crypto.js
Created February 23, 2019 07:56
Some snippets for self testing on local node of IOST blockchain. Hash and signature functions matched with contract. Feel free to use for testing, and feel free to star🌟if it's useful to you. 🚀
const bs58 = require('bs58');
const { SHA3 } = require('sha3')
const nacl = require('tweetnacl');
const EC = require('elliptic').ec;
const secp = new EC('secp256k1');
const BN = require('bn.js');
const IOST = require('iost')
// equals to `IOSTCrypto.sha3(seed)` in contract
const hash = (seed) => {
@meyer9
meyer9 / tpos-sec.md
Last active August 5, 2018 23:25
Security Analysis of TPoS

Note to XSN devs: Not to dwell on TPoS, but I'm on vacation and have nothing better to do than analyze protocols of other coins.

Introduction

I'm arguing against XSN's claim that TPoS increases network security. It either decreases or does not change security.

We'll analyze how much it costs for an attacker to attack the network through a 51% attack by either buying up 51% of coins or bribing 51% of staking power. Note that the second scenario is much more applicable to Proof-of-Stake because market liquidity generally prevents buying 51% of the coins in any economically-efficient attack, so we'll focus on that.

The second scenario is easier because users do not have to give away/sell their coins to participate in the attack. Users simply have to act like the attacker asks. (Download a different client)

TPoS enables stakers to allow others to stake their coins for a (generally) small commission.