Skip to content

Instantly share code, notes, and snippets.

{ iv: '3c12aa4bdbb6219479eb0ebe62ee908f',
ephemPublicKey: '04f70ca0c9e6741c8709de1cfec75f980823dd753b9c1a87cc4afbfdf44707b1830c0385b0fa808fa18f55a5f7551370242d95cd61546823fda2f73d26e1906a81',
ciphertext: 'a21abfac3a44ca4c22bdfb23a97a115f',
mac: 'b4d282d05422672689bd1027c948b2189dc52e7f9101e753be6fb3df844572c4' }
0xf86c018504a817c800831e84809414ef8277775c680ac000443e9bde9dbb74a7ee7487038d7ea4c680008029a0188eb601561567927a58ad1eff7238069ef20d8505fb54fa7e49eafd1fc6159aa06e6fe90c36db334d6016aaa35ee17d72f4e530c9c43f3ba1f70277984827ff02
// npm install web3
var Web3 = require('web3');
var web3 = new Web3('wss://ropsten.infura.io/ws');
console.log(web3.version)
// 0x9490d2d67f5455d6b1772a928cb1f3f05f2db32a
var privateKey = '0x1A6EDBD9EC44934671718982671A2E2B7A2573430BFEACEA65EB54E7F765442E';
var weiValue = web3.utils.toWei('0.001', 'ether');
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="./web3.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<script>
$(async function(){
@hm0429
hm0429 / ethereum_address_generator.rb
Last active February 27, 2018 14:51
generate Ethereum address by Ruby
require 'openssl'
require 'base16'
require 'digest/sha3'
def eth_address(public_key)
s = public_key[2, 128]
s.downcase!
s = Base16.decode16(s)
h = Digest::SHA3.hexdigest(s, 256)
a = '0x' + h[-40..-1]
@hm0429
hm0429 / EasyToken.sol
Last active January 14, 2018 05:05
かんたんな暗号通貨(トークン)のサンプル
// ERC20 準拠のオリジナル暗号通貨(トークン)を作成します。
// ERC20 Standard - https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// コンパイラのバージョンを指定します。
pragma solidity ^0.4.19;
// Github から OpenZeppelin の StandardToken.sol をインポートします。
// OpenZeppelin は、Ethereum スマートコントラクトの開発を簡単にしてくれる素敵なライブラリです。
import "https://github.com/OpenZeppelin/zeppelin-solidity/contracts/token/StandardToken.sol";
npm install -g truffle
brew install node
brew tap ethereum/ethereum
brew install ethereum
source ~/.bash_profile