Skip to content

Instantly share code, notes, and snippets.

@dwking2000
dwking2000 / gist:11ffb9c2ed31efd31ba05d6bcb6db997
Created August 5, 2018 00:04
Linked Events for efficient lookup
Contract Events are a useful feature for storing data from smart contracts exclusively for off-chain use.
Unfortunately current ethereum implementations provide a very inefficient lookup mechanism.
By using linked events that always link to the previous block with a change for the identity,
we can solve this problem with much improved performance.
Each identity has its previously changed block stored in the changed mapping.
Lookup previousChange block for identity
Lookup all events for given identity address using web3, but only for the previousChange block
Do something with event
Find previousChange from the event and repeat
// A Sketchy starting point for building EigenTrust++ on EigenTrust.
// This code is unfinished and may not compile
// It is a starting point and example of how EigenTrust
// might be coded in Java.
// This file contains supporting classes
// Agent, DefaultWeightedEdge, ReputationEdge and Token
// The original EigenTrust++ paper can be found here and it discusses
// EigenTrust and the EigenTrust++ improvements:
// https://www.cc.gatech.edu/~lingliu/papers/2012/XinxinFan-EigenTrust++.pdf
# This config should be placed in following path:
# %AppData%\Parity\Ethereum\config.toml
[parity]
# Parity syncs initially, then sleeps and wakes regularly to resync
mode = "passive"
# Auto-updates only to consensus/security updates.
auto_update = "critical"
[footprint]
@dwking2000
dwking2000 / ERC725.sol
Created February 9, 2018 19:07 — forked from 3esmit/ERC725.sol
Ethereum ERC725 ERC735 ERC745
pragma solidity ^0.4.15;
contract ERC725 {
uint256 constant MANAGEMENT_KEY = 1;
uint256 constant ACTION_KEY = 2;
uint256 constant CLAIM_SIGNER_KEY = 3;
uint256 constant ENCRYPTION_KEY = 4;
event KeyAdded(address indexed key, uint256 indexed keyType);
@dwking2000
dwking2000 / gist:05d87608e84e52a225c23d8e25a8132b
Created November 12, 2017 19:42
blockstack id verification
Verifying my Blockstack ID is secured with the address 12T8VocHVvgtk4eLWpLPbEhHgVjZeknSrP https://explorer.blockstack.org/address/12T8VocHVvgtk4eLWpLPbEhHgVjZeknSrP
0x4c121aAA2689C18c299773ef2de5c156B7427c33

Keybase proof

I hereby claim:

  • I am dwking2000 on github.
  • I am dwking (https://keybase.io/dwking) on keybase.
  • I have a public key ASA3TlajYWSWOkvn4_IuHNyqQzyLCCNuuPBfvLnLU5lK2Ao

To claim this, I am signing this object:

@dwking2000
dwking2000 / gist:059b4d974c89560eadbf
Created October 23, 2015 19:30
Verifying that +dwking is my blockchain ID. https://onename.com/dwking
Verifying that +dwking is my blockchain ID. https://onename.com/dwking