<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dorian Liu on Medium]]></title>
        <description><![CDATA[Stories by Dorian Liu on Medium]]></description>
        <link>https://medium.com/@dorianliu?source=rss-c6ccf347aaef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1WXdBdQVjYh7YEhR</url>
            <title>Stories by Dorian Liu on Medium</title>
            <link>https://medium.com/@dorianliu?source=rss-c6ccf347aaef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:17:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dorianliu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[P2P : Swarm Kademlia Network]]></title>
            <link>https://medium.com/n2-research-lab/p2p-swarm-kademlia-network-f1b44ddfb29b?source=rss-c6ccf347aaef------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1b44ddfb29b</guid>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Dorian Liu]]></dc:creator>
            <pubDate>Sun, 18 Jul 2021 14:10:57 GMT</pubDate>
            <atom:updated>2021-07-18T14:23:12.981Z</atom:updated>
            <content:encoded><![CDATA[<h3>P2P : Swarm Kademlia Network</h3><p>以Ethereum Swarm底層技術為例，介紹P2P網路</p><h3>P2P網路的基本元素(DHT&amp;Merkle Tree) :</h3><p>P2P(peer to peer)網路對於一般人來說可能比較難以想像，我們所熟知的中心化網路會有一個中心的伺服器來負責向網路中的節點傳遞封包，但在P2P網路中就沒有一個中心化的伺服器，需要每個節點分擔一點伺服器的角色來互相傳遞訊息。</p><p>大家可能比較熟知的P2P應用比較早的是Bit Torrent，Bit Torrent是基於DHT(Distibuted Hash Table)的其中一種演算法Kademlia，但根據不同的應用需求Kademlia會有不同的實作方式。DHT定義節點跟節點之間如何聯絡彼此，那節點內的資料儲存方式就會用到Merkle Tree來方便找尋和檢索節點內資料的分片。</p><h3>Kademlia Algorithm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*AcVmVpLnRJlOLxGVPkMaBg.png" /></figure><p>以16個節點(每個節點地址為4個bit)的P2P網路為例，讓讀者們先了解Requestor node(起點)如何找到Destination node(終點)。假設Node 0想要去聯絡Node 13，那麼他尋找Node 13的過程會透過xor運算如下：</p><p>Node 0會先根據xor tree的規則去尋問Node 1, Node 2, Node 4, Node 8</p><p>1 xor 13 = 0001 xor 1101 = 1100 = 10<br>2 xor 13 = 0010 xor 1101 = 1111 = 15<br>4 xor 13 = 0100 xor 1101 = 1001 = 9<br>8 xor 13 = 1000 xor 1101 = 0101 = <strong>5 -&gt;</strong> Node 8 離 Node 13最近</p><p>Node 8 會先根據xor tree的規則去尋問Node 9, Node 10, Node 12, Node 0</p><p>9 xor 13 = 1001 xor 1101 = 0100 = 4<br>10 xor 13 = 1010 xor 1101 = 0111 = 7<br>12 xor 13 = 1100 xor 1101 = 0001 = <strong>1 -&gt; </strong>Node 12 離 Node 13距離為1</p><p>經過Kademlia演算法Node 0 -&gt;Node 13的傳遞路徑為 : 0-&gt;8-&gt;12-&gt;13</p><p>那麼為何在Kademlia演算法下Node 0 會先去尋問Node 1, Node 2, Node 4, Node 8呢? 在電腦中最基本的訊號都是二進位制的，所以對一個2進位的地址來說用xor運算兩地址可以快速比對兩地址間有前幾個位數是相同的。把16個節點建成一個xor tree會長成這樣 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*yrSvdeTGh3FcHySR-Uv3qg.png" /><figcaption>Source : The Book of Swarm</figcaption></figure><p>從這個xor tree中我們可以觀察到相鄰(10進位)兩節點之間的距離不一定是最近。0 與1之間的距離是最近的，但7與8之間的距離就是最遠的。因此根據xor tree的特性會建立出Kademlia Table可以快速從10進位的觀點找尋目標節點 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*wmlMUGKlrPzVd_Kosh0IXw.png" /></figure><h3>Ethereum Swarm PO</h3><p>在以太坊中他的Kademlia Table有自己的實作定義稱為Proximity Order(以下簡稱PO)，PO的定義如下 : <br>假設有兩個16 bit的地址<br>Address X = <strong>10</strong>11100110010000, Address Y = <strong>10</strong>00000100101100<br>X xor Y = 0011100010111100(bin) = 14524(dec)<br>log2(2**16)-log2(14524) = 16 - 13.826 = 2.174<br>兩地址的PO會等於log運算後取整數的結果2，但聰明的讀者會發現這個2代表著兩地址前兩個bit是相同的。PO快速的算法就是快速比較兩地址間從MSB往後數連續幾位相同，所以PO值越大代表著兩節點越相近。</p><p>將上面的xor tree向左翻轉90度會得到Node 0的Proximity Order Table如下 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*5S136zOeoAVN1XdRyEVFww.png" /><figcaption>Source : The Book of Swarm</figcaption></figure><h3>DHT vs DISC</h3><p>了解節點與節點之間如何聯絡之後要更深入探討單一節點內是如何儲存資料的，但在這之前先淺談一下Ethereum Swarm DISC是甚麼。</p><figure><img alt="取自The Book of Swarm              左圖為DHT，右圖為DISC" src="https://cdn-images-1.medium.com/max/1024/1*_0x_wWuw5DN-CM_BqYsdlQ.png" /><figcaption>Source : The Book of Swarm</figcaption></figure><p>左圖是傳統的DHT P2P網路索取資料的方式，節點會先去問一個種子他所要的資料地址是甚麼，種子會給節點地址，節點在根據那個地址去取得他想的資料。然而在DISC中，種子(稱為Chunk)就存資料的地方，不用經過DHT的兩個步驟去索取資料。</p><h3>Chunks</h3><p>在Swarm裡面最小的儲存單位稱為Chunk，每一個Chunk的大小都是4kb，又Chumk主要分為兩種，Content Adress和Single Owner。</p><p>首先介紹Content Address Chunk，下圖是他的資料型態 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*vJbZYPXLy4qhcbirwGPcDg.png" /><figcaption>Source : The Book of Swarm</figcaption></figure><p>它的address是由chunk content經過keccak256雜湊函數運算出來的，span表示在chunk中有意義資料的長度，payload為主要的儲存資料，若payload內資料不足4kb會將剩下的片段用密碼學zero padding的方式填充。</p><p>接著介紹Content Address Binary Merkle Tree，merkle tree的是為了快速的驗證大型資料結構內的資料內容，在Content Address裡面的merkle tree長這樣 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*fSdkU48SZt2yq-yqser8xA.png" /><figcaption>Source : The Book of Swarm</figcaption></figure><p>從BMT root往下算樹高為8，總共有128個leaf node每個大小為32 byte(128 * 32 = 4096)，可以透過inclusion proof快速驗證檔案的正確性。</p><p>再來介紹Single Owner Chunk，Single Owner Chunk是屬於Swarm網路中某人所持有的節點，下圖是他的資料型態 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*BNSRFwWttmIsx0hGb68uOw.png" /><figcaption>Source : The Book of Swarm</figcaption></figure><p>相比於Content Address Chunks它多了Identifier和Signature，透過非對稱式密碼學中的Elliptic Curve Digital Signature Algorithm 可生成一對公私鑰。Identifier是一個32btye的key用於中數位簽章(Signature)中來辨認資料的擁有者。<br>數位簽章可參考 : <a href="https://medium.com/n2-research-lab/%E5%8D%80%E5%A1%8A%E9%8F%88%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%8A%80%E8%A1%93%E8%88%87%E5%AF%A6%E4%BD%9C-9fe5ab0d16c5">https://medium.com/n2-research-lab/%E5%8D%80%E5%A1%8A%E9%8F%88%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%8A%80%E8%A1%93%E8%88%87%E5%AF%A6%E4%BD%9C-9fe5ab0d16c5</a></p><p>EC 演算法可參考 : <a href="https://8gwifi.org/ecsignverify.jsp">https://8gwifi.org/ecsignverify.jsp</a></p><p>References :</p><p>The Book of Swarm<br><a href="https://zh.wikipedia.org/wiki/Kademlia">https://zh.wikipedia.org/wiki/Kademlia</a><br><a href="https://stackoverflow.com/questions/47450007/where-does-ipfs-store-all-the-data">https://stackoverflow.com/questions/47450007/where-does-ipfs-store-all-the-data</a><br><a href="https://mainframe-swarm-guide.readthedocs.io/en/latest/architecture.html">https://mainframe-swarm-guide.readthedocs.io/en/latest/architecture.html#kademlia-topology</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1b44ddfb29b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/n2-research-lab/p2p-swarm-kademlia-network-f1b44ddfb29b">P2P : Swarm Kademlia Network</a> was originally published in <a href="https://medium.com/n2-research-lab">N2 Research Lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swarm 主網節點部屬教學(參考)]]></title>
            <link>https://medium.com/n2-research-lab/swarm-%E4%B8%BB%E7%B6%B2%E7%AF%80%E9%BB%9E%E9%83%A8%E5%B1%AC%E6%95%99%E5%AD%B8-%E5%8F%83%E8%80%83-811890fc4758?source=rss-c6ccf347aaef------2</link>
            <guid isPermaLink="false">https://medium.com/p/811890fc4758</guid>
            <dc:creator><![CDATA[Dorian Liu]]></dc:creator>
            <pubDate>Sun, 04 Jul 2021 14:08:27 GMT</pubDate>
            <atom:updated>2021-07-07T07:39:55.190Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ethereum Swarm 主網節點部屬教學(參考)</h3><h3>節點環境設置(參考) :</h3><p>作業系統 : Linux(Ubuutu 20.04)<br>虛擬機 : VirtualBox(可用可不用)<br>CPU : 4core<br>Memory : 8g<br>Hard Disk : 100g(至少50g)</p><h3>事前準備工作 :</h3><ol><li>xdai節點同步 :</li></ol><p>Tutorial : <a href="https://forum.1hive.org/t/run-your-own-local-xdai-node-updated-for-berlin-hardfork/2875">https://forum.1hive.org/t/run-your-own-local-xdai-node-updated-for-berlin-hardfork/2875</a><br>注意 : Terminal不要關，要成為節點，要隨時在網上</p><p>(1)下載openethereum : <a href="https://github.com/openethereum/openethereum/releases/download/v3.2.5/openethereum-linux-v3.2.5.zip">https://github.com/openethereum/openethereum/releases/download/v3.2.5/openethereum-linux-v3.2.5.zip</a><br>(2)解壓縮步驟(1)下載的檔案並命名為xdai-node<br>(3)進入xdai-node資料夾</p><pre>$ cd xdai-node</pre><p>(4)開權限給openethereum(不開權限在步驟(5)可能出錯)</p><pre>$ chmod -R 777 openethereum</pre><p>(5)開始同步節點(可能需要至少一天的時間，別懷疑!)</p><pre>$ ./openethereum --chain xdai --jsonrpc-port=8545 --jsonrpc-cors=all --jsonrpc-interface=all --jsonrpc-hosts=all --jsonrpc-apis=web3,eth,net,parity --ws-interface=all --ws-apis=web3,eth,net,parity,pubsub --ws-origins=all --ws-hosts=all --ws-max-connections=10 --max-peers=100</pre><p>同步中會顯示 :</p><pre>$ Syncing #14889406 0x6a10…e8d8 42.97 blk/s 204.1 tx/s 34.6 Mgas/s 76+ 2566 Qed #14892053 4/25 peers 5 MiB chain 132 MiB db 41 MiB queue 8 MiB sync RPC: 0 conn, 3 req/s, 327 µs`</pre><p>同步完成會顯示 :</p><pre>$ Imported #14892107 0x7963…1c14 (7 txs, 2.59 Mgas, 48 ms, 3.73 KiB) 4/25 peers 6 MiB chain 131 MiB db 0 bytes queue 7 MiB sync RPC: 0 conn, 2 req/s, 278 µs```</pre><p>(6)將節點連結至metamask錢包(成為節點需要質押xdai)</p><p>點選Metamask插件-&gt;頭像-&gt;設定-&gt;網路-&gt;新增網路 : 你會看到</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/0*9zHnDAb489QIThN6.png" /></figure><p>網路名稱 : Local xDai<br>新的RPC URL : <a href="http://localhost:8545/">http://localhost:8545</a><br>鏈ID : 100<br>Symbol : xDai<br>區塊鏈瀏覽器URL : <a href="https://blockscout.com/poa/xdai/">https://blockscout.com/poa/xdai/</a></p><p>設置完成後按儲存</p><p>2. 準備一點xDai需要質押(1 xDai應該就夠了)</p><p>使用幣安和Omni-Bridge轉xdai : <a href="https://www.youtube.com/watch?v=mGqKPqCF6Zc">https://www.youtube.com/watch?v=mGqKPqCF6Zc</a></p><h3>主網部屬 (Linux Docker-Compose)</h3><p>Tutorial : <a href="https://www.youtube.com/watch?v=wna-rrKdgk4">https://www.youtube.com/watch?v=wna-rrKdgk4</a></p><ol><li>創建和進入節點資料夾(以node1為例) :</li></ol><pre>$ mkdir bee-1 &amp;&amp; cd bee-1</pre><p>2. 下載docker-compose配置文件bee-1資料夾 :</p><pre>$ wget <a href="https://kronus-bzz.s3.us-west-2.amazonaws.com/all-in-one/docker-compose.yml">https://kronus-bzz.s3.us-west-2.amazonaws.com/all-in-one/docker-compose.yml</a></pre><p>3.修改配置文件(需要會linux vim editor基本技能)</p><pre>$ vim node1.yaml##看行數<br>:set number### 更改邏輯 :<br>node 1 → node n(第n個節點)<br>clef 1 → clef n(第n個節點)需要更改的地方 :<br>1. clef-n : line 4, 10, 21, 64, 66<br>2. bee-n : line 8, 61, 67<br>3. password : line 40<br>4. infura-endpoint : line 48<br>5. port number : line 57, 58, 59(改前半段(API_ADDR, P2P_ADDR,   DEBUG_API_ADDR)，後半段不用動)<br>   ex : <br>   API_ADDR: 1633→1733<br>   P2P_ADDR : 1634→1734<br>   DEBUG_API_ADDR : 1635→1735</pre><p>4. 啟動節點 :</p><pre>$ sudo docker-compose up -d</pre><p>5. 查看節點狀態 :</p><pre>$ sudo docker-compose logs -f bee-1找到錢包地址訊息 : time=&quot;2021-06-22T04:02:51Z&quot; level=info msg=&quot;using ethereum address 32283b212ab0b2d21a7459affe7270c585cc1f96&quot;錢包地址即為 : 0x32283b212ab0b2d21a7459affe7270c585cc1f96</pre><p>6. 往錢包裡面質押 : 0.05個xDai就可以啟動節點了</p><p>Notice : 這不是懶人包教學，需要自己查一下相關Reference裡面的資料搭配著去做</p><p>References :</p><p>xDai node setup : <a href="https://forum.1hive.org/t/run-your-own-local-xdai-node-updated-for-berlin-hardfork/2875">https://forum.1hive.org/t/run-your-own-local-xdai-node-updated-for-berlin-hardfork/2875</a><br>主網節點部署 : <a href="https://www.youtube.com/watch?v=wna-rrKdgk4">https://www.youtube.com/watch?v=wna-rrKdgk4</a><br>錢包連結和其他相關教學 : <a href="https://www.youtube.com/watch?v=yE6r9aLe0To&amp;t=13s">https://www.youtube.com/watch?v=yE6r9aLe0To&amp;t=13s</a><br>幣安轉xDai : <a href="https://www.youtube.com/watch?v=mGqKPqCF6Zc&amp;t=341s">https://www.youtube.com/watch?v=mGqKPqCF6Zc&amp;t=341s</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=811890fc4758" width="1" height="1" alt=""><hr><p><a href="https://medium.com/n2-research-lab/swarm-%E4%B8%BB%E7%B6%B2%E7%AF%80%E9%BB%9E%E9%83%A8%E5%B1%AC%E6%95%99%E5%AD%B8-%E5%8F%83%E8%80%83-811890fc4758">Swarm 主網節點部屬教學(參考)</a> was originally published in <a href="https://medium.com/n2-research-lab">N2 Research Lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[區塊鏈的基本技術與實作]]></title>
            <link>https://medium.com/n2-research-lab/%E5%8D%80%E5%A1%8A%E9%8F%88%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%8A%80%E8%A1%93%E8%88%87%E5%AF%A6%E4%BD%9C-9fe5ab0d16c5?source=rss-c6ccf347aaef------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fe5ab0d16c5</guid>
            <dc:creator><![CDATA[Dorian Liu]]></dc:creator>
            <pubDate>Wed, 05 May 2021 09:05:36 GMT</pubDate>
            <atom:updated>2021-05-05T09:11:18.733Z</atom:updated>
            <content:encoded><![CDATA[<h3>區塊鏈的先備知識</h3><h4>密碼學</h4><p><strong>對稱式加密</strong> : 一把密鑰進行加密與解密。常用的演算法有AES, DES, 3DES…</p><p>舉例 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fg9EQmdkvGJDR_eP.png" /></figure><p><strong>非對稱式加密</strong> : 非對稱式的一組鑰匙，公鑰是可以對外公開的，而私鑰是不能公開的。常用的演算法有ECC、RSA、DSA…。</p><p>非對稱式加密的情形有兩種 :</p><p>公鑰加密、私鑰解密 : <br>Bob(Receiver)首先將公鑰遞交給Alice(Sender)，Alice用Bob的公鑰加密資料再寄給Bob，Bob收到加密過的資料後再用自己的私鑰解密。這種加密方式的意義是Bob有信心這份資料是只有自己可以看到的，但他不能確定資料一定是由Alice寄來的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*luaj5QJyzVxU0a-TiegQIw.png" /></figure><p>私鑰加密、公鑰解密 : <br>Alice(Sender)用自己的私鑰將資料加密，再連同祕文和公鑰一起交給 Bob，Bob用Alice的公鑰即可將資料解密。這種加密方式的意義是Alice可將資料和公鑰交給需要這筆資料的人，而接收者一定能保證這份資料是Alice所擁有的，因為適用Alice的私鑰加密這份資料。因此，這種情況下的私鑰有一個簽名的意義。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*6MV9yQdfO3sNAjTtxSCh0w.png" /></figure><p><strong>雜湊(Hash) : </strong>資料透過雜湊演算法可形成一個固定長度的雜湊值(Hash Value)這個雜湊值具有唯一性和不可逆性。可將雜湊演算法想成一個大型的絞肉機，當資料輸入後(放入絞肉機)，即使我們知道雜湊演算法(絞肉機長甚麼樣子)是如何實作的但能不可復原(碎肉不可復原)原來所輸入的資料。雜湊值可作為數位指紋的功能並可搭配非對稱式密碼學形成數位簽章。常用的演算法有 : SHA2, SHA3, MD5…</p><p>舉例 : <a href="https://emn178.github.io/online-tools/sha256.html">https://emn178.github.io/online-tools/sha256.html</a></p><p><strong>數位簽章(Digital Signature) : </strong>利用公私鑰和雜湊值產生簽名與驗證簽名的效果。</p><p>假設Alice(Sender)要寄一份機密檔案給Bob(Receiver)，Alice要將資料簽名並安全的寄給Bob，而Bob要能驗證資料確實是Alice寄過來的。</p><p>簽名 : Alice將資料用雜湊演算法(ex. SHA-256)算出雜湊值，再用自己(Alice)的私鑰把雜湊值加密成為數位簽章，Alice再用Bob的公鑰將資料加密形成祕文。資料和雜湊值都加密完成後連自己(Alice)的公鑰一同寄給Bob。</p><p>驗證 : Bob收到加密的資料時，先用自己(Bob)的私鑰將資料解密得到原始資料。要驗證這份資料真的是Alice寄來的首先用Alice的公鑰把加密過的雜湊值復原，再對原始資料用相同的雜湊演算法(ex. SHA-256)運算，若運算出的雜湊值和解密後的雜湊值相符，即可證明資料確實是Alice所擁有並寄給Bob。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*ZKts2fjJV--CscID.png" /></figure><h4>實作 : 模擬區塊鏈P2P網路和挖礦</h4><p><strong>比特幣挖礦Proof Of Work(Python) :</strong></p><p>區塊鏈的工作力證明的機制俗稱挖礦，當節點之間進行交易後並將交易內容廣播至區塊鏈網路後需要礦工對交易內容進行驗證和紀錄。挖礦主要是計算version, previous_block_hash, merkleroot, timestamp, bits, nonce的字串組合經過兩次SHA-256運算後的雜湊值是否可以符合前18位數為0。那為何是計算這幾個值呢?因為這些值可以確保所挖出來區塊的安全性和唯一性。首先version定義了比特幣的版本。previous_block_hash是維持鏈的機制，透過上一個區塊的雜湊值包含在下個區塊的運算內容可確定所有區塊在同一條鏈上。merkleroot是區塊鏈的資料標籤，可協助其他區塊鏈的節點快速找到這個區塊在區塊鏈網路上的位置。timestamp顧名思義就是紀錄時間。bits是比特幣的其中一個單位。nonce值就是一個無意義的亂數也是挖礦的主要計算變數，透過不停地猜測nonce值可得到不同的雜湊值，直到符合SHA-256值前18位數為0則可獲得爆塊獎勵。</p><p><strong>模擬區塊鏈P2P網路(Javascript) :</strong></p><p>區塊鏈物件 : 區塊鏈的網路包含的功能很多，有創立新區塊、創立新交易、驗證交易、運算雜湊值、工作力證明、對帳…以下針對比較基本的物件與其建構函式作介紹。</p><p>區塊鏈的建構子 : 定義區塊鏈物件包含鏈、等待被驗證的交易、節點URL、區塊鏈網路的節點、創立新區塊。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05198e67081e76b7b8fefb643c7307f5/href">https://medium.com/media/05198e67081e76b7b8fefb643c7307f5/href</a></iframe><p>區塊鏈建構子函數 : 建立新區塊</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30bf719dcd3150675ee2ab70cc9d41ea/href">https://medium.com/media/30bf719dcd3150675ee2ab70cc9d41ea/href</a></iframe><p>區塊鏈建構子函數 : 建立新交易</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b213dc6862d062ffe4601bec56f22535/href">https://medium.com/media/b213dc6862d062ffe4601bec56f22535/href</a></iframe><p>建立區塊鏈網路 : Demo<br>使用工具 : Postman(API測試)、Terminal(模擬P2P網路節點)<br>創建節點 : 以下的區塊鏈網路以local端的5個節點作為區塊鏈的P2P網路<br>註冊節點 : 創立完節點後要將節點註冊至區塊鏈網路上並讓所有節點彼此認識，以便於對帳。<br>節點交易 : 節點之間交易主要有三個變數，發送者、交易量與接收者，當交易完成之後，要將交易內容存在區塊鏈上讓所有人驗證交易的內容。<br>創立新區塊 : 當節點註冊完畢後，需要有節點負責記錄交易的內容並可以獲得記帳獎勵(挖礦的誘因)。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fe5ab0d16c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/n2-research-lab/%E5%8D%80%E5%A1%8A%E9%8F%88%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%8A%80%E8%A1%93%E8%88%87%E5%AF%A6%E4%BD%9C-9fe5ab0d16c5">區塊鏈的基本技術與實作</a> was originally published in <a href="https://medium.com/n2-research-lab">N2 Research Lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>