Hiểu về Masternode

Masternode, đã từng là độc nhất cho mạng lưới Dash, nhưng bây giờ trở nên một công nghệ phổ biến và được đưa lên những nền tảng blockchain khác. Phần tài liệu này sẽ mô tả những nguyên tắc và cơ chế của masternode và các dịch vụ mà chúng cung cấp đặc biệt cho mạng lưới Dash.

Simply put, a masternode is a server with a full copy of the Dash blockchain, which guarantees a certain minimum level of performance and functionality to perform certain tasks related to block validation, as well as PrivateSend and InstantSend, as the anonymity and instant transaction features in Dash are called. The masternodes are paid for this service, using a concept known as Proof of Service. This is in addition to the Proof of Work done by miners to secure the blockchain. Masternodes are also allowed to vote on governance and funding proposals, with each masternode receiving one vote (yes/no/abstain) on each proposal submitted to the system.

Bất cứ ai cũng có thể chạy một masternode. Mục đích của việc này là có được sự phi tập trung cần thiết để đảm bảo rằng không một ai có thể kiểm soát phần lớn các masternode. Tuy nhiên, để tránh làm đầy mạng lưới với nhiều masternode không cần thiết hoặc khuyến khích những người thiếu thận trọng, thì có một điều kiện cần phải thực hiện: đó là chứng minh việc sở hữu 1000 DASH. Coin không cần thiết phải ở trong masternode, nhưng nó cần phải được giữ trong một cách nào đó mà làm minh bạch cho toàn bộ mạng lưới. Nếu chủ sở hữu di chuyển hoặc tiêu đi những coin đó, thì masternode sẽ dừng hoạt động và việc thanh toán sẽ dừng lại.

Masternodes are paid by the network for the PrivateSend, InstantSend and governance services they provide. 45% of the block reward is paid out to the masternodes, 45% to miners and 10% to the budget. In practice, half of the reward from a normal block goes to the miner and half to the masternode. Then, every 16,616 blocks (approximately 30.29 days), a superblock is created that contains the entire 10% payout to the budget proposal winners. Masternodes are selected for payment in each block (approximately every 2.6 minutes) from a deterministic masternode list, and moved to the back of the list after payment. As more masternodes are created, the duration between payments increases. If the collateral behind a masternode is spent, or if a masternode stops providing services to the network for more than one hour, it is removed from the list until normal service resumes. In this way, masternodes are given incentive to provide efficient and reliable services to the network.

Việc có nhiều máy chủ lưu giữ toàn bộ bản sao của blockchain và làm việc cho đồng coin làm cho nó trở nên cực kỳ hữu ích. Nhờ có hệ thống phần thường này, làm cho không còn rủi ro do việc thiếu masternode, và do đó các nhà phảt triển có thể dựa vào đó để nhanh chóng triển khai những tính năng phi tập trung mới mà họ muốn thực hiện. Đây thực sự là điểm mạnh của Dash - một hệ thống tạo động lực cho hàng ngàn máy chủ nằm phân tán hoạt động 24x7 có nghĩa là Dash có thể mở rộng một cách hiệu quả hơn và triển khai các dịch vụ nhanh chóng hơn các blockchain mà chạy hoàn toàn bởi những người tình nguyện không được trả công. Càng có nhiều masternode mạng lưới của Dash càng tốt hơn và an toàn hơn.

As of November 2018, the Dash network has over 5000 masternodes located in over 45 countries and hosted on over 140 ISPs. The block reward is approximately 3.34 Dash, so the selected masternode receives 1.67 Dash per payment or approximately 6 Dash per month. The block reward decreases by 7.14% approximately once per year, so the annual earnings for a masternode owner is approximately 7% of the collateral, and will decrease over time as calculated here. See this tool to calculate real-time payment rates, and this site for various real-time statistics on the masternode network.

DIP003 Masternode Changes

Dash 0.13.0 implements DIP003, which introduces several changes to how a Dash masternode is set up and operated. A list of available documentation appears below:

