精华内容
参与话题
问答
  • blockchain

    2018-04-05 14:57:43
    python开发简单的区块链集群 区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。所谓共识机制是区块链系统中实现不同节点之间建立信任、获取权益的数学算法。
  • BlockChain

    2019-11-20 22:00:06
    import hashlib as hasher import datetime as date class Block: def __init__(self,index,timestamp,data,previous_hash,proof): self.index=index ... self.timestamp=timestamp ... self.d...
    import hashlib as hasher
    import datetime as date
    
    class Block:
        def __init__(self,index,timestamp,data,previous_hash,proof):
            self.index=index
            self.timestamp=timestamp
            self.data=data
            self.previous_hash=previous_hash
            self.proof=proof
            self.hash=self.hash_block()
    
        def hash_block(self):
            sha=hasher.sha256()
            sha.update((str(self.index)+
                        str(self.timestamp)+
                       str(self.data)+
                       str(self.previous_hash)).encode("utf-8"))
            return sha.hexdigest()
    
    
    def create_genesis_block():
        return Block(0,date.datetime.now(),"Genesis Block","0",80)
    
    def proof_of_work(last_proof):
        proof=0
        while hasher.sha256(f'{last_proof}{proof}'.encode()).hexdigest()[:4] != '0000':
            proof += 1
        return proof
    
    def next_block(last_block):
        this_index=last_block.index+1
        this_timestamp=date.datetime.now()
        this_data="I choose"+str(this_index)
        this_hash=last_block.hash
        this_proof=proof_of_work(last_block.proof)
        return Block(this_index,this_timestamp,this_data,this_hash,this_proof)
    
    blockchain=[create_genesis_block()]
    previous_block = blockchain[0]
    num_of_blocks_to_add = 20
    for i in range(0,num_of_blocks_to_add):
        block_to_add=next_block(previous_block)
        blockchain.append(block_to_add)
        previous_block=block_to_add
        print('Block #{} has been added to the blockchain'.format(block_to_add.index))
        print("Hash:{}".format(block_to_add.hash))
        print("P:{}".format(block_to_add.proof))
        print("Date:{}\n\n\n".format(block_to_add.data))
    
    
    展开全文
  • Blockchain

    2017-12-22 16:13:32
    notes

    Cure Thoughts
    - purely peer-to-peer
    - longest chain
    - without relying on trust

    Technical Issues

    1. Merkle Tree
    Q:如何验证(x1,x2,...,xn)序列中任一个部分的完整性?
    A:
    1. 每个x做一个数字签名–存储开销很大
    2. Hash等等

    但:如果我本身不想存储信息,怎么办?
    ——Merkle Tree!!!

    root便可以包含n个x序列的信息。
    | 空间开销:不需本地存储信息
    | 时间开销:如果Merkle Tree有n个节点,那么验证所需的时间开销为logn。

    2. Timestamp Server

    Security

    1. 零知识证明
    protect:payer,payee,transaction amount

    例子:
    coloring problem:一个图,用三个颜色进行着色,求解很难,验证很容易。
    方法:着色完成后,随机打开两个相邻的节点验证是否相同,但这样进行多次之后会泄露着色方案,解决思路是每次验证完都对图进行一次置换。

    Σ-protocols:
    见草稿纸上的笔记

    2. 同态加密
    思路:互不信任的双方如何合作来进行计算?
    包括:
    同态加法
    同态乘法
    全同态加密

    3. 盲签名

    应用:
    Monero,Zcash……


    Future
    用IoT基础设施产生的信息写到Blockchain中,通过智能合约。
    Blockchain做一个服务器?加公开账本?

    展开全文
  • Blockchain wallet

    2020-12-02 09:23:33
    <div><h1>🐛 Bug Report 🐛 <p>Hello, <p>I can`t use Blockchain Wallet Exchange, I'm not able to enter the amount of BTC or ETH....blockchain/blockchain-wallet-v4-frontend</p></div>
  • Stop blockchain

    2020-12-01 21:07:20
    <p>The intention of this changes is creating a way to stop the blockchain. It'd be used on tests to: 1. Reduce the moving parts: running the blockchain on some tests produces, sometimes, side ...
  • Blockchain regenesis

    2020-12-02 07:55:52
    The Dogecoin blockchain has expanded significantly faster than the chains of most other coins due to its exceptionally low fees, and this makes it increasingly expensive to run full nodes, as well as...
  • Beginning Blockchain

    2018-07-25 21:34:20
    Beginning Blockchain is a book for those willing to learn about the technical fundamentals of Blockchain, practical implications, and hands- on development aspects of Blockchain applications. ...
  • Getting Zcash Blockchain

    2020-11-26 05:06:42
    blocksci.Blockchain("/zcash") </code></pre> <h4>System Information <p>Using AMI: ? BlockSci version: v0.5 Blockchain: Zcash Parser: Total memory: XX GB </p><p>该提问来源于开源项目&#...
  • <p>When testing it against real-world smart contract test suites, I profiled it and discovered that <code>ethereumjs-blockchain</code> was taking ~30% of the time, making my provider waaaay slower ...
  • <div><p>With raiden 0.0.4, geth 1.5.5 stable I get the following error with test_blockchainservice.py: <pre><code> (local) ~/raiden (git)-[master] % tox -e py27 -- raiden/tests/integration/test_...
  • Blockchain call extension

    2020-11-28 20:20:39
    <div><p><a href="https://github.com/oasislabs/rfcs/pull/1">Most blockchain functions map well to WASI</a> except for <code>call</code>/<code>transact, which is an RPC augmented with the ability to ...
  • blockchain for enterprise

    2018-10-05 12:05:40
    Blockchain for Enterprise: An end-to-end guide to creating fast, scalable and robust enterprise decentralized applications Implement blockchain principles in your choice of domain using Ethereum Key...
  • Fix blockchain tests

    2020-11-20 22:41:21
    <div><p>This fixes the last set of failing blockchain tests: <ul><li>RPC_API_Test</li><li>randomStatetest224BC</li><li>randomStatetest234BC</li><li>randomStatetest529BC</li><li>ExtraData32</li><li>log...
  • lot easier if we had a way to export a everything from a running blockchain to a json file of: - transactions, - proposer, and - block signers <p>at each height. In addition we would of course ...

空空如也

1 2 3 4 5 ... 20
收藏数 7,294
精华内容 2,917
关键字:

blockchain