Skip to content

Instantly share code, notes, and snippets.

View marwan50's full-sized avatar

Marwan aloudi marwan50

View GitHub Profile
@Samyoul
Samyoul / ethereum_private_key_to_address.rb
Created March 18, 2018 21:17
Ethereum convert private key to address (public key)
# Ruby version
# gem install digest-sha3
require 'openssl'
require 'digest/sha3'
curve = OpenSSL::PKey::EC.new('secp256k1')
curve.generate_key
prv = curve.private_key.to_s(16)
pub = curve.public_key.to_bn.to_s(16)