Important concepts and changes:

  • It is possible to upgrade an existing masternode in-place without starting a new server and without moving your 1000 DASH collateral.
  • A masternode was previously "started" using the masternode start-alias command based on a masternode.conf file. Under DIP003, this file is no longer used, and masternodes are "registered" instead of "started". Masternodes begin offering services when a ProRegTx special transaction containing a particular key is written to the blockchain.
  • As before in masternode.conf, the ProRegTx references the transaction id (txid) and index holding the collateral. The IP address and port of the masternode are also defined in this transaction.
  • The ProRegTx contains 2 Dash addresses (also called public keys) and one BLS public key, which represent 3 different roles in the masternode and define update and voting rights. The keys are:
    1. ownerKeyAddr: This is a Dash address (public key) controlled by the masternode owner. It is different from the address used for the collateral. Because the owner uses the private key associated with this address to issue ProUpRegTx transactions, it must be unique for each masternode.
    2. operatorPubKey: This is the BLS public key of the masternode operator. Only the operator is allowed to issue ProUpServTx transactions. Because the operator key is used during live masternode operation to sign masternode-related P2P messages, quorum-related messages and governance trigger votes, the BLS key must be unique for each masternode.
    3. votingKeyAddr: This is a Dash address (public key) used for proposal voting. Votes signed with this key are valid while the masternode is in the registered set.
  • Masternode payments were previously sent to the address holding the collateral. Under DIP003, the owner should specify a different address to receive payments in the ProRegTx. The owner may optionally specify a non-zero percentage as payment to a separate masternode operator, if applicable.
  • The masternode configuration can later be updated using ProUpServTx, ProUpRegTx and ProUpRevTx transactions. See Updating Masternode Information in DIP003 and Updating Masternode Information in this documentation for more details.
  • All functions related to DIP003 will only take effect once Spork 15 is enabled on the network. Until then, it is necessary to set up the masternode following the old process and then work through the upgrade procedure. In this state, the masternode will continue to function in compatibility mode, and all DIP003 related functions, such as payments to a separate address or percentage payments to operators, will not yet have any effect. The ownerKeyAddr and votingKeyAddr must also be identical until Spork 15 is enabled.

The process of setting up or upgrading a masternode is as follows:

  1. Set up your server and operating system
  2. Install the Dash software and synchronize the blockchain
  3. Generate a BLS key pair and enter the private key on the masternode
  4. Prepare a ProRegTx transaction
  5. Sign the ProRegTx transaction
  6. Submit the signed ProRegTx transaction

Step 1 can be omitted if you have an existing server. Steps 2 and 3 require direct access to the masternode. Steps 3 and 4 require access to a Dash Wallet (or DMT). Step 5 requires access to the wallet actually holding the collateral. Step 6 requires a Dash balance to pay the transaction fee.

Masternodes so với đào coin

Dash, cũng giống như Bitcoin và hầu hết các loại tiền kỹ thuật số, là dựa trên một sổ cái phi tập trung chứa tất cả các giao dịch, được biết là một blockchain. Blockchain này được đảm bảo thông qua một cơ chế đồng thuận; trong trường hợp của cả Dash và Bitcoin, cơ chế đồng thuận đó là Proof of Work (PoW). Các thợ mỏ cố gắng giải quyết bài toán khó, họ nhận quyền tạo một khối mới vào blockchain. Nếu tất cả những người khác đang chạy phần mềm đó đồng ý rằng bài toán đã dược giải một cách chính xác, khối sẽ được tạo vào blockchain và thợ mỏ đó nhận được phần thưởng.

Dash hoạt đông khác một chút so với Bitcoin, tuy nhiên, bởi vì nó có mạng lưới hai tầng. Tầng thứ hai được tạo bởi các masternode (các Full node), nó cho phép giao dịch tài chính riêng tư (PrivateSend), giao dịch tức thời (InstantSend), và hệ thống quản trị và cấp vốn phi tập trung. Bởi tầng thứ hai này là rất quan trọng, masternode cũng được trả thưởng khi các thợ mỏ tạo ra những khối mới. Nó chia phần thưởng khối như sau: 45% phần thưởng khối được trả cho thợ mỏ, 45% trả cho masternode và 10% dự trữ lại cho hệ thống ngân sách (được tạo ra bởi các siêu khối cứ mỗi tháng một lần).

Hệ thống masternode được gọi là Proof of Service (PoSe), từ khi masternode cung cấp những dịch vụ quan trọng cho mạng lưới. Thực ra, toàn bộ mạng lưới được giám sát bởi các masternode, nó có khả năng từ chối những khối được tạo không đúng bởi các thợ mỏ. Nếu một thợ mỏ cố gắng chiếm đoạt toàn bộ phần thưởng khối cho mình hoặc cố gắng chạy một phiên bản cũ của phần mềm Dash, thì mạng lưới masternode sẽ làm cho khối đó trở nên mồ côi, và nó sẽ không được đưa vào blockchain.

