12 2017 档案

摘要:> 注意,以太坊智能合约里面采用的是公钥非紧凑类型```def gen_secrets_pair(): """ 得到公钥和私钥 :return: """ from coincurve import PrivateKey p = PrivateKey() return p.to_hex(), p.public_key.format(compressed=Fa... 阅读全文
posted @ 2017-12-19 19:38 白云辉 阅读(1583) 评论(0) 推荐(0)
摘要:```pragma solidity ^0.4.16;contract Metadata { // 十六进制字符串转换成bytes function hexStr2bytes(string data)returns (bytes){ uint _ascii_0 = 48; uint _ascii_A = 65; uint _ascii_a = ... 阅读全文
posted @ 2017-12-19 16:35 白云辉 阅读(2987) 评论(1) 推荐(0)
摘要:[比特币白皮书](http://www.8btc.com/wiki/bitcoin-a-peer-to-peer-electronic-cash-system)[以太坊白皮书](https://github.com/ethereum/wiki/wiki/%5B%E4%B8%AD%E6%96%87%5D-%E4%BB%A5%E5%A4%AA%E5%9D%8A%E7%99%BD%E7%9A%AE%E4... 阅读全文
posted @ 2017-12-15 11:47 白云辉 阅读(350) 评论(0) 推荐(0)
摘要:```pythonfrom __future__ import unicode_literalsimport jsonfrom time import sleep, time# 中文编码def encode_str(_str): try: return bytearray(_str, "utf-8").hex() except Exception as e: ... 阅读全文
posted @ 2017-12-12 22:25 白云辉 阅读(788) 评论(0) 推荐(0)