Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python2.7
import secp256k1 # install by typing `pip install secp256k1`
key_id = bytes(bytearray.fromhex('0000000000000000000000000000000000000000000000000000000000000001'))
sk = secp256k1.PrivateKey()
sig_raw = sk.ecdsa_sign_recoverable(key_id, raw=True)
sig_der = sk.ecdsa_recoverable_serialize(sig_raw)
pub_der = sk.pubkey.serialize(compressed=False)
print 'SECRET: ' + ''.join('{:02x}'.format(ord(c)) for c in sk.private_key)
var BN = require('bn.js');
var EC = require('elliptic').ec;
var ec = new EC('secp256k1');
// Create key pair from secret
var key = ec.keyFromPrivate('00000000000000000000000000000000000000000000000000000000000000A5');
console.log('PRIVATE: ' + key.getPrivate('hex'));
console.log('PUBLIC: ' + key.getPublic('hex'));
console.log('ADDRESS: ' + '16NzBsb7vAboEfdbdsnno4Dfc5xuMECL85'); // http://gobittest.appspot.com/Address
//! The Secret Store service contract. Version for networks with static KeyServers set.
//!
//! Copyright 2017 Svyatoslav Nikolsky, Parity Technologies Ltd.
//!
//! Licensed under the Apache License, Version 2.0 (the "License");
//! you may not use this file except in compliance with the License.
//! You may obtain a copy of the License at
//!
//! http://www.apache.org/licenses/LICENSE-2.0
//!
# node#1
# self_secret: eafe19fa17c73f8d4217b60d4fb9986020be9f0f1201dce567162ebc123474d2
# self_public: 439fdeb472c9df7afb366dc596d96b7e341a61890915cc71724ce7b564146224f7d8bd37e04791fdfa31d560fb4a94ae2f513600c5e2d9f87d9bfe5b78bf83b5
[parity]
chain = "poa_chain.json"
base_path = "db.poa_ss1"
[ui]
svyatonik@xwnotebook:~/dev/parity.testss/poa_integration$ =Loading config file from ./poa_ss2.toml
Loading config file from ./poa_ss1.toml
Loading config file from ./poa_ss3.toml
2018-03-12 12:05:40 main INFO parity::run Starting Parity/v1.11.0-unstable-fde55fc-20180312/x86_64-linux-gnu/rustc1.23.0
2018-03-12 12:05:40 main INFO parity::run Keys path db.poa_ss1/keys/POA
2018-03-12 12:05:40 main INFO parity::run DB path db.poa_ss1/chains/POA/db/3a62cd7caa7d242b
2018-03-12 12:05:40 main INFO parity::run Starting Parity/v1.11.0-unstable-fde55fc-20180312/x86_64-linux-gnu/rustc1.23.0
2018-03-12 12:05:40 main INFO parity::run Path to dapps db.poa_ss1/dapps
2018-03-12 12:05:40 main INFO parity::run State DB configuration: fast2018-03-12 12:05:40 main INFO parity::run Keys path db.poa_ss3/keys/POA
Thread 13 (Thread 0x7f40041fd700 (LWP 31298)):
#0 0x00007f400855a98d in pthread_join (threadid=139912965777152, thread_return=0x0) at pthread_join.c:90
#1 0x0000557e77e578d0 in std::sys::imp::thread::{{impl}}::join () at /checkout/src/libstd/sys/unix/thread.rs:176
#2 0x0000557e7631a585 in std::thread::{{impl}}::join<()> (self=0x7f40041fbcf8) at /checkout/src/libstd/thread/mod.rs:1200
#3 0x0000557e7631aa68 in std::thread::{{impl}}::join<()> (self=...) at /checkout/src/libstd/thread/mod.rs:1322
#4 0x0000557e76427253 in ethcore_io::service::{{impl}}::stop<()> (self=0x7f40079ead10) at /home/svyatonik/dev/parity/util/io/src/service.rs:448
#5 0x0000557e76448a85 in ethcore_io::service::{{impl}}::drop<()> (self=0x7f40079ead10) at /home/svyatonik/dev/parity/util/io/src/service.rs:477
#6 0x0000557e76761645 in core::ptr::drop_in_place<ethcore_io::service::IoService<()>> () at /checkout/src/libcore/ptr.rs:59
#7 0x0000557e7675dbf5 in core::ptr::drop_in_place<ethcore::engines::authority_round::AuthorityRound> () at