Skip to content

Instantly share code, notes, and snippets.

View meyer9's full-sized avatar
🏠
Working from home

Julian Meyer meyer9

🏠
Working from home
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdN41lde3vUp+u1P434DIiai0kMgL+KEq7FAbI0PYwlZnnl5Oq7Fio8lK0QYl42Eiqpczcimn6GFiEeOmd21FP5Ens5yYhV0trfe2mjULf0EavPqCK+41nHoVZzJZDHsBWrldRhojQNEVCQJOO5X7nmg7/saZv4/mmiWZ2qchkraHc5bJMeOkmdSy7grk3c3JvCYTAXxBKUcuofTJnmJmgr7+K00wSVSMk7B/4HesyBusDkqA6QSl0omZFlyw07u8cgUmmp4bKoexY/JZ5AayRIzisTNMQm7sZ1Fge3NhwSukzTQcRyc+8hScGdzTBqrNIKBbE0mJuS8m+dXB+Q3CJ julian@cameran-desktop
sha256(transaction_id + output_index + time + block_header) < difficulty * transaction_value
diff --git a/src/crypter.cpp b/src/crypter.cpp
index d3866652b..55eeb6645 100644
--- a/src/crypter.cpp
+++ b/src/crypter.cpp
@@ -259,7 +259,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
uint256 hashSeed;
if (CWalletDB(pwalletMain->strWalletFile).ReadCurrentSeedHash(hashSeed)) {
-
+ LOCK(pwalletMain->cs_wallet);
@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.

@meyer9
meyer9 / deserialize_tx.py
Created June 7, 2018 20:53
Deserialize a Bitcoin transaction
import sys
import struct
WITNESS = 1
class RawTransaction:
def __init__(self, tx_data):
self.tx_data = bytearray.fromhex(tx_data)
def __str__(self):
return self.tx_data.hex()
@meyer9
meyer9 / phore.diff
Created November 28, 2017 17:14
Difference between Phore headers and PIVX headers
diff -ENwbur pivxheaders/accumulatormap.h phoreheaders/accumulatormap.h
--- pivxheaders/accumulatormap.h 2017-11-28 09:12:03.000000000 -0800
+++ phoreheaders/accumulatormap.h 2017-11-28 09:12:27.000000000 -0800
@@ -1,8 +1,8 @@
// Copyright (c) 2017 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#ifndef PIVX_ACCUMULATORMAP_H
-#define PIVX_ACCUMULATORMAP_H
+#ifndef PHORE_ACCUMULATORMAP_H

== Blockchain == getbestblockhash getblock "hash" ( verbose ) getblockchaininfo getblockcount getblockhash index getblockheader "hash" ( verbose ) getchaintips getdifficulty getmempoolinfo

@meyer9
meyer9 / apollo11.ipynb
Created October 3, 2017 02:38
Apollo 11 Simulation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am meyer9 on github.
  • I am meyer9 (https://keybase.io/meyer9) on keybase.
  • I have a public key whose fingerprint is FF83 3AC9 D93E A2D6 E488 8263 B439 D0FB 18CE C86D

To claim this, I am signing this object:

@meyer9
meyer9 / mobileauth.html
Created August 26, 2017 15:55
Mobile Auth Page
<html>
<head>
<script src="https://wzrd.in/standalone/buffer"></script>
<script src="https://wzrd.in/standalone/crypto-browserify"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
function bufferizeSecret(secret) {
if (typeof secret === 'string') {
// Check if it's hex
if (secret.match(/[0-9a-f]{40}/i)) {