Skip to content

Instantly share code, notes, and snippets.

View pelle's full-sized avatar

Pelle Braendgaard pelle

View GitHub Profile
{
"@context": "https://www.w3.org/ns/did/v1",
"id": "did:example:123456789abcdefghi",
"authentication": [{
"id": "did:example:123456789abcdefghi#keys-1",
"type": "Ed25519VerificationKey2018",
"controller": "did:example:123456789abcdefghi",
"publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
}],
"service": [{
@pelle
pelle / mainnet-connect.js
Created July 27, 2018 13:47
Main net Uport Connect
import { Connect } from 'uport-connect'
const uport = new Connect('My App', {
network: 'mainnet'
})
import { Credentials } from 'uport'
import { verifyJWT } from 'did-jwt'
async function mySigner (data) {
// bring up signing UX
// sign data with sha256/secpk256k1
// see https://github.com/uport-project/did-jwt#creating-custom-signers-for-integrating-with-hsm
return
}
@pelle
pelle / eth
Last active October 24, 2017 23:17
0x48987918EFa6A28CA966fdb2b14729e12A2e2cA6
@pelle
pelle / package.json
Created April 10, 2017 21:43
Uport Connect - React Native example
{
"name": "exampleapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node_modules/react-native/packager/packager.sh --nonPersistent",
"test": "jest",
"build-uport-connect": "node_modules/.bin/derequire node_modules/uport-connect/dist/uport-connect.js >src/vendor/uport-connect.js"
},
"dependencies": {
contract EscrowContract {
address buyer;
address seller;
address agent;
// Each party has an entry here with the timestamp of their acceptance
uint[3] acceptances;
bool active;
@pelle
pelle / Escrow.sol
Created January 10, 2016 21:14
Simple Escrow with Agent
contract Escrow {
address buyer;
address seller;
address agent;
function Escrow(address _agent, address _seller) {
// In this simple example, the person sending money is the buyer and sets up the initial contract
buyer = msg.sender;
agent = _agent;
seller = _seller;

Keybase proof

I hereby claim:

  • I am pelle on github.
  • I am pelle (https://keybase.io/pelle) on keybase.
  • I have a public key whose fingerprint is 3810 F094 D2F8 9DDF 6468 2B72 CB8D 0835 0187 B1A9

To claim this, I am signing this object:

@pelle
pelle / accounts.clj
Created May 8, 2012 14:37
Using database functions in Datomic transactions and annotating transaction history
(use '[datomic.api :only [q db] :as d])
(def uri "datomic:mem://accounts")
;; create database
(d/create-database uri)
;; connect to database
(def conn (d/connect uri))
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>ABC/090928/CCT001</MsgId>
<CreDtTm>2009-09-28T14:07:00</CreDtTm>
<NbOfTxs>3</NbOfTxs>
<CtrlSum>11500000</CtrlSum>
<InitgPty>
<Nm>ABC Corporation</Nm>