Nói một cách ngắn gọn, các thợ mỏ tạo nên tầng thứ nhất, nó cơ bản là gửi và nhận tiền và ngăn ngừa việc tiêu lặp. Masternode thì tạo nên tầng thứ hai, nó cung cấp những tính năng bổ sung làm cho Dash trở nên khác biệt với các loại tiền điện tử khác. Masternode không đào coin, và các máy đào không thể phục vụ như các masternode. Hơn nữa, mỗi masternode được "đảm bảo" bởi 1000 DASH. Những DASH đó vẫn luôn thuộc quyền quản lý của người chủ nó, và vẫn có thể được tự do chi tiêu. Khoản tiền này không bị khoá theo bất cứ cách thức nào. Tuy nhiên, nếu khoản tiền này được di chuyển hoặc chi tiêu, masternode gắn cùng với nó sẽ không được kích hoạt và sẽ dừng nhận phần thưởng.

Logic thanh toán

Masternode paymentss in Dash version 0.13.0 are entirely deterministic and based on a simple list sort algorithm. For documentation of version 0.12.0 payment logic, see the legacy masternode payment documentation. Dash version 0.13.0 implements DIP003 and defines two sets of masternodes.

  1. The full set, which contains all registered masternodes that have not spent their collateral funding transactions.
  2. The valid set, a subset of the full set which contains all masternodes which are not marked as Proof of Service (PoSe) banned.

Each masternode in the set of valid masternodes is identified by the block at which it was last paid. If it has never received payment or was banned for failing to meet the PoSe requirements, then the block at which it was first registered or at which PoSe was restored is used instead. The list is sorted in ascending order, and the first entry is paid. If this results in more than one masternode, then the hash of the masternode ProRegTx is sorted to break the tie.

Lựa chọn Quorum

InstantSend transactions in Dash version 0.13.0 are secured using a consensus of deterministically selected masternodes. This set of masternodes is informally termed a quorum and must be in a majority agreement, at least six out of ten, for a successful lock of the transaction inputs. Multiple quorums are self-selected for each input in an InstantSend transaction using the mathematical distance between the hash of each input and of the set of masternode funding transactions.

Mỗi masternode nhận yêu cầu khóa giao dịch InstantSend so sánh giá trị băm của giao dịch cấp vốn của masternode với giá trị băm của đầu vào yêu cầu khóa. Sau khi kiểm tra tính hợp lệ của các đầu vào không được chi tiêu, mười masternodes xa nhất từ mã băm này phát tán việc chấp nhận của chúng về việc khóa.

Tất cả các đầu vào cho InstantSend phải có ít nhất qua 6 block nếu không giao dịch sẽ bị từ chối.

Các yêu cầu cho masternode

  • 1000 Dash: Thường được cho rằng là phần khó nhất. Có thể có được Dash bằng việc mua nó trên các sàn giao dịch như Poloniex, Bittrẽ, Kraken và LiveCoin. Sử dụng dịch vụ của Shapeshift cũng là một cách hay.
  • Một máy chủ hoặc VPS chạy Linux: Hầu hết các hướng dẫn gần đây sử dụng Ubuntu 16.04 LTS. Chúng tôi gợi ý dùng dịch vụ VPS như Vultr và DigitalOcean, mặc dù bất kỳ nhà cung cấp tốt nào cũng đều có thể làm được. Nói chung một cấu hình cỡ thấp và vừa cũng có thể chạy được, tuy nhiên yêu cầu về năng lực sẽ tăng lên theo lộ trình này.
  • Có một địa chỉ IP dành riêng: Thường được đi cùng với một máy chủ/máy chủ ảo.
  • Trong thời gian ngắn ban đầu (và cốt lõi): Các masternode thường yêu cầu việc cài đặt phức tạp, nhưng công cụ như Dashman hiện nay đã đơn giản hoá rất nhiều cho công đoạn này.

Bên cạnh việc phải dành riêng 1000 DASH làm đặt cọc, các masternode cũng phải có phần cứng đạt mức yêu cầu tối thiểu. Trong phiên bản 12.1 thì yêu cầu cho masternode là như sau:

  Tối thiểu Đề xuất
CPU 1x 1 GHz 1x 2 GHz
RAM 2 GB 4 GB
Ổ Đĩa 20 GB 40 GB
Mạng 400 GB/mth 1 TB/mth

Masternode sử dụng băng thông vào khoảng 300-500 GB cho mỗi tháng và sẽ tăng lên khi mạng lưới phát triển.

Dash Evolution

The exact hardware requirements for Dash Evolution masternodes have yet to be determined, although some pointers can be taken from the roadmap and this blog post. It should be possible to run Dash masternodes on normal VPS servers until the block size reaches approximately 20 MB, after which custom hardware such as GPUs and eventually ASICs may be required.