diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/2022/08/29/dev-meeting.html b/2022/08/29/dev-meeting.html new file mode 100644 index 000000000..7fa71b5f3 --- /dev/null +++ b/2022/08/29/dev-meeting.html @@ -0,0 +1,367 @@ + + + + +
+ + + + + + + +The meeting took place on 04 September 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +During the meeting, Joseph suggested using Nanomsg instead of ZeroMQ because building ZeroMQ is not easy, +especially in Windows. Additionally, we can use the pure Go implementation of Nanomsg.
+ +The format of block events was defined as follows:
+ +<event_id: 1 byte><event_data: variant><height: 4 bytes><seq_num: 4 bytes>
+
As a consequence of this, smart contracts events can be defined more easily and +Infura-like services become simple, as we can just replay the events.
+ +Nagaraj’s pull request reviewed.
+ +The team discussed renaming (rebranding) the project and decided to create an online survey to +gather suggestions for a new name. +Everyone is encouraged to participate in the survey and suggest new names for the project.
+ +The meeting took place on 29 August 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +During the last meeting, the team conducted an online survey to rename the project. +A total of 31 responses were received, and the following names were suggested:
+ +Name | +Votes | +
---|---|
Sirius | +11 | +
Pactus | +10 | +
Nova | +7 | +
Texo | +6 | +
Zemus | +6 | +
Helios | +6 | +
Tutti | +5 | +
Haki | +5 | +
Aegeus | +4 | +
Virgo | +4 | +
Zentora | +3 | +
Zinova | +3 | +
Xerxes | +2 | +
Ledgeria | +2 | +
Solidus | +2 | +
Welt | +2 | +
Ventura | +2 | +
Zebra | +2 | +
Miranet | +2 | +
Monetha | +2 | +
FutureHub | +1 | +
Muonet | +1 | +
Mentha | +1 | +
Hypatios | +0 | +
Chaintopia | +0 | +
Sycee | +0 | +
Lepus | +0 | +
After reviewing the responses, the team chose “Pactus” as the new name for the project. 🎉 +The project will be moved to “pactus-project/pactus,” and the team plans to announce it on social media.
+ +In terms of the GUI, Joseph suggested using Flutter, and the team agreed. +To interact with the wallet, gRPC APIs will be provided, and the GUI will use these APIs.
+ +The meeting took place on 18 September 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The team discussed Testnet and related issues, including IP block issues that were found by Hadi. +Due to sanctions, some IPs are blocked, so the team will run a support node to assist users inside Iran. +The GUI application had some issues on Windows, but they were fixed and tested by Hadi.
+ +The website still has some issues, such as the need to rename the animation to “Pactus” and the lack of a logo. +The community suggested some logos. Additionally, the roadmap page is missing.
+ +The team discussed the status of social media platforms, including:
+ +The team also decided to announce the project on social media on 29 September.
+ +The team discussed the current consensus parameters:
+ +Pactus Blockchain Release Version 0.9.0 +is now available for download. +This release includes a new graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version has been implemented for Testnet-0 and is preparing for the upcoming Mainnet launch. +To get started with the Pactus Blockchain Testnet-0, simply download +the latest version and run the Pactus software.
+ +Join the Testnet now and get ready for the future!
+ +The Pactus blockchain Testnet-0 is now accessible. +To participate, simply download the Pactus application version 0.9.0 and +connect to the Testnet without any special configurations. +For test coins, please visit our Discord channel and share your validator address.
+ +By taking part in the Testnet, you can familiarize yourself with the Pactus blockchain and +get ready for the Mainnet launch. +Testnet participants will also be given higher priority during the Mainnet launch.
+ +Please share your feedback with us to help improve the user experience in future versions of the software.
+ +The meeting took place on 30 October 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting started in memory of Mahsa Amini. +We in the Pactus family stand in solidarity with courageous people who are fighting for equality, equity and freedom in Iran.
+ + + +The beta version of the block explorer has been launched 🚀 and is now available at +https://pacscan.org.
+ +Nagaraj explained the block explorer and some of the features.
+ +Project road map was discussed.
+ +Ali presented the Pactus pitch deck for the IdeaKita in Malaysia. +The IdeaKita program, under the Malaysia Digital Economy Corporation (MDEC), is designed to +support entrepreneurs and startups in Malaysia.
+ +The latest pull requests were reviewed:
+ +Pactus Blockchain Release Version 0.9.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version has been implemented for Testnet-0 and is preparing for the upcoming Mainnet launch. +To start using the Pactus Blockchain Testnet-0, +you can download the latest version from download page +and join the Testnet.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +If you have ever wondered what Testnet is and how it is different from Mainnet, read this article to the end to find out!
+ +Mainnet and Testnet are two widely used terminologies in the Blockchain ecosystem; +so it is important to understand the meaning and differences while working in the industry or +following announcements of the Blockchain projects like Pactus.
+ +Here’s a quick explanation: +Before the actual live version of a Blockchain network that is used for real transactions, +functions and smart-contracts (which is referred as Mainnet), +there is a test version of the Blockchain network for testing purposes (which is referred as Testnet). +In Testnet, a safe environment is provided to help developers experiment and test their applications, +and make sure that everything functions smoothly in the Mainnet version.
+ +A Testnet is a simulation of a Blockchain, in which developers can test all the functionalities of +their Blockchain network without risking their assets and convenience of end-users. +Using Testnet, any possible error, bug or malfunctions can be fixed before the Mainnet launch. +Testnet also can be an experimental environment for new features, updates and upgrades. +So several Testnet networks of the same version or newer version of the Mainnet can be implemented on the roadmap.
+ +A secure environment to test development ideas and updates. +So many features and minor details in Pactus project have been successfully developed so far using the Testnet; such as:
+ +Providing a safe testing ground for resolve scalability and security problems, as well as decentralization issues. +Pactus network is also a secure and purely decentralized network. However in the last updates during the Testnet, +developers are now able to decrease the database size by approximately 10% without compromising performance. +They did it by utilizing block height instead of hash to store blocks within the database. (you can find out more +here).
+ +Testing new versions, patches and features on Testnet. it is vital for enhancing the security, load testing, +Blockchain migration, integration tests, and etc. This is why you can now use the latest version of Pactus-GUI +that works like clockwork and is extremely secure.
+ +Testing the functions of cryptocurrency without disrupting the Mainnet. In the Testnet of Pactus Blockchain, +you as a user or validator can use all the features to send, receive, bond or unbond your assets in the Pactus-GUI.
+ +Development and simulation of smart contract features and DApps. Note that many Blockchain projects like Pactus, +can be used as smart-contract platforms. So the Testnet can be designed in different stages to test and improve +different applications of the network.
+ +Please note that after a certain period of time, when developers get satisfied with the functionality and debugging process, +they launch Mainnet. Mainnet has its own independent genesis blocks; +so the assets and addresses that users use in Testnet are not valid inside the new Mainnet Blockchain anymore. +In fact the whole Blockchain network starts working from the scratch and users and validators start to +work with real tokens and transactions instead of the simulated ones. But since Testnet has an important effect +on the health and improvement of the network, in Pactus Blockchain, we have several advantages +for the people who join the Testnet.
+ +There are different contributors in a Blockchain network; +Some people are developers and programmers that use the Testnet to contribute, enhance and lead the project to a better future. +Testnet is actually vital for them to perform their changes and try their innovations and ideas.
+ +But you might also be an end user; you might want to either be a validator and stake your assets to earn more Pactus coins, +or you might want to learn how to use the network for future personal applications. Either way, +you might find it handy to give it a try and be familiar with Pactus-GUI and its different features.
+ +However, there is another advantage for end users who join the Testnet. +While using the network, running a node or testing the Pactus-GUI in Testnet period, you are contributing to +the community to find improvement potentials, that’s why there are more advantages contemplated for the Testnet users; +Soon our Mainnet will be launched and also Pactus network will be announced and listed in well-known exchanges. +As an early contributor, you will have the advantage of getting some extra initial tokens at the beginning of Mainnet launch. +So that you can use it to run a validator node and earn more from staking your assets. This airdrop is considered +for every individual who installs Pactus-GUI and starts a node in Testnet.
+ +There are other positive conditions you may experience as an early contributor.
+ +Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In September 2022, we launched our first Testnet. +The purpose of this Testnet was to +check the consensus protocol, +test different transaction types, +and ensure the stability of the blockchain. +We also wanted to test the sortition algorithm +to make sure it works properly.
+ +The committee +for the Testnet-0 was set to five validators, and more than 19 validators joined during the Testnet period. +Over 2 million blocks were created, and more than 3.2 million transactions were processed during this time. +The size of the blockchain is approximately 1 gigabyte. +The maximum number of transactions recorded in a single block was 386. With a block time of 10 seconds, +we can confirm that Pactus blockchain can support up to 30 transactions per second (TPS), +which is a reasonable number for TPS. Based on real-time statistics available at realtps, +we can see that Pactus is among the top 10 blockchains in terms of TPS.
+ +At this point, the development team decided to end the Testnet-0 and move on to the next one, +Testnet-1. We are planning to run the Testnet-1 to prepare for the MainNet launch. +We will provide updates on our progress and share the details of the new Testnet soon.
+ +As promised, participants in Testnets will be given priority as validators for the MainNet, +and will receive bounty tokens from the bootstrap accounts to set up their validator. +We are grateful to all those who participated in Testnet-0, and we encourage them to join our next Testnet to +help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
+ +Pactus Blockchain Version 0.10.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version allows users to set up multiple validators in one node. +Users can set up to 32 validators in a single node, and each validator can stake up to 1,000 coins.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +GetBlockchainInfo
API in gRPC now returns the total number of validators and accounts (#439)You can find the full list of changes on Github, +as well as the source code
+ +The Pactus blockchain Testnet-1 is now available for participation. +This version simulates the Mainnet environment and evaluate the system’s performance, stability, +and security in a controlled environment. +The primary goal of this version of Testnet is to determine the efficient and secure committee size for the Mainnet.
+ +To join the Testnet, download Pactus software +version 0.10.0 and +connect to Testnet without any special configuration or hardware. +You can run the software on your personal computer or laptop. +To acquire test coins, visit the Discord channel and +provide your validator address.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
+ +Pactus Blockchain Version 0.11.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version is the fix for the relay +connection issue. +A relay is a peer in the network that facilitates the connection between two peers, +particularly when they are using home internet.
+ +Another significant update is that sending a Bond transaction +is now more user-friendly. +Users no longer need to set the validator public key if they want to bond Test PAC coins to their validators.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.12.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version is focused on improving the sync time to make it faster. +This is achieved by implementing a caching mechanism that executes transactions more quickly and +improves the calculation of total power (stake) of the blockchain in a more effective way.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.13.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +Users can now restore the default_wallet
during the node initialization.
+If users have a backup of the seed phrase (mnemonic) for the default_wallet
,
+they can now restore it and re-initialize the node.
This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +For a Proof of Stake blockchain, validators are important for +maintaining the network’s integrity and security. They are similar to miners in Proof of Work blockchains like Bitcoin.
+ +Pactus as a real Proof of Stake blockchain, has achieved a significant milestone. +More than 500 validators joined the Testnet +in less than 2 months. +This accomplishment proves that Pactus is reliable, resilient, and trustworthy. More importantly, it sets new standards +in the blockchain world. In fact, the Pactus Testnet is even more decentralized than some well-known blockchains.
+ + + +One key reason why Pactus can accommodate more validators is its powerful +consensus mechanism. +The consensus mechanism in Pactus eliminates the need for delegation, making it possible for anyone to become a validator. +Additionally, the user-friendly application ensures that even those new to blockchain can easily contribute to the network.
+ +To remain competitive in the market, Pactus recognizes the importance of prioritizing user space. +We aim to ensure that running Pactus is affordable and accessible to anyone, regardless of their technical expertise or +available resources.
+ +To achieve this, the Pactus team constantly monitors network, storage, and computational usage, striving to keep them +at minimal levels. +By doing so, we enable more individuals to participate in the Pactus blockchain.
+ +Currently, the Pactus team is working on optimizing and reducing network usage. This effort will lead to reduced costs, +especially for users who are using home internet connections.
+ +Furthermore, we are planning to introduce a pruning mode, allowing users to run the Pactus blockchain with significantly +less storage. +Although we believe the storage size is already small, our goal is to enable users to +retain only the most recent blockchain history. +This approach ensures that the blockchain size remains as compact as possible by disregarding some history of the blockchain.
+ +The meeting took place on 09 July 2023, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting began with an overview of the Network module in Pactus. +This module uses Libp2p as its underlying network protocol.
+ +The Network module is agnostic about the content of the message and +handles two types of messages: Gossip messages, which are broadcasted, +and Stream messages, which are sent directly to a specific peer. +The team discussed the relay nodes that enable communication for nodes behind NAT. +Upon receiving a message, the module publishes an event. +The two types of events are Gossip events and Steam events.
+ + + +The team discussed the issue of Relay connections resetting, and explored solutions such as +hole punching or using UDP and IPv6.
+ +Some users in the Testnet reported high network usage. +The team discussed implementing metrics for LibP2P to monitor network usage effectively. +The discussion related to this issue can be found here. +Additionally, the team discussed the customization of network resources, +including setting limits for inbound and outbound connections.
+ +Moving on, the Sync module was discussed. +Unlike the Network module, the Sync module has full knowledge about the messages and packets. +The module handles a range of message types, which can be found +here.
+ +It was suggested that we need to define metrics for each message type. +There was also a discussion about the need for reducing the messages to optimize the use of network resources.
+ +The team decided to continue discussing these topics in future meetings. +They also plan to work on improving the Network and Sync modules based on these discussions.
+ +Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In May 2023, we launched our second Testnet. +The main purpose of this Testnet was to measure block time creation and the responsiveness of the blockchain. +The development team also focused on evaluating the network’s performance. +Additionally, the overall performance of the software and the syncing process were closely examined and assessed.
+ +The committee for Testnet-1 was set to 21 validators, +and 584 validators joined during the Testnet period. +More than 600,000 blocks were created, and more than 1 million transactions were processed during this time. +The size of the blockchain is about 300 megabytes.
+ +About 300,000 coins were staked during this period, it was almost 50% of the total generated coins. +It shows that users, even in Testnet, tend to stake their coins.
+ + + +We were able to extract the confirmation time of transactions. +More than 97% of transactions were confirmed in just one block after submission. +This indicates that the transaction pool and broadcasting models are working fine.
+ + + +Based on logs from one of the validators, the time for creating a block is about 3 seconds in normal cases. +More than 97% of blocks are committed in the first rounds.
+ + + +During Testnet-1, we released three versions(Version +0.11.0, +0.12.0, +0.13.0), and the upgrade process was smooth. +At this time, the development team decided to stop Testnet-1 and work on improvements that are not backward compatible, +including:
+ +After stabilizing the changes, we will announce the next Testnet, and hopefully, this will be the pre-launch Testnet.
+ +This Testnet was important for us. +It helped us learn what we need to do to make Pactus work even better. +Without the community that supports us and dedicates their time and resources to testing and feedback, +we wouldn’t have been able to progress as we have.
+ +we thank all of them for their valuable contributions. +As promised, participants in Testnets will be given priority as validators for the MainNet, and +will receive bounty tokens from the bootstrap accounts to set up their validator.
+ +We are grateful to all those who participated in Testnet-1, and +we encourage them to join our next Testnet to help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
+ +there is several activities in pactus github this month, here is a clear report and explain of activities.
+ + + +one of new changes in pactus project is new linters we added this month. +what is linters? +linters are just a set of rules for the style of source codes, they force developers to write new codes +in correct, clean and safe way.
+ +why we use them? +the reason we are using linters in Pactus and add new ones, is to make the code more safe, +and also make it easy to work on for new contributors because we are focus on being decentralized even in development.
+ + + +one another new change in Pactus is updating TLA+ spec, which is related to consensus, +as you know we had some problem with consensus in Testnet-1, we fixed the issues and now we are trying to make it more clean.
+ + + +if you wish you can learn more about Pactus consensus here.
+ +some of previous Pactus dependencies was so old, so we start refactoring them and use new libraries. +also we used some libraries with higher performance which is make Pactus full node more faster in mainnet.
+ + + +In our commitment to transparency and innovation, we’re excited to introduce a major step in Pactus’s journey: +the Pactus Improvement Proposals, or PIPs.
+ + + +Pactus Improvement Proposals (PIPs) define standards for the ongoing development and enhancement of the Pactus platform. +Each PIP has a unique number like PIP-2, +PIP-3, and so on. +These proposals provide technical details for suggested modifications or enactments, serving as a guide for development.
+ +The PIP process is open, allowing any member of the Pactus community to propose a PIP. +The author should provide a summary, motivation, and a detailed technical explanation. +The Pactus Laboratory team will carefully review each PIP. +Security considerations must be addressed before finalizing a PIP. +Once finalized, it can be added to the code. +This process helps avoid unexpected issues during development and maintain consistency and safety.
+ +The Pactus Improvement Proposals (PIPs) was inspired by the +Ethereum Improvement Proposals (EIPs) system, +which had its roots in the Bitcoin Improvement Proposals (BIPs) and +Python Enhancement Proposals (PEPs).
+ +From now on, all major changes or new features in the Pactus project require a PIP. +Any implementation must reference its specific PIP. +Without approval from Pactus Laboratory team, changes won’t be approved and added to the codebase.
+ +For a complete list of Pactus Improvement Proposals, visit this link. +The corresponding GitHub repository is accessible here.
+ + + +there is several activities in Pactus github in September month, here is a clear report and explain of activities.
+ + + +After starting Pactus Labs and PIPs, +we start implementing each accepted PIP one by one to improve Pactus, here is a list of implemented PIPs:
+ +There is some very good change and new features for Pactus network module, +this list contain a list of important changes in Pactus networking:
+ +We also updated, improved and enhanced gRPC and nanomessage services for better developer experience, +for third-party and side project developers, here is some changes:
+ +We had some not implemented feature request, not fixed bugs and some issue with new golang version, +list of this changes:
+ +In all Blockchain protocols, there is a concept called a consensus mechanism. +This mechanism is used to enable nodes to reach an agreement +on the state of the Blockchain they are +maintaining, in order to have a synchronized and integrated Blockchain.
+ +For now, we have a lot of consensus mechanisms in the Blockchain world. +Pactus Blockchain uses the SSPoS (Solid State Proof of State) which is a new consensus model.
+ +To explain how it works let’s start with explaining one of the first and simplest +consensus mechanisms (or if you already know them, just jump into the last part named SSPoS).
+ + + +In the proof of work model, each node in the network should solve a complex mathematical +problem that requires lots of computing resources to make a new block.
+ +In this way, it’s highly unlikely that anyone would be able to change +past transactions and change Blockchain states such as balances, +without expending equivalent computational power.
+ +By doing this we ensure the security and integrity of the Blockchain.
+ +The concept was adapted from digital tokens by Hal Finney in 2004 +through the idea of “reusable proof of work” using the 160-bit secure hash algorithm 1 (SHA-1).
+ +Bitcoin uses this consensus model.
+ +On the other hand, PoS or Proof of Stake is another consensus mechanism that instead of miners has validators!
+ +Validators lock a number of their assets in the Blockchain and they can transfer or use it +till it is locked which we call staking. +after each Block is committed one of the validators will be chosen randomly (more amount of stake, +more chance to be chosen) when a validator is chosen +it proposes a block and announces it to other nodes to be validated, +when a supermajority of validators accept the block it’s going to be committed.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk losing the stake amount.
+ +More amount of validators in a PoS Blockchain makes it more secure, +decentralized, and trustable, but it also makes the validation and consensus process slower and more difficult.
+ +Ethereum uses this model.
+ +DPoS or Delegated Proof of Stake, is a variant of the PoS consensus algorithm. +users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions +and creating blocks. The number of delegates is limited +to ensure accountability and efficiency in the validation process.
+ +Some Blockchains like Cardano and Tron use DPoS.
+ +DPoS tries to solve the issue of PoS which when validators +increase we have an inefficient validation process. but the main issue with DPoS itself is putting a lot +of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +BUT, HOW ABOUT SSPoS? HOW ABOUT PACTUS?
+ +In Pactus Blockchain, we have something called Solid State Proof of Stake +and we try to fix the previous model’s issue, let me explain.
+ +Pactus uses a dynamic committee of validators with a fixed size of 21, +but the members of the committee randomly change in each round, +based on stake amount the chance of being chosen is higher. on the other hand, +the number of validators out on the committee is unlimited, allowing anyone +to become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm by generating a random number +between zero and the total staked coins. If the number is less +than the validator’s stake, they can enter the committee and replace the oldest committee member.
+ +So, in SSPoS models which are a variant of PoS, we can reach a consensus, +without using high computation resources, having an inefficient +validation process by increasing validator numbers, +and also without breaking the principle of “don’t trust, verify”.
+ +Pactus Blockchain Version 0.15.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ + + +This version is the bootstrap version for +Testnet-2. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Exciting news for the Pactus Community: Testnet-2 is has launched! +The journey through Testnet-1 +brought success and invaluable experiences, with over 500 validators joining the network. +Despite its noteworthy achievements, it also faced challenges that led to a tough decision: to pause the Testnet and +thoroughly address these issues. +After two months of dedicated work and testing, many problems have been resolved, and +we feel confident launching the Testnet again. +Testnet-2 comes with substantial improvements compared to its predecessor by enhancing the core of the Pactus Blockchain. +Notably, the new consensus mechanism and improved overall network performance.
+ +At this point, we want to assure the Pactus community that this version of +the Testnet will not stop until the mainnet launches, +and our main focus is on improving its overall performance and launching the Mainnet.
+ +If you’re new to the concept of Testnet, check out our informative post: +What is the Testnet?
+ +Testnet-2 has important tasks ahead. +Firstly, we aim to confirm that the new consensus mechanism is both safe and efficient. +A close eye will be kept on the network’s performance, ensuring it operates as expected. +For Testnet-2, the committee +size has been expanded to 51 members. +Both the committee’s performance and block production will be closely monitored. +The goal is a blockchain that remains stable and trustworthy, +even with thousands of validators in the network, +ensuring it manages its regular duties seamlessly.
+ +Want to join the Testnet-2? Great! It’s super easy. +Just download the latest Pactus software and you’re good to go. +no fancy setups or special gear needed. +You can run the software straight from your personal computer or laptop. +Need some test coins? Pop over to our Discord channel and share your validator address there.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
+ +Pactus Blockchain Version 0.15.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version address an unforeseen issue in the consensus protocol. +We kindly ask all validators to upgrade their nodes to this version.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.15.2 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows nodes to set limits on the number of connections they can establish. +By default, each node can have a minimum of 8 connections and a maximum of 16 connections. +Users can easily change these numbers in the configuration file.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.16.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows users to create new addresses for both validators and accounts. +The networking module has been improved, and users can now set limits on the number of connections. +A random crash on the agreement protocol has been fixed in this version.
+ + + +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.16.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +In this version, the private IP address won’t be advertised, and by default,
+nodes try to find if they have any public IP address.
+If so, they will advertise it. Users can also set the public_address
in the config file.
+This feature specifically helps users who have both public and private IP addresses to always advertise the public addresses.
+Users can still use the private network if they enable the force_private_network
option inside the config file.
+Most users don’t need to change their node’s configuration.
This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Page not found :(
+The requested page could not be found.
+This FAQ (Frequently Asked Questions) page aims to provide helpful information and guidance on common questions and concerns related to Pactus. +
+The meeting took place on 04 September 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +During the meeting, Joseph suggested using Nanomsg instead of ZeroMQ because building ZeroMQ is not easy, +especially in Windows. Additionally, we can use the pure Go implementation of Nanomsg.
+ +The format of block events was defined as follows:
+ +<event_id: 1 byte><event_data: variant><height: 4 bytes><seq_num: 4 bytes>
+
As a consequence of this, smart contracts events can be defined more easily and +Infura-like services become simple, as we can just replay the events.
+ +Nagaraj’s pull request reviewed.
+ +The team discussed renaming (rebranding) the project and decided to create an online survey to +gather suggestions for a new name. +Everyone is encouraged to participate in the survey and suggest new names for the project.
+ +The meeting took place on 29 August 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +During the last meeting, the team conducted an online survey to rename the project. +A total of 31 responses were received, and the following names were suggested:
+ +Name | +Votes | +
---|---|
Sirius | +11 | +
Pactus | +10 | +
Nova | +7 | +
Texo | +6 | +
Zemus | +6 | +
Helios | +6 | +
Tutti | +5 | +
Haki | +5 | +
Aegeus | +4 | +
Virgo | +4 | +
Zentora | +3 | +
Zinova | +3 | +
Xerxes | +2 | +
Ledgeria | +2 | +
Solidus | +2 | +
Welt | +2 | +
Ventura | +2 | +
Zebra | +2 | +
Miranet | +2 | +
Monetha | +2 | +
FutureHub | +1 | +
Muonet | +1 | +
Mentha | +1 | +
Hypatios | +0 | +
Chaintopia | +0 | +
Sycee | +0 | +
Lepus | +0 | +
After reviewing the responses, the team chose “Pactus” as the new name for the project. 🎉 +The project will be moved to “pactus-project/pactus,” and the team plans to announce it on social media.
+ +In terms of the GUI, Joseph suggested using Flutter, and the team agreed. +To interact with the wallet, gRPC APIs will be provided, and the GUI will use these APIs.
+ +The meeting took place on 18 September 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The team discussed Testnet and related issues, including IP block issues that were found by Hadi. +Due to sanctions, some IPs are blocked, so the team will run a support node to assist users inside Iran. +The GUI application had some issues on Windows, but they were fixed and tested by Hadi.
+ +The website still has some issues, such as the need to rename the animation to “Pactus” and the lack of a logo. +The community suggested some logos. Additionally, the roadmap page is missing.
+ +The team discussed the status of social media platforms, including:
+ +The team also decided to announce the project on social media on 29 September.
+ +The team discussed the current consensus parameters:
+ +Pactus Blockchain Release Version 0.9.0 +is now available for download. +This release includes a new graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version has been implemented for Testnet-0 and is preparing for the upcoming Mainnet launch. +To get started with the Pactus Blockchain Testnet-0, simply download +the latest version and run the Pactus software.
+ +Join the Testnet now and get ready for the future!
+ +The Pactus blockchain Testnet-0 is now accessible. +To participate, simply download the Pactus application version 0.9.0 and +connect to the Testnet without any special configurations. +For test coins, please visit our Discord channel and share your validator address.
+ +By taking part in the Testnet, you can familiarize yourself with the Pactus blockchain and +get ready for the Mainnet launch. +Testnet participants will also be given higher priority during the Mainnet launch.
+ +Please share your feedback with us to help improve the user experience in future versions of the software.
+ +The meeting took place on 30 October 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting started in memory of Mahsa Amini. +We in the Pactus family stand in solidarity with courageous people who are fighting for equality, equity and freedom in Iran.
+ + + +The beta version of the block explorer has been launched 🚀 and is now available at +https://pacscan.org.
+ +Nagaraj explained the block explorer and some of the features.
+ +Project road map was discussed.
+ +Ali presented the Pactus pitch deck for the IdeaKita in Malaysia. +The IdeaKita program, under the Malaysia Digital Economy Corporation (MDEC), is designed to +support entrepreneurs and startups in Malaysia.
+ +The latest pull requests were reviewed:
+ +Pactus Blockchain Release Version 0.9.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version has been implemented for Testnet-0 and is preparing for the upcoming Mainnet launch. +To start using the Pactus Blockchain Testnet-0, +you can download the latest version from download page +and join the Testnet.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +If you have ever wondered what Testnet is and how it is different from Mainnet, read this article to the end to find out!
+ +Mainnet and Testnet are two widely used terminologies in the Blockchain ecosystem; +so it is important to understand the meaning and differences while working in the industry or +following announcements of the Blockchain projects like Pactus.
+ +Here’s a quick explanation: +Before the actual live version of a Blockchain network that is used for real transactions, +functions and smart-contracts (which is referred as Mainnet), +there is a test version of the Blockchain network for testing purposes (which is referred as Testnet). +In Testnet, a safe environment is provided to help developers experiment and test their applications, +and make sure that everything functions smoothly in the Mainnet version.
+ +A Testnet is a simulation of a Blockchain, in which developers can test all the functionalities of +their Blockchain network without risking their assets and convenience of end-users. +Using Testnet, any possible error, bug or malfunctions can be fixed before the Mainnet launch. +Testnet also can be an experimental environment for new features, updates and upgrades. +So several Testnet networks of the same version or newer version of the Mainnet can be implemented on the roadmap.
+ +A secure environment to test development ideas and updates. +So many features and minor details in Pactus project have been successfully developed so far using the Testnet; such as:
+ +Providing a safe testing ground for resolve scalability and security problems, as well as decentralization issues. +Pactus network is also a secure and purely decentralized network. However in the last updates during the Testnet, +developers are now able to decrease the database size by approximately 10% without compromising performance. +They did it by utilizing block height instead of hash to store blocks within the database. (you can find out more +here).
+ +Testing new versions, patches and features on Testnet. it is vital for enhancing the security, load testing, +Blockchain migration, integration tests, and etc. This is why you can now use the latest version of Pactus-GUI +that works like clockwork and is extremely secure.
+ +Testing the functions of cryptocurrency without disrupting the Mainnet. In the Testnet of Pactus Blockchain, +you as a user or validator can use all the features to send, receive, bond or unbond your assets in the Pactus-GUI.
+ +Development and simulation of smart contract features and DApps. Note that many Blockchain projects like Pactus, +can be used as smart-contract platforms. So the Testnet can be designed in different stages to test and improve +different applications of the network.
+ +Please note that after a certain period of time, when developers get satisfied with the functionality and debugging process, +they launch Mainnet. Mainnet has its own independent genesis blocks; +so the assets and addresses that users use in Testnet are not valid inside the new Mainnet Blockchain anymore. +In fact the whole Blockchain network starts working from the scratch and users and validators start to +work with real tokens and transactions instead of the simulated ones. But since Testnet has an important effect +on the health and improvement of the network, in Pactus Blockchain, we have several advantages +for the people who join the Testnet.
+ +There are different contributors in a Blockchain network; +Some people are developers and programmers that use the Testnet to contribute, enhance and lead the project to a better future. +Testnet is actually vital for them to perform their changes and try their innovations and ideas.
+ +But you might also be an end user; you might want to either be a validator and stake your assets to earn more Pactus coins, +or you might want to learn how to use the network for future personal applications. Either way, +you might find it handy to give it a try and be familiar with Pactus-GUI and its different features.
+ +However, there is another advantage for end users who join the Testnet. +While using the network, running a node or testing the Pactus-GUI in Testnet period, you are contributing to +the community to find improvement potentials, that’s why there are more advantages contemplated for the Testnet users; +Soon our Mainnet will be launched and also Pactus network will be announced and listed in well-known exchanges. +As an early contributor, you will have the advantage of getting some extra initial tokens at the beginning of Mainnet launch. +So that you can use it to run a validator node and earn more from staking your assets. This airdrop is considered +for every individual who installs Pactus-GUI and starts a node in Testnet.
+ +There are other positive conditions you may experience as an early contributor.
+ +Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In September 2022, we launched our first Testnet. +The purpose of this Testnet was to +check the consensus protocol, +test different transaction types, +and ensure the stability of the blockchain. +We also wanted to test the sortition algorithm +to make sure it works properly.
+ +The committee +for the Testnet-0 was set to five validators, and more than 19 validators joined during the Testnet period. +Over 2 million blocks were created, and more than 3.2 million transactions were processed during this time. +The size of the blockchain is approximately 1 gigabyte. +The maximum number of transactions recorded in a single block was 386. With a block time of 10 seconds, +we can confirm that Pactus blockchain can support up to 30 transactions per second (TPS), +which is a reasonable number for TPS. Based on real-time statistics available at realtps, +we can see that Pactus is among the top 10 blockchains in terms of TPS.
+ +At this point, the development team decided to end the Testnet-0 and move on to the next one, +Testnet-1. We are planning to run the Testnet-1 to prepare for the MainNet launch. +We will provide updates on our progress and share the details of the new Testnet soon.
+ +As promised, participants in Testnets will be given priority as validators for the MainNet, +and will receive bounty tokens from the bootstrap accounts to set up their validator. +We are grateful to all those who participated in Testnet-0, and we encourage them to join our next Testnet to +help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
+ +Pactus Blockchain Version 0.10.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version allows users to set up multiple validators in one node. +Users can set up to 32 validators in a single node, and each validator can stake up to 1,000 coins.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +GetBlockchainInfo
API in gRPC now returns the total number of validators and accounts (#439)You can find the full list of changes on Github, +as well as the source code
+ +The Pactus blockchain Testnet-1 is now available for participation. +This version simulates the Mainnet environment and evaluate the system’s performance, stability, +and security in a controlled environment. +The primary goal of this version of Testnet is to determine the efficient and secure committee size for the Mainnet.
+ +To join the Testnet, download Pactus software +version 0.10.0 and +connect to Testnet without any special configuration or hardware. +You can run the software on your personal computer or laptop. +To acquire test coins, visit the Discord channel and +provide your validator address.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
+ +Pactus Blockchain Version 0.11.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version is the fix for the relay +connection issue. +A relay is a peer in the network that facilitates the connection between two peers, +particularly when they are using home internet.
+ +Another significant update is that sending a Bond transaction +is now more user-friendly. +Users no longer need to set the validator public key if they want to bond Test PAC coins to their validators.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.12.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version is focused on improving the sync time to make it faster. +This is achieved by implementing a caching mechanism that executes transactions more quickly and +improves the calculation of total power (stake) of the blockchain in a more effective way.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.13.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +Users can now restore the default_wallet
during the node initialization.
+If users have a backup of the seed phrase (mnemonic) for the default_wallet
,
+they can now restore it and re-initialize the node.
This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +For a Proof of Stake blockchain, validators are important for +maintaining the network’s integrity and security. They are similar to miners in Proof of Work blockchains like Bitcoin.
+ +Pactus as a real Proof of Stake blockchain, has achieved a significant milestone. +More than 500 validators joined the Testnet +in less than 2 months. +This accomplishment proves that Pactus is reliable, resilient, and trustworthy. More importantly, it sets new standards +in the blockchain world. In fact, the Pactus Testnet is even more decentralized than some well-known blockchains.
+ + + +One key reason why Pactus can accommodate more validators is its powerful +consensus mechanism. +The consensus mechanism in Pactus eliminates the need for delegation, making it possible for anyone to become a validator. +Additionally, the user-friendly application ensures that even those new to blockchain can easily contribute to the network.
+ +To remain competitive in the market, Pactus recognizes the importance of prioritizing user space. +We aim to ensure that running Pactus is affordable and accessible to anyone, regardless of their technical expertise or +available resources.
+ +To achieve this, the Pactus team constantly monitors network, storage, and computational usage, striving to keep them +at minimal levels. +By doing so, we enable more individuals to participate in the Pactus blockchain.
+ +Currently, the Pactus team is working on optimizing and reducing network usage. This effort will lead to reduced costs, +especially for users who are using home internet connections.
+ +Furthermore, we are planning to introduce a pruning mode, allowing users to run the Pactus blockchain with significantly +less storage. +Although we believe the storage size is already small, our goal is to enable users to +retain only the most recent blockchain history. +This approach ensures that the blockchain size remains as compact as possible by disregarding some history of the blockchain.
+ +The meeting took place on 09 July 2023, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting began with an overview of the Network module in Pactus. +This module uses Libp2p as its underlying network protocol.
+ +The Network module is agnostic about the content of the message and +handles two types of messages: Gossip messages, which are broadcasted, +and Stream messages, which are sent directly to a specific peer. +The team discussed the relay nodes that enable communication for nodes behind NAT. +Upon receiving a message, the module publishes an event. +The two types of events are Gossip events and Steam events.
+ + + +The team discussed the issue of Relay connections resetting, and explored solutions such as +hole punching or using UDP and IPv6.
+ +Some users in the Testnet reported high network usage. +The team discussed implementing metrics for LibP2P to monitor network usage effectively. +The discussion related to this issue can be found here. +Additionally, the team discussed the customization of network resources, +including setting limits for inbound and outbound connections.
+ +Moving on, the Sync module was discussed. +Unlike the Network module, the Sync module has full knowledge about the messages and packets. +The module handles a range of message types, which can be found +here.
+ +It was suggested that we need to define metrics for each message type. +There was also a discussion about the need for reducing the messages to optimize the use of network resources.
+ +The team decided to continue discussing these topics in future meetings. +They also plan to work on improving the Network and Sync modules based on these discussions.
+ +Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In May 2023, we launched our second Testnet. +The main purpose of this Testnet was to measure block time creation and the responsiveness of the blockchain. +The development team also focused on evaluating the network’s performance. +Additionally, the overall performance of the software and the syncing process were closely examined and assessed.
+ +The committee for Testnet-1 was set to 21 validators, +and 584 validators joined during the Testnet period. +More than 600,000 blocks were created, and more than 1 million transactions were processed during this time. +The size of the blockchain is about 300 megabytes.
+ +About 300,000 coins were staked during this period, it was almost 50% of the total generated coins. +It shows that users, even in Testnet, tend to stake their coins.
+ + + +We were able to extract the confirmation time of transactions. +More than 97% of transactions were confirmed in just one block after submission. +This indicates that the transaction pool and broadcasting models are working fine.
+ + + +Based on logs from one of the validators, the time for creating a block is about 3 seconds in normal cases. +More than 97% of blocks are committed in the first rounds.
+ + + +During Testnet-1, we released three versions(Version +0.11.0, +0.12.0, +0.13.0), and the upgrade process was smooth. +At this time, the development team decided to stop Testnet-1 and work on improvements that are not backward compatible, +including:
+ +After stabilizing the changes, we will announce the next Testnet, and hopefully, this will be the pre-launch Testnet.
+ +This Testnet was important for us. +It helped us learn what we need to do to make Pactus work even better. +Without the community that supports us and dedicates their time and resources to testing and feedback, +we wouldn’t have been able to progress as we have.
+ +we thank all of them for their valuable contributions. +As promised, participants in Testnets will be given priority as validators for the MainNet, and +will receive bounty tokens from the bootstrap accounts to set up their validator.
+ +We are grateful to all those who participated in Testnet-1, and +we encourage them to join our next Testnet to help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
+ +there is several activities in pactus github this month, here is a clear report and explain of activities.
+ + + +one of new changes in pactus project is new linters we added this month. +what is linters? +linters are just a set of rules for the style of source codes, they force developers to write new codes +in correct, clean and safe way.
+ +why we use them? +the reason we are using linters in Pactus and add new ones, is to make the code more safe, +and also make it easy to work on for new contributors because we are focus on being decentralized even in development.
+ + + +one another new change in Pactus is updating TLA+ spec, which is related to consensus, +as you know we had some problem with consensus in Testnet-1, we fixed the issues and now we are trying to make it more clean.
+ + + +if you wish you can learn more about Pactus consensus here.
+ +some of previous Pactus dependencies was so old, so we start refactoring them and use new libraries. +also we used some libraries with higher performance which is make Pactus full node more faster in mainnet.
+ + + +In our commitment to transparency and innovation, we’re excited to introduce a major step in Pactus’s journey: +the Pactus Improvement Proposals, or PIPs.
+ + + +Pactus Improvement Proposals (PIPs) define standards for the ongoing development and enhancement of the Pactus platform. +Each PIP has a unique number like PIP-2, +PIP-3, and so on. +These proposals provide technical details for suggested modifications or enactments, serving as a guide for development.
+ +The PIP process is open, allowing any member of the Pactus community to propose a PIP. +The author should provide a summary, motivation, and a detailed technical explanation. +The Pactus Laboratory team will carefully review each PIP. +Security considerations must be addressed before finalizing a PIP. +Once finalized, it can be added to the code. +This process helps avoid unexpected issues during development and maintain consistency and safety.
+ +The Pactus Improvement Proposals (PIPs) was inspired by the +Ethereum Improvement Proposals (EIPs) system, +which had its roots in the Bitcoin Improvement Proposals (BIPs) and +Python Enhancement Proposals (PEPs).
+ +From now on, all major changes or new features in the Pactus project require a PIP. +Any implementation must reference its specific PIP. +Without approval from Pactus Laboratory team, changes won’t be approved and added to the codebase.
+ +For a complete list of Pactus Improvement Proposals, visit this link. +The corresponding GitHub repository is accessible here.
+ + + +there is several activities in Pactus github in September month, here is a clear report and explain of activities.
+ + + +After starting Pactus Labs and PIPs, +we start implementing each accepted PIP one by one to improve Pactus, here is a list of implemented PIPs:
+ +There is some very good change and new features for Pactus network module, +this list contain a list of important changes in Pactus networking:
+ +We also updated, improved and enhanced gRPC and nanomessage services for better developer experience, +for third-party and side project developers, here is some changes:
+ +We had some not implemented feature request, not fixed bugs and some issue with new golang version, +list of this changes:
+ +In all Blockchain protocols, there is a concept called a consensus mechanism. +This mechanism is used to enable nodes to reach an agreement +on the state of the Blockchain they are +maintaining, in order to have a synchronized and integrated Blockchain.
+ +For now, we have a lot of consensus mechanisms in the Blockchain world. +Pactus Blockchain uses the SSPoS (Solid State Proof of State) which is a new consensus model.
+ +To explain how it works let’s start with explaining one of the first and simplest +consensus mechanisms (or if you already know them, just jump into the last part named SSPoS).
+ + + +In the proof of work model, each node in the network should solve a complex mathematical +problem that requires lots of computing resources to make a new block.
+ +In this way, it’s highly unlikely that anyone would be able to change +past transactions and change Blockchain states such as balances, +without expending equivalent computational power.
+ +By doing this we ensure the security and integrity of the Blockchain.
+ +The concept was adapted from digital tokens by Hal Finney in 2004 +through the idea of “reusable proof of work” using the 160-bit secure hash algorithm 1 (SHA-1).
+ +Bitcoin uses this consensus model.
+ +On the other hand, PoS or Proof of Stake is another consensus mechanism that instead of miners has validators!
+ +Validators lock a number of their assets in the Blockchain and they can transfer or use it +till it is locked which we call staking. +after each Block is committed one of the validators will be chosen randomly (more amount of stake, +more chance to be chosen) when a validator is chosen +it proposes a block and announces it to other nodes to be validated, +when a supermajority of validators accept the block it’s going to be committed.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk losing the stake amount.
+ +More amount of validators in a PoS Blockchain makes it more secure, +decentralized, and trustable, but it also makes the validation and consensus process slower and more difficult.
+ +Ethereum uses this model.
+ +DPoS or Delegated Proof of Stake, is a variant of the PoS consensus algorithm. +users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions +and creating blocks. The number of delegates is limited +to ensure accountability and efficiency in the validation process.
+ +Some Blockchains like Cardano and Tron use DPoS.
+ +DPoS tries to solve the issue of PoS which when validators +increase we have an inefficient validation process. but the main issue with DPoS itself is putting a lot +of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +BUT, HOW ABOUT SSPoS? HOW ABOUT PACTUS?
+ +In Pactus Blockchain, we have something called Solid State Proof of Stake +and we try to fix the previous model’s issue, let me explain.
+ +Pactus uses a dynamic committee of validators with a fixed size of 21, +but the members of the committee randomly change in each round, +based on stake amount the chance of being chosen is higher. on the other hand, +the number of validators out on the committee is unlimited, allowing anyone +to become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm by generating a random number +between zero and the total staked coins. If the number is less +than the validator’s stake, they can enter the committee and replace the oldest committee member.
+ +So, in SSPoS models which are a variant of PoS, we can reach a consensus, +without using high computation resources, having an inefficient +validation process by increasing validator numbers, +and also without breaking the principle of “don’t trust, verify”.
+ +Pactus Blockchain Version 0.15.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ + + +This version is the bootstrap version for +Testnet-2. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Exciting news for the Pactus Community: Testnet-2 is has launched! +The journey through Testnet-1 +brought success and invaluable experiences, with over 500 validators joining the network. +Despite its noteworthy achievements, it also faced challenges that led to a tough decision: to pause the Testnet and +thoroughly address these issues. +After two months of dedicated work and testing, many problems have been resolved, and +we feel confident launching the Testnet again. +Testnet-2 comes with substantial improvements compared to its predecessor by enhancing the core of the Pactus Blockchain. +Notably, the new consensus mechanism and improved overall network performance.
+ +At this point, we want to assure the Pactus community that this version of +the Testnet will not stop until the mainnet launches, +and our main focus is on improving its overall performance and launching the Mainnet.
+ +If you’re new to the concept of Testnet, check out our informative post: +What is the Testnet?
+ +Testnet-2 has important tasks ahead. +Firstly, we aim to confirm that the new consensus mechanism is both safe and efficient. +A close eye will be kept on the network’s performance, ensuring it operates as expected. +For Testnet-2, the committee +size has been expanded to 51 members. +Both the committee’s performance and block production will be closely monitored. +The goal is a blockchain that remains stable and trustworthy, +even with thousands of validators in the network, +ensuring it manages its regular duties seamlessly.
+ +Want to join the Testnet-2? Great! It’s super easy. +Just download the latest Pactus software and you’re good to go. +no fancy setups or special gear needed. +You can run the software straight from your personal computer or laptop. +Need some test coins? Pop over to our Discord channel and share your validator address there.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
+ +Pactus Blockchain Version 0.15.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version address an unforeseen issue in the consensus protocol. +We kindly ask all validators to upgrade their nodes to this version.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.15.2 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows nodes to set limits on the number of connections they can establish. +By default, each node can have a minimum of 8 connections and a maximum of 16 connections. +Users can easily change these numbers in the configuration file.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.16.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows users to create new addresses for both validators and accounts. +The networking module has been improved, and users can now set limits on the number of connections. +A random crash on the agreement protocol has been fixed in this version.
+ + + +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.16.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +In this version, the private IP address won’t be advertised, and by default,
+nodes try to find if they have any public IP address.
+If so, they will advertise it. Users can also set the public_address
in the config file.
+This feature specifically helps users who have both public and private IP addresses to always advertise the public addresses.
+Users can still use the private network if they enable the force_private_network
option inside the config file.
+Most users don’t need to change their node’s configuration.
This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Page not found :(
+The requested page could not be found.
+تهدف هذه الصفحة الشائعة الاستخدام (الأسئلة المتكررة) إلى توفير معلومات مفيدة وإرشادات حول الأسئلة الشائعة والمخاوف المتعلقة بـ بكتوس. +
+من خلال الانضمام إلى مجتمع بكتوس، تصبح جزءًا من شبكة عالمية من المبتكرين والمفكرين والفاعلين الذين يتحدون برؤية مشتركة لبناء مستقبل أفضل مع تقنية البلوكشين. سواء كنت مطورًا أو رائد أعمال أو مستثمرًا أو مجرد عاشق للبلوكشين، هناك مكان لك هنا في بكتوس.
إذًا، لنتحد ونحدث تغييرًا!
As an open-source platform, Pactus blockchain empowers from its community. +Whether you’re a developer, designer, or enthusiast, your contributions can make a meaningful impact.
+ +There are several ways to support the Pactus project:
+ +One of the most effective ways to contribute to the Pactus network is by running a node. +A “node” is a software program that downloads a copy of the Pactus blockchain and +ensure the network keeps running safe and decentralized.
+ +These guides can help you to run and configure your node:
+ +Validators play an important role in the Pactus blockchain by verifying transactions and +adding them to the blockchain. +By becoming a validator, you can earn rewards +for contributing to the network’s security and decentralization.
+ +To become a validator, you will need to stake a certain amount of Pactus coins. +These guides can help you to send a Bond transaction and stake some coins:
+ + + +Pactus is an open-source project that welcomes and encourages contributions from developers. +By contributing to the project, you can help improve the Pactus platform and create new features that +benefit the entire community.
+ +You can check our Contributing page +for more information on how to get involved and contribute to the project.
+ +Another way to contribute to the Pactus project is by translating this website into other languages and +improving its content.
+ +The more people who know about Pactus, the more opportunities there are for collaboration and growth. +Share our project on social media, attend Pactus events, or simply tell your friends and colleagues about us.
+ +Together, Let’s build a better future for blockchain technology.
+ + +على هذه الصفحة يمكنك العثور على كيفية تحميل والحصول على أحدث إصدار من برنامج بكتوس.
+ +يتم توزيع مشروع بكتوس كبرنامج مفتوح المصدر، لذا فإن الطريقة المفضلة لتثبيته هي استنساخ شفرة المصدر من مستودع جيت هاب وتجميع شفرة المصدر.
+ +تتوفر تعليمات تجميع بكتوس على صفحة التثبيت.
+ +يمكنك أيضًا تنزيل أحدث إصدارات بكتوس المستقرة. يتم تحديث هذه الإصدارات تلقائيًا عند إصدار نسخة جديدة في مستودع جيت هاب.
+ +يمكنك تشغيل بكتوس في وضع واجهة المستخدم الرسومية (GUI) وهو مناسب للمبتدئين والمستخدمين المتقدمين.
+ + + +File name | +Kind | +OS | +Arch | +
---|---|---|---|
pactus-gui_0.16.1_darwin_amd64.tar.gz | +Archive | +macOS | +64-bit | +
pactus-gui_0.16.1_darwin_amd64.dmg | +DMG | +macOS | +64-bit | +
pactus-gui_0.16.1_linux_amd64.tar.gz | +Archive | +Linux | +64-bit | +
pactus-gui_0.16.1_windows_amd64.zip | +Archive | +Windows | +64-bit | +
pactus-gui_0.16.1_windows_amd64_installer.exe | +Installer | +Windows | +64-bit | +
بمجرد تنزيل واجهة بكتوس الرسومية (GUI)، يمكنك اتباع هذا البرنامج التعليمي لإعداد عقدتك وتشغيلها: + كيفية تشغيل بكتوس في الوضع الرسومي؟
+ +يمكن للمستخدم المتقدم تشغيل بكتوس في وضع واجهة سطر الأوامر (CLI).
+ + + +File name | +OS | +Arch | +
---|---|---|
pactus-cli_0.16.1_android_arm64.tar.gz | +Android | +ARM64 | +
pactus-cli_0.16.1_darwin_amd64.tar.gz | +macOS | +64-bit | +
pactus-cli_0.16.1_darwin_arm64.tar.gz | +macOS | +ARM64 | +
pactus-cli_0.16.1_freebsd_amd64.tar.gz | +FreeBSD | +64-bit | +
pactus-cli_0.16.1_freebsd_arm.tar.gz | +FreeBSD | +ARM | +
pactus-cli_0.16.1_linux_amd64.tar.gz | +Linux | +64-bit | +
pactus-cli_0.16.1_linux_arm64.tar.gz | +Linux | +ARM64 | +
pactus-cli_0.16.1_windows_386.zip | +Windows | +32-bit | +
pactus-cli_0.16.1_windows_amd64.zip | +Windows | +64-bit | +
بمجرد تنزيل بكتوس CLI، يمكنك اتباع هذا البرنامج التعليمي لإعداد عقدتك وتشغيلها: + كيفية تشغيل بكتوس في وضع سطر الأوامر؟
+ +يمكن للمستخدم المتقدم الحصول على صورة بكتوس دوكر من Docker Hub.
+ +يمكنك اتباع هذا البرنامج التعليمي لإعداد عقدتك وتشغيلها باستخدام دوكر: + كيفية تشغيل بكتوس باستخدام دوكر؟
+ +Pactus Blockchain Version 0.16.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +In this version, the private IP address won’t be advertised, and by default,
+nodes try to find if they have any public IP address.
+If so, they will advertise it. Users can also set the public_address
in the config file.
+This feature specifically helps users who have both public and private IP addresses to always advertise the public addresses.
+Users can still use the private network if they enable the force_private_network
option inside the config file.
+Most users don’t need to change their node’s configuration.
This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.16.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows users to create new addresses for both validators and accounts. +The networking module has been improved, and users can now set limits on the number of connections. +A random crash on the agreement protocol has been fixed in this version.
+ + + +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version address an unforeseen issue in the consensus protocol. +We kindly ask all validators to upgrade their nodes to this version.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.2 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows nodes to set limits on the number of connections they can establish. +By default, each node can have a minimum of 8 connections and a maximum of 16 connections. +Users can easily change these numbers in the configuration file.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ + + +This version is the bootstrap version for +Testnet-2. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Exciting news for the Pactus Community: Testnet-2 is has launched! +The journey through Testnet-1 +brought success and invaluable experiences, with over 500 validators joining the network. +Despite its noteworthy achievements, it also faced challenges that led to a tough decision: to pause the Testnet and +thoroughly address these issues. +After two months of dedicated work and testing, many problems have been resolved, and +we feel confident launching the Testnet again. +Testnet-2 comes with substantial improvements compared to its predecessor by enhancing the core of the Pactus Blockchain. +Notably, the new consensus mechanism and improved overall network performance.
+ +At this point, we want to assure the Pactus community that this version of +the Testnet will not stop until the mainnet launches, +and our main focus is on improving its overall performance and launching the Mainnet.
+ +If you’re new to the concept of Testnet, check out our informative post: +What is the Testnet?
+ +Testnet-2 has important tasks ahead. +Firstly, we aim to confirm that the new consensus mechanism is both safe and efficient. +A close eye will be kept on the network’s performance, ensuring it operates as expected. +For Testnet-2, the committee +size has been expanded to 51 members. +Both the committee’s performance and block production will be closely monitored. +The goal is a blockchain that remains stable and trustworthy, +even with thousands of validators in the network, +ensuring it manages its regular duties seamlessly.
+ +Want to join the Testnet-2? Great! It’s super easy. +Just download the latest Pactus software and you’re good to go. +no fancy setups or special gear needed. +You can run the software straight from your personal computer or laptop. +Need some test coins? Pop over to our Discord channel and share your validator address there.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
]]>In all Blockchain protocols, there is a concept called a consensus mechanism. +This mechanism is used to enable nodes to reach an agreement +on the state of the Blockchain they are +maintaining, in order to have a synchronized and integrated Blockchain.
+ +For now, we have a lot of consensus mechanisms in the Blockchain world. +Pactus Blockchain uses the SSPoS (Solid State Proof of State) which is a new consensus model.
+ +To explain how it works let’s start with explaining one of the first and simplest +consensus mechanisms (or if you already know them, just jump into the last part named SSPoS).
+ + + +In the proof of work model, each node in the network should solve a complex mathematical +problem that requires lots of computing resources to make a new block.
+ +In this way, it’s highly unlikely that anyone would be able to change +past transactions and change Blockchain states such as balances, +without expending equivalent computational power.
+ +By doing this we ensure the security and integrity of the Blockchain.
+ +The concept was adapted from digital tokens by Hal Finney in 2004 +through the idea of “reusable proof of work” using the 160-bit secure hash algorithm 1 (SHA-1).
+ +Bitcoin uses this consensus model.
+ +On the other hand, PoS or Proof of Stake is another consensus mechanism that instead of miners has validators!
+ +Validators lock a number of their assets in the Blockchain and they can transfer or use it +till it is locked which we call staking. +after each Block is committed one of the validators will be chosen randomly (more amount of stake, +more chance to be chosen) when a validator is chosen +it proposes a block and announces it to other nodes to be validated, +when a supermajority of validators accept the block it’s going to be committed.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk losing the stake amount.
+ +More amount of validators in a PoS Blockchain makes it more secure, +decentralized, and trustable, but it also makes the validation and consensus process slower and more difficult.
+ +Ethereum uses this model.
+ +DPoS or Delegated Proof of Stake, is a variant of the PoS consensus algorithm. +users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions +and creating blocks. The number of delegates is limited +to ensure accountability and efficiency in the validation process.
+ +Some Blockchains like Cardano and Tron use DPoS.
+ +DPoS tries to solve the issue of PoS which when validators +increase we have an inefficient validation process. but the main issue with DPoS itself is putting a lot +of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +BUT, HOW ABOUT SSPoS? HOW ABOUT PACTUS?
+ +In Pactus Blockchain, we have something called Solid State Proof of Stake +and we try to fix the previous model’s issue, let me explain.
+ +Pactus uses a dynamic committee of validators with a fixed size of 21, +but the members of the committee randomly change in each round, +based on stake amount the chance of being chosen is higher. on the other hand, +the number of validators out on the committee is unlimited, allowing anyone +to become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm by generating a random number +between zero and the total staked coins. If the number is less +than the validator’s stake, they can enter the committee and replace the oldest committee member.
+ +So, in SSPoS models which are a variant of PoS, we can reach a consensus, +without using high computation resources, having an inefficient +validation process by increasing validator numbers, +and also without breaking the principle of “don’t trust, verify”.
]]>there is several activities in Pactus github in September month, here is a clear report and explain of activities.
+ + + +After starting Pactus Labs and PIPs, +we start implementing each accepted PIP one by one to improve Pactus, here is a list of implemented PIPs:
+ +There is some very good change and new features for Pactus network module, +this list contain a list of important changes in Pactus networking:
+ +We also updated, improved and enhanced gRPC and nanomessage services for better developer experience, +for third-party and side project developers, here is some changes:
+ +We had some not implemented feature request, not fixed bugs and some issue with new golang version, +list of this changes:
+ +]]>In our commitment to transparency and innovation, we’re excited to introduce a major step in Pactus’s journey: +the Pactus Improvement Proposals, or PIPs.
+ + + +Pactus Improvement Proposals (PIPs) define standards for the ongoing development and enhancement of the Pactus platform. +Each PIP has a unique number like PIP-2, +PIP-3, and so on. +These proposals provide technical details for suggested modifications or enactments, serving as a guide for development.
+ +The PIP process is open, allowing any member of the Pactus community to propose a PIP. +The author should provide a summary, motivation, and a detailed technical explanation. +The Pactus Laboratory team will carefully review each PIP. +Security considerations must be addressed before finalizing a PIP. +Once finalized, it can be added to the code. +This process helps avoid unexpected issues during development and maintain consistency and safety.
+ +The Pactus Improvement Proposals (PIPs) was inspired by the +Ethereum Improvement Proposals (EIPs) system, +which had its roots in the Bitcoin Improvement Proposals (BIPs) and +Python Enhancement Proposals (PEPs).
+ +From now on, all major changes or new features in the Pactus project require a PIP. +Any implementation must reference its specific PIP. +Without approval from Pactus Laboratory team, changes won’t be approved and added to the codebase.
+ +For a complete list of Pactus Improvement Proposals, visit this link. +The corresponding GitHub repository is accessible here.
+ +]]>there is several activities in pactus github this month, here is a clear report and explain of activities.
+ + + +one of new changes in pactus project is new linters we added this month. +what is linters? +linters are just a set of rules for the style of source codes, they force developers to write new codes +in correct, clean and safe way.
+ +why we use them? +the reason we are using linters in Pactus and add new ones, is to make the code more safe, +and also make it easy to work on for new contributors because we are focus on being decentralized even in development.
+ + + +one another new change in Pactus is updating TLA+ spec, which is related to consensus, +as you know we had some problem with consensus in Testnet-1, we fixed the issues and now we are trying to make it more clean.
+ + + +if you wish you can learn more about Pactus consensus here.
+ +some of previous Pactus dependencies was so old, so we start refactoring them and use new libraries. +also we used some libraries with higher performance which is make Pactus full node more faster in mainnet.
+ +]]>Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In May 2023, we launched our second Testnet. +The main purpose of this Testnet was to measure block time creation and the responsiveness of the blockchain. +The development team also focused on evaluating the network’s performance. +Additionally, the overall performance of the software and the syncing process were closely examined and assessed.
+ +The committee for Testnet-1 was set to 21 validators, +and 584 validators joined during the Testnet period. +More than 600,000 blocks were created, and more than 1 million transactions were processed during this time. +The size of the blockchain is about 300 megabytes.
+ +About 300,000 coins were staked during this period, it was almost 50% of the total generated coins. +It shows that users, even in Testnet, tend to stake their coins.
+ + + +We were able to extract the confirmation time of transactions. +More than 97% of transactions were confirmed in just one block after submission. +This indicates that the transaction pool and broadcasting models are working fine.
+ + + +Based on logs from one of the validators, the time for creating a block is about 3 seconds in normal cases. +More than 97% of blocks are committed in the first rounds.
+ + + +During Testnet-1, we released three versions(Version +0.11.0, +0.12.0, +0.13.0), and the upgrade process was smooth. +At this time, the development team decided to stop Testnet-1 and work on improvements that are not backward compatible, +including:
+ +After stabilizing the changes, we will announce the next Testnet, and hopefully, this will be the pre-launch Testnet.
+ +This Testnet was important for us. +It helped us learn what we need to do to make Pactus work even better. +Without the community that supports us and dedicates their time and resources to testing and feedback, +we wouldn’t have been able to progress as we have.
+ +we thank all of them for their valuable contributions. +As promised, participants in Testnets will be given priority as validators for the MainNet, and +will receive bounty tokens from the bootstrap accounts to set up their validator.
+ +We are grateful to all those who participated in Testnet-1, and +we encourage them to join our next Testnet to help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
]]>The meeting took place on 09 July 2023, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting began with an overview of the Network module in Pactus. +This module uses Libp2p as its underlying network protocol.
+ +The Network module is agnostic about the content of the message and +handles two types of messages: Gossip messages, which are broadcasted, +and Stream messages, which are sent directly to a specific peer. +The team discussed the relay nodes that enable communication for nodes behind NAT. +Upon receiving a message, the module publishes an event. +The two types of events are Gossip events and Steam events.
+ + + +The team discussed the issue of Relay connections resetting, and explored solutions such as +hole punching or using UDP and IPv6.
+ +Some users in the Testnet reported high network usage. +The team discussed implementing metrics for LibP2P to monitor network usage effectively. +The discussion related to this issue can be found here. +Additionally, the team discussed the customization of network resources, +including setting limits for inbound and outbound connections.
+ +Moving on, the Sync module was discussed. +Unlike the Network module, the Sync module has full knowledge about the messages and packets. +The module handles a range of message types, which can be found +here.
+ +It was suggested that we need to define metrics for each message type. +There was also a discussion about the need for reducing the messages to optimize the use of network resources.
+ +The team decided to continue discussing these topics in future meetings. +They also plan to work on improving the Network and Sync modules based on these discussions.
]]>Pactus as a real Proof of Stake blockchain, has achieved a significant milestone. +More than 500 validators joined the Testnet +in less than 2 months. +This accomplishment proves that Pactus is reliable, resilient, and trustworthy. More importantly, it sets new standards +in the blockchain world. In fact, the Pactus Testnet is even more decentralized than some well-known blockchains.
+ + + +One key reason why Pactus can accommodate more validators is its powerful +consensus mechanism. +The consensus mechanism in Pactus eliminates the need for delegation, making it possible for anyone to become a validator. +Additionally, the user-friendly application ensures that even those new to blockchain can easily contribute to the network.
+ +To remain competitive in the market, Pactus recognizes the importance of prioritizing user space. +We aim to ensure that running Pactus is affordable and accessible to anyone, regardless of their technical expertise or +available resources.
+ +To achieve this, the Pactus team constantly monitors network, storage, and computational usage, striving to keep them +at minimal levels. +By doing so, we enable more individuals to participate in the Pactus blockchain.
+ +Currently, the Pactus team is working on optimizing and reducing network usage. This effort will lead to reduced costs, +especially for users who are using home internet connections.
+ +Furthermore, we are planning to introduce a pruning mode, allowing users to run the Pactus blockchain with significantly +less storage. +Although we believe the storage size is already small, our goal is to enable users to +retain only the most recent blockchain history. +This approach ensures that the blockchain size remains as compact as possible by disregarding some history of the blockchain.
]]>Pactus Blockchain Version 0.13.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +Users can now restore the default_wallet
during the node initialization.
+If users have a backup of the seed phrase (mnemonic) for the default_wallet
,
+they can now restore it and re-initialize the node.
This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.12.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version is focused on improving the sync time to make it faster. +This is achieved by implementing a caching mechanism that executes transactions more quickly and +improves the calculation of total power (stake) of the blockchain in a more effective way.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.11.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version is the fix for the relay +connection issue. +A relay is a peer in the network that facilitates the connection between two peers, +particularly when they are using home internet.
+ +Another significant update is that sending a Bond transaction +is now more user-friendly. +Users no longer need to set the validator public key if they want to bond Test PAC coins to their validators.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>The Pactus blockchain Testnet-1 is now available for participation. +This version simulates the Mainnet environment and evaluate the system’s performance, stability, +and security in a controlled environment. +The primary goal of this version of Testnet is to determine the efficient and secure committee size for the Mainnet.
+ +To join the Testnet, download Pactus software +version 0.10.0 and +connect to Testnet without any special configuration or hardware. +You can run the software on your personal computer or laptop. +To acquire test coins, visit the Discord channel and +provide your validator address.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
]]>Pactus Blockchain Version 0.10.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version allows users to set up multiple validators in one node. +Users can set up to 32 validators in a single node, and each validator can stake up to 1,000 coins.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +GetBlockchainInfo
API in gRPC now returns the total number of validators and accounts (#439)You can find the full list of changes on Github, +as well as the source code
]]>Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In September 2022, we launched our first Testnet. +The purpose of this Testnet was to +check the consensus protocol, +test different transaction types, +and ensure the stability of the blockchain. +We also wanted to test the sortition algorithm +to make sure it works properly.
+ +The committee +for the Testnet-0 was set to five validators, and more than 19 validators joined during the Testnet period. +Over 2 million blocks were created, and more than 3.2 million transactions were processed during this time. +The size of the blockchain is approximately 1 gigabyte. +The maximum number of transactions recorded in a single block was 386. With a block time of 10 seconds, +we can confirm that Pactus blockchain can support up to 30 transactions per second (TPS), +which is a reasonable number for TPS. Based on real-time statistics available at realtps, +we can see that Pactus is among the top 10 blockchains in terms of TPS.
+ +At this point, the development team decided to end the Testnet-0 and move on to the next one, +Testnet-1. We are planning to run the Testnet-1 to prepare for the MainNet launch. +We will provide updates on our progress and share the details of the new Testnet soon.
+ +As promised, participants in Testnets will be given priority as validators for the MainNet, +and will receive bounty tokens from the bootstrap accounts to set up their validator. +We are grateful to all those who participated in Testnet-0, and we encourage them to join our next Testnet to +help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
]]>If you have ever wondered what Testnet is and how it is different from Mainnet, read this article to the end to find out!
+ +Mainnet and Testnet are two widely used terminologies in the Blockchain ecosystem; +so it is important to understand the meaning and differences while working in the industry or +following announcements of the Blockchain projects like Pactus.
+ +Here’s a quick explanation: +Before the actual live version of a Blockchain network that is used for real transactions, +functions and smart-contracts (which is referred as Mainnet), +there is a test version of the Blockchain network for testing purposes (which is referred as Testnet). +In Testnet, a safe environment is provided to help developers experiment and test their applications, +and make sure that everything functions smoothly in the Mainnet version.
+ +A Testnet is a simulation of a Blockchain, in which developers can test all the functionalities of +their Blockchain network without risking their assets and convenience of end-users. +Using Testnet, any possible error, bug or malfunctions can be fixed before the Mainnet launch. +Testnet also can be an experimental environment for new features, updates and upgrades. +So several Testnet networks of the same version or newer version of the Mainnet can be implemented on the roadmap.
+ +A secure environment to test development ideas and updates. +So many features and minor details in Pactus project have been successfully developed so far using the Testnet; such as:
+ +Providing a safe testing ground for resolve scalability and security problems, as well as decentralization issues. +Pactus network is also a secure and purely decentralized network. However in the last updates during the Testnet, +developers are now able to decrease the database size by approximately 10% without compromising performance. +They did it by utilizing block height instead of hash to store blocks within the database. (you can find out more +here).
+ +Testing new versions, patches and features on Testnet. it is vital for enhancing the security, load testing, +Blockchain migration, integration tests, and etc. This is why you can now use the latest version of Pactus-GUI +that works like clockwork and is extremely secure.
+ +Testing the functions of cryptocurrency without disrupting the Mainnet. In the Testnet of Pactus Blockchain, +you as a user or validator can use all the features to send, receive, bond or unbond your assets in the Pactus-GUI.
+ +Development and simulation of smart contract features and DApps. Note that many Blockchain projects like Pactus, +can be used as smart-contract platforms. So the Testnet can be designed in different stages to test and improve +different applications of the network.
+ +Please note that after a certain period of time, when developers get satisfied with the functionality and debugging process, +they launch Mainnet. Mainnet has its own independent genesis blocks; +so the assets and addresses that users use in Testnet are not valid inside the new Mainnet Blockchain anymore. +In fact the whole Blockchain network starts working from the scratch and users and validators start to +work with real tokens and transactions instead of the simulated ones. But since Testnet has an important effect +on the health and improvement of the network, in Pactus Blockchain, we have several advantages +for the people who join the Testnet.
+ +There are different contributors in a Blockchain network; +Some people are developers and programmers that use the Testnet to contribute, enhance and lead the project to a better future. +Testnet is actually vital for them to perform their changes and try their innovations and ideas.
+ +But you might also be an end user; you might want to either be a validator and stake your assets to earn more Pactus coins, +or you might want to learn how to use the network for future personal applications. Either way, +you might find it handy to give it a try and be familiar with Pactus-GUI and its different features.
+ +However, there is another advantage for end users who join the Testnet. +While using the network, running a node or testing the Pactus-GUI in Testnet period, you are contributing to +the community to find improvement potentials, that’s why there are more advantages contemplated for the Testnet users; +Soon our Mainnet will be launched and also Pactus network will be announced and listed in well-known exchanges. +As an early contributor, you will have the advantage of getting some extra initial tokens at the beginning of Mainnet launch. +So that you can use it to run a validator node and earn more from staking your assets. This airdrop is considered +for every individual who installs Pactus-GUI and starts a node in Testnet.
+ +There are other positive conditions you may experience as an early contributor.
+ +An account is an entity that is identified by a unique address, +which can send transactions on the blockchain.
+ +The account structure is 12 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
4 bytes | +Number | +
8 bytes | +Balance | +
The Treasury account is a special account that is defined at the genesis time. +The Treasury account holds the total supply of Pactus coins, which is fixed at 21 million coins, +and each coin is divided into 1 billion units.
+ +In each block, one coin from the treasury account is transferred to the proposer account +as block reward.
+ +This block reward serves as an incentive for validators to propose and validate new blocks on the blockchain. +As a result, the total number of Pactus coins in circulation increases gradually over time as new blocks +are added to the blockchain.
+ +An address is a unique identifier that is used to send and receive transactions on the Pactus blockchain. +It is represented as a string of 42 alphanumeric characters and always begins with the letters “pc1”. +Here is an example of an address on the Pactus blockchain:
+ +pc1p4e92hx0erqyx939crndvthvpn7qcdhefc9r6s7
+
An address in the Pactus blockchain is made up of 21 bytes and it is derived from the public key. +The first byte of the address specifies the address type, +while the remaining 20 bytes represent the hash of the public key. +The hash function used is RIPEMD-160, +which is applied after Blake2b): +The resulting byte array is then converted into a bech32m1 string.
+ + + +The address type specifies the type of the address and its defined as below:
+ +The Treasury address on the Pactus blockchain is a fixed address that is defined as follows:
+ +TreasuryAddress: 000000000000000000000000000000000000000000
+
The address type for the Treasury address is set to zero, which +means there is no key associated with the Treasury address. +The remaining characters of the address are all zeros.
+ +In the Pactus, a block is a set of data that contains a header, the certificate of the previous block +and list of the transactions. +Once a block comes with a valid certificate, it is committed and added to the blockchain, and +the certificate will be included in the next block. +A committed block is immutable, and any modifications to the block will invalidate the certificate.
+ + + +The block header is a data structure in the Pactus blockchain that contains important information about +the block.
+ +The block header is 138 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
1 byte | +Version | +
4 bytes | +Timestamp | +
32 bytes | +Previous Block Hash | +
32 bytes | +State Hash | +
48 bytes | +Sortition Seed | +
21 bytes | +Proposer Address | +
A block certificate is a proof of commitment for the block in the Pactus blockchain. +It is the result of the Pactus consensus algorithm and ensures that the block has been agreed upon by committee members.
+ +The block certificate consists the following fields:
+ +Size | +Field | +
---|---|
4 bytes | +Height | +
2 bytes | +Round | +
Variant | +Committers | +
Variant | +Absentees | +
48 bytes | +Signature | +
Each block in the Pactus blockchain contains a list of transactions. +The maximum number of transactions in a block is determined by the +consensus parameters, and currently set to 1000. +The first transaction in each block is the reward transaction. +Once a block is committed and added to the blockchain, all the transactions inside the block will be executed. +This means that the state of the blockchain will be updated based on the transactions in the committed block.
+ +The block hash is a unique identifier for each block, which is computed by hashing the following data:
+ +The previous certificate hash and the Merkle root hash of transactions are included in the block hash to +ensure that they cannot be modified. +The block hash is used to link the blocks together in the blockchain.
+ +There is no completely empty block in Pactus. +Each block contains at least one transaction, which is the reward transaction.
+ +In the Pactus blockchain, a validator called a Proposer is responsible for collecting all transactions and +creating a block every 10 seconds. +The Proposer broadcasts the proposed block to other validators inside the committee. +Other validators verify the proposed block, and if it is valid, they cast their votes in favor of the proposed block by +signing the combination of the block hash and the consensus round. +More details about the consensus mechanism can be found in the +consensus protocol document.
+ +To issue a valid certificate, signatures from validators who hold more than ⅔ of the stake in +the committee are required. +Once enough votes are collected, the signatures are aggregated and combined into a single signature, and +the certificate is issued.
+ +To verify a certificate for a block, the block hash is computed, and +the aggregated public key can be formed using the Committers and Absentees list. +Then, the signature can be verified using the aggregated public key and +the aggregated signature inside the certificate.
+ +The Pactus blockchain employs various advanced cryptographic algorithms, including hashing and signature schemes, +to protect user data and transactions.
+ +Pactus uses a hashing algorithm called Blake2b. +This algorithm is known for being a fast and secure way of creating unique digital fingerprints of data.
+ +To ensure secure transactions, Pactus uses a signature scheme called +BLS (Boneh–Lynn–Shacham) +threshold signature for cryptographic signing and verification.
+ +One of the advantages of BLS signatures is signature aggregation. BLS individual signatures can be +combined into one single aggregated signature, so that the overall size does not grow beyond one +signature.
+ +BLS signatures have an important property called non-malleability, +which means that it is impossible to generate two valid signatures for the same message. +In other words, each message has a unique signature, and signatures cannot be altered without invalidating the signature.
+ +The Pactus blockchain starts from scratch, with no pre-existing accounts or pre-allocated tokens. +Its starting point is known as the genesis block, which is created by the bootstrap validators.
+ +The Pactus blockchain starts with four bootstrap validators. +These bootstrap validators do not have any stake, however their voting power is set to one within the consensus algorithm. +Their primary role is to initiate the blockchain during a brief period known as the bootstrapping phase. +As the bootstrapping phase progresses, these validators are able to earn rewards, +which they can later use to invite other validators to join the network.
+ +Once the network reaches 21 validators, the bootstrap validators will retire, and +the blockchain will be secured by other validators.
+ +The genesis block is the first block in the Pactus blockchain, and it is created by the bootstrap validators. +This block marks the beginning of the blockchain and serves as the foundation for subsequent blocks.
+ +The previous block hash in the genesis block sets to 0, +indicating that it has no predecessor. +Additionally, the genesis block does not have a previous certificate.
+ +In Pactus, the Genesis Information is pre-defined and indicates the initial state of the network. +These parameters are hardcoded into the project and include:
+ +You can find the pre-defined Genesis Information for the Testnet of the Pactus blockchain in the genesis.json
file,
+which is located in the project repository, here.
++ +The incentive may help encourage nodes to stay honest.
+ + +
In Pactus, rewards are given to validators for proposing and validating new blocks on the blockchain. +These rewards serve as an incentive for validators to participate in the consensus process and +maintain the security and integrity of the network.
+ +To better understand the incentive model in Pactus, let’s compare it with the Bitcoin reward model. +This comparison will help to understand how the incentive model works in Pactus.
+ +Pactus | +Bitcoin | +
---|---|
Consensus engine is Proof of Stake | +Consensus engine is Proof of Work | +
Exactly every 10 seconds one block is minted | +Around every 10 minutes one block is mined | +
Total supply is 21,000,000 coin | +Total supply is 21,000,000 coin | +
Always one coin per block | +Initial block reward is 50 coin | +
No halving | +Halving happens every 4 years | +
The halving mechanism in Bitcoin rewards early contributors more significantly. +However, in a Proof-of-Stake blockchain, this mechanism can lead to wealth centralization, +as early validators gain too much power based on their staked coins.
+ +To promote fairer block rewards, Pactus has introduced a simple and straightforward incentive model called the “Flat Reward.” +In this model, the block reward remains constant at one coin per block and does not change over time.
+ + + + + +In Pactus, the coin distribution is linear. This linear distribution is a direct result of the Flat Reward system. +Unlike other blockchains that have a curved distribution, Pactus maintains a consistent coin distribution.
+ + + + + +Data serialization is the process of converting data into a format that can be easily stored or transmitted over a network. +It typically involves encoding data into a sequence of bytes, which can later be decoded to +reconstruct the original data structure. +Pactus has two methods for data serialization: Deterministic serialization and CBOR serialization:
+ +Pactus uses a deterministic serialization for the deterministic data like blocks and transactions. +The serialization format for different types of data is listed in the table below:
+ +Data Type | +Size (bytes) | +Description | +
---|---|---|
uint8 | +1 | +An 8 bits unsigned integer | +
int8 | +1 | +An 8 bits signed integer | +
uint16 | +2 | +A 16 bits unsigned integer | +
int16 | +2 | +A 16 bits signed integer | +
uint32 | +4 | +A 32 bits unsigned integer | +
int32 | +4 | +A 32 bits signed signed integer | +
uint64 | +8 | +A 64 bits unsigned integer | +
int64 | +8 | +A 64 bits signed signed integer | +
VarInt | +Variable | +A compact representation of an unsigned integer. | +
VarByte | +Variable | +A variable length bytes | +
VarString | +Variable | +A variable length string | +
Address | +21 | +21 bytes of address data | +
Hash32 | +32 | +32 bytes of hash data | +
Variable length integer (VarInt) is encoded by 7-bit chunks. The MSB indicates whether there are
+more octets (1) or it is the last one (0). It means 0x00
to 0x7f
encoded in 1 byte, 0x80
to
+0x3fff
encoded in 2 bytes, …
Example:
+ +0x0f -> 0f
+0x1000 -> 8020
+0xffff -> ffff03
+0xffffff -> ffffff07
+
Variable length byte (VarByte) is encoded as a variable length integer (VarInt) containing the
+length of the array followed by the bytes themselves: VarInt(len(bytes)) || bytes
Variable length string (VarString) is encoded as a variable length integer (VarInt) containing the
+length of the string followed by the bytes that represent the string
+itself:VarInt(len(str)) || str
All the internal number representation are in little-endian byte order.
+ +Here is an example of a block header data that encoded using deterministic serialization:
+ + + + +For non-deterministic data, such as networking messages, Pactus uses +“Concise Binary Object Representation” or CBOR. +CBOR is a binary data serialization format that is widely used in various application, +including IoT, web services, security, and automotive, due to its compact representation and efficient parsing.
+ +cbor.me +is an online tool for encoding and decoding CBOR data, offering developers an easy way to test and +validate their CBOR data without having to set up a local environment.
+ +Here is an example of a vote message that encoded using CBOR.
+ + + + + +The State Hash is used to ensure the integrity of the data in the Pactus blockchain. +It serves as a unique identifier or fingerprint of the current state of the blockchain, +allowing all nodes to verify that their data matches that of the other nodes. +This helps to prevent any tampering or inconsistencies in the data, ensuring the accuracy and consistency of the blockchain.
+ +++ +In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node +is labelled with the cryptographic hash of a data block, and every non-leaf node is labelled with +the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure +verification of the contents of large data structures.
+ +From Wikipedia
+
A Hash tree or Merkle tree is a data structure that used by many blockchains to solve this problem: +“How can data be securely stored and verified in a decentralized network?”
+ +By using a Merkle tree, nodes can easily verify that they store the same data +without having to share the entire dataset. Additionally, this helps to prevent any tampering with the data, +as any changes made to the data would cause inconsistencies in the Merkle tree and +can be easily detected by the network.
+ +In Pactus, the Merkle tree is used to verify the state of the blockchain in each block. +The state hash in each block is calculated by taking the hash of two Merkle trees: +the accounts Merkle tree and the validators Merkle tree. +Each leaf in these trees contains the hash of the associated account or validator. +By using the state hash, all nodes in the network can ensure they have the same data stored.
+ + + +Using a Merkle tree to calculate the state of the blockchain can be challenging +because when the number of accounts is large, calculating the root hash can be difficult. +In other words, a simple Merkle tree may not be scalable because calculating all the leaf +and node hashes requires a significant amount of computation.
+ +In Pactus, all accounts and validators have unique and sequential numbers. +This means that each account and validator has a dedicated account number that helps us to +calculate the hash of leaf nodes in the Merkle tree. +By using these account numbers, we can ensure that the position of the leaf nodes in +the Merkle tree is always the same. +This approach allows us to avoid rebuilding the Merkle tree whenever an account or validator’s state changes. +Instead, we can save the previous Merkle tree and recalculate the parent hashes by +fetching neighbor hashes as needed. +This helps to ensure scalability and reduces the computational resources required for recalculating the Merkle tree.
+ + + +In this example, only account 6 has been updated. +By locating the corresponding leaf node in the existing Merkle tree and +traversing the tree towards the root node, we can calculate new root hash. +This approach has a complexity of \(O(log n)\), making it efficient for large numbers of accounts.
+ +A Validator is an entity that participates in the consensus process by sharing its votes. +Validators get rewarded for creating new blocks, and to become a Validator, +they must “bond” or lock up a certain amount of coins as stake. +The amount of stake held by validators determines their power in the consensus.
+ +The Validator structure is 120 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
96 bytes | +Public Key | +
4 bytes | +Number | +
8 bytes | +Stake | +
4 bytes | +Last Bonding Height | +
4 bytes | +Unbonding Height | +
4 bytes | +Last Joined Height | +
The committee is a group of 51 validators responsible for generating new blocks. +Validators in the committee participate in the consensus algorithm by casting votes, +with their voting power determined by their stake. +While in the committee, validators cannot send Bond or Unbond transactions, +meaning their voting power remains the same. +The members of the committee changes randomly over time through Sortition transactions. +Each block can contain zero or more Sortition transactions.
+ +These rules are applied when committing sortition transactions:
+ +Proposer selection within the committee operates on a deterministic, clockwise rotation system. +If a validator is unable to propose, for any reason, it stays within the committee, but +the proposer’s role shifts to the next validator in the committee.
+ + + +When a new validator joins the committee, they take a position before the current proposer. +After the addition of a new validator, the committee adjusts to maintain the total number of validators at 51. +This is achieved by removing the oldest validator from the committee, +i.e., the one that has been in the committee for the longest time.
+ + + +For an adversary to take control of the committee, they would need to control more than ⅔ of the stake within the committee. +To assess the security of the committee, let’s assume all validators in the committee have the same voting power. +In this case, an adversary would need to control more than ⅔ of the validators in the committee.
+ +Now, let’s imagine an adversary holds 10% of the total stake. +As a result, one of their validators can enter the committee every 10 blocks. +In the first 10 blocks, one of the adversary’s validators enters the committee. +In the next 10 blocks, another validator enters the committee, giving the adversary two validators within the committee. +In the subsequent 10 blocks, another validator enters, but at the same time, the first validator leaves the committee. +Therefore, an adversary with 10 10% of the total stake can have, on average, two validators in a committee of 51 validators.
+ +Using the Poisson distribution, +we can estimate the probability of an adversary controlling ⅔ of the committee:
+ +Adversarial Stake | +Committee size | +⅔+ of committee | +Adversarial committee members | +Probability of controlling ⅔+ | +
---|---|---|---|---|
15% | +21 | +15 | +3 | +\(5.46 \times 10^{-07}\) | +
15% | +55 | +35 | +7 | +\(3.34 \times 10^{-14}\) | +
15% | +99 | +67 | +14 | +\(1.41 \times 10^{-24}\) | +
10% | +21 | +15 | +2 | +\(3.39 \times 10^{-09}\) | +
10% | +55 | +35 | +5 | +\(1.90 \times 10^{-18}\) | +
10% | +99 | +67 | +9 | +\(2.91 \times 10^{-35}\) | +
5% | +21 | +15 | +1 | +\(2.81 \times 10^{-13}\) | +
5% | +55 | +35 | +2 | +\(4.50 \times 10^{-31}\) | +
5% | +99 | +67 | +4 | +\(1.09 \times 10^{-56}\) | +
The height at which the validator joined the committee is recorded as the “Last Joined Height” field in +the validator structure. +Once a validator enters the committee, this field is set to the current height it +evaluated the sortition proof.
+ +A validator within the committee can run the sortition algorithm. +If they generate a valid sortition transaction, the height of their entry into the committee is set +to the current block height, allowing them to stay in the committee for a longer period.
+ +Consensus parameters are a set of configurable settings that determine how the Pactus blockchain operates. +These parameters are agreed upon by all validators in the network, +ensuring that validators behave in the same way and that the network operates consistently.
+ +Here is the list of the consensus parameters:
+ +Proof of Stake is a way to secure a blockchain through requesting users to stake some amount of their coins. +These stakeholders, called validators, are responsible to collect, validate and add transactions to the blockchain. +The validators will be rewarded with native coins.
+ +Unlike Proof of Work, which is based on competition, Proof of Stake is based on collaboration. +Validators work together to manage the expansion of the blockchain. +A Proof of Stake blockchain becomes more decentralized and secure as more validators participate in it.
+ +To understand how Proof of Stake works, imagine a community bank without any centralized authority. +In this bank, users decide to run it together. +Some of these users volunteer to collect, validate, and record transactions, +ensuring that everything runs smoothly.
+ +These volunteers, known as validators, must temporarily lock or freeze some of their money as a stake. +This stake can’t be transferred or used. +The more money a validator stakes, the more influence they have in the system.
+ +From time to time, one of the validators is chosen by the others to collect all the recent transactions, +bundle them together, and send a copy to the other validators. +If a supermajority of the validators agree with the proposed bundle by signing it, +the bundle will be committed to the bank’s ledger.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk harming the bank’s reputation and the value of their own stakes as well.
+ +In Proof of Stake, if the number of validators increases, +the voting time will also increase, and this can lead to an inefficient consensus mechanism. +In our community bank example, running the bank becomes more difficult as the number of validators increases.
+ +To solve this problem, some blockchains use the concept of “delegators”. +In Delegated Proof of Stake, users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions and creating blocks. +The number of delegates is limited to ensure accountability and efficiency in the validation process.
+ + + +The delegation model puts a lot of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +Pactus introduced a mechanism that doesn’t rely on delegation, we call it Solid State Proof of Stake. +It utilizes a dynamic committee of validators +that are responsible for creating new blocks. +The size of the committee is fixed, but the members of the committee are randomly changed. +On the other hand, the number of validators outside the committee is unlimited, allowing anyone to +become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm +by generating a random number between zero and the total staked coins. +If the number is less than the validator’s stake, they can enter the committee and replaces the oldest committee member.
+ + + +The chance of entering the committee depends on the validator’s stake and luck. +But on average, one validator should enter the committee in each block.
+ +Pactus consensus algorithm is a state machine +replication with Byzantine fault tolerance. +The Pactus consensus algorithm starts with the block creation phase. +In this phase one validator acts as the proposer. The proposer collects all the transactions, +creates a block, and proposes it to other validators.
+ +When a proposed block is seen by other validators, they validate the block and +cast their vote for the proposed block, moving to the “prepare” state.
+ +If more than two-thirds (⅔) of the total stakes cast their votes, the proposed block becomes prepared, +and validators move to the “precommit” state.
+ +If, once again, more than two-thirds (⅔) of the total stakes cast their vote for the prepared block, +the block is committed, and the next proposer is ready to propose a new block. This cycle repeats every 10 seconds.
+ +If a proposer fails to propose in any round, other validators start the “change proposer” phase to +decide to change the proposer for this round.
+ + + +There are \(R = 3f+1\) validators. where \(f\) is the maximum +number of validators that may be faulty or byzantine. For example, if there is one faulty validator, +the resiliency of the algorithm is optimal if we have at least \(3\) non-faulty +validators. So the minimum number of validators should be \(3+1=4\).
+ +We denote a message as \(\langle m \rangle\) tuple and a signed message by node \(i\) as +\(\langle m \rangle_{\sigma_i}\).
+ +Pactus consensus algorithms has two phases: Block creation phase and change proposer phase.
+ +The block creation phase in Pactus consensus algorithm includes these three steps1: +Propose, Prepare and Precommit. +The protocol proceeds in rounds \(r = 0, 1, 2, \ldots\).
+ +In each round \(r\), one validator is the proposer and the others act as validators. +The proposer \(p\) collects transactions and creates a proposal block \(B\). It signs and +broadcasts a proposal message with the proposed block piggybacked to all the validators. +Propose message has this form:
+ +\[\langle \langle \text{PROPOSE},h,r \rangle_{\sigma_p}, B \rangle\] + +where:
+ +If validator \(i\) accepts the proposal, it enters prepare step and signs and +broadcasts prepare message to all other validators. Otherwise, it does nothing. +The prepare message has this form:
+ +\[\langle \text{PREPARE},h,r,d \rangle_{\sigma_i}\] + +where:
+ +If validator \(i\) received \(2f+1\) prepare messages from other +validators (including its own), it becomes prepared and enters to precommit step.
+ +In precommit step, validator \(i\) signs and broadcasts precommit message to +the other validators. +The precommit message has this form:
+ +\[\langle \text{PRECOMMIT},h,r,d \rangle_{\sigma_i}\] + +Each validator executes and commits block \(b\) after receiving +\(2f+1\) precommit messages (including its own) and becomes committed.
+ +Each validator that receives a valid proposal and with \(2f+1\) precommit messages from other +validators (including its own), can create a block-announce messages and broadcasts it to the network. +The block-announce message has this form:
+ +\[\langle \text{BLOCK-ANNOUNCE} ,h ,r ,B, C \rangle\] + +where:
+ +Validators can move to the next height and clear the message logs after receiving valid +block-announce message, even if their timer has expired.
+ +The picture below shows the operation of the algorithm in the normal case. validator 1 is the +proposer and validator 4 is faulty.
+ + + +The change-proposer provides liveness by allowing the system to make progress when the proposer fails. +The change-proposer phase is triggered by timeouts that +prevent validators from waiting indefinitely for the proposal to execute.
+ +If the timer of a validator expires in round \(r\), the validator starts a change-proposer phase. +The change-proposer phase is an Asynchronous Byzantine Binary Agreement (ABBA) 2 that is biased toward zero (No). +It means that during this phase, even if they don’t have the proposal, honest validators may decide to vote zero +if they obtain a valid quorum Certificate for the prepare step.
+ +If a supermajority of the validators decide to change the proposer, they move to round r+1r+1. However, +if they decide not to change the proposer, they will return to the prepare state and, +since a supermajority of the validators attested to a valid proposal, they can commit the proposed block.
+ +The change proposer phase in Pactus consensus algorithm includes these three steps: +Pre-vote, Main-vote and Decide +The protocol proceeds in rounds \(r_{cp} = 0, 1, 2, \ldots\).
+ +In Pre-vote step each validator casts a pre-vote for a value \(b \in \{0, 1\}\) +and broadcasts pre-vote message to the network. +The pre-vote message has this form:
+ +\[\langle\langle \text{CP:PRE-VOTE},h,r,r_{cp},b \rangle_{\sigma_i}, justification\rangle\] + +The first round is a special round and each validator starts with an initial value. +If the validator’s timer has expired in the prepare step, its initial value is zero, +and if the validator’s timer has expired in the precommit step, its initial value is one.
+ +\[b = \begin{cases} +1 & \text{if timer expired in prepare step,} \\ +0 & \text{if timer expired in precommit step.} +\end{cases}\] + +In the next rounds, each validator select \(2f+1\) properly justified main-votes from round \(r − 1\) and
+ +\[b = \begin{cases} +0 & \text{if there is a main-vote for 0,} \\ +1 & \text{if there is a main-vote for 1,} \\ +0 (biased) & \text{if all main-votes are abstain.} +\end{cases}\] + +These pre-votes must be justified with a appropriate justification. +For the first round, if the validator’s timer has expired in the prepare step, the justification is \(nil\) , +and if the validator’s timer expired in the precommit step, +the justification is the proper quorum certificate for the prepare step at round \(r\).
+ +In the next rounds, a pre-vote for \(b\) may be justified in two ways:
+ +After collecting \(2f+1\) valid and justified pre-votes, each validator casts a main-vote \(v \in \{0, 1, abstain\}\) +and broadcasts main-vote message to the network. +The main-vote message has this form:
+ +\[\langle\langle \text{CP:MAIN-VOTE},h,r,r_{cp},v \rangle_{\sigma_i}, justification\rangle\] + +The main-vote value \(v\) determine as below:
+ +\[v = \begin{cases} +0 & \text{if there are 2f+1 pre-vote for 0,} \\ +1 & \text{if there are 2f+1 pre-vote for 1,} \\ +abstain & \text{if there are pre-votes for 0 and 1.} +\end{cases}\] + +These main-votes must be justified with a appropriate justification. +A main-vote for \(v\) may be justified in two ways:
+ +After collecting \(2f+1\) valid and justified main-votes, each validator examines these votes. If all +votes are for a value \(b \in \{0, 1\}\), then the validator decides \(b\), but continues to +participate in the protocol for one more round. Otherwise, the validator proceeds to the next round \(r_{cp}+1\).
+ +Pactus consensus protocl doesn’t have any lcoking mechanism or +checkpointing and there will at most one valid proposla per round. +This ensures that each round can begin with a new proposal.
+ +Protocol | +Normal case | +Faulty case |
+ ||
---|---|---|---|---|
Steps | +Complexity | +Locking | +Checkpointing | +|
PBFT | +3 | +$$O(n^2)$$ | +No | +Yes | +
Tendermint | +3 | +$$O(n^2)$$ | +Yes | +No | +
HotStuff | +4 | +$$O(n)$$ | +Yes | +No | +
Pactus | +3 | +$$O(n^2)$$ | +No | +No | +
References:
+ + + +The sortition algorithm is an important part of the Pactus blockchain, responsible for the fair, transparent +and random selection of validators to join the committee. +It utilizes a Verifiable Random Function, or VRF for short, to generate a verifiable random number.
+ +The generated random number should be in the range of 0 to the total staked coins. +If validators can prove that their generated number is less than their stake, +they can send the sortition transaction. +Once a sortition transaction is included in a block, the validator will join the committee, +and the oldest validator in the committee will leave it.
+ +Verifiable Random Function is a pseudo-random function that the owner of key \(s\) can evaluate \(v = f_s(x)\) and also provides +\(proof_{x}\) efficiently proving that \(v\) is correct. We call such a mathematical +object a verifiable pseudo-random function, VRF for brevity 1.
+ +Pactus uses the BLS signature scheme as the source of VRF. +Since BLS signatures are unique, +the hash of a BLS signature can be used to produce a secure and verifiable random number.
+ +The VRF takes three parameters:
+ +Once the VRF is executed, it produces an index with a proof. +The index is a number between zero and the total staked coins, and the proof allows other validators to verify the correctness +of the generated index.
+ +The pseudocode below demonstrates the evaluation of the VRF for the sortition algorithm:
+ +\[\begin{align*} +& \textbf{function} \ VRF(sk, seed, total\_stake) \\ +& \qquad pk \gets P_{BLS}(sk) \\ +& \qquad proof \gets S_{BLS}(sk, seed \| pk) \\ +& \qquad rnd \gets H(proof) \\ +& \qquad index \gets \frac{(rnd \times total\_stake)}{2^{256}} \\ +& \qquad \\ +& \qquad \textbf{return} \ index, proof \\ +& \textbf{end function} +\end{align*}\] + +where:
+ +To verify a sortition proof, both the validator’s public key and stake are required:
+ +\[\begin{align*} +& \textbf{function} \ verifyVRF(pk, seed, proof, stake, total\_stake) \\ +& \qquad \textbf{if} \ V_{BLS}(pk, seed \| pk, proof) = True \ \textbf{then} \\ +& \qquad \qquad rnd \gets H(proof) \\ +& \qquad \qquad index \gets \frac{(rnd \times total\_stake)}{2^{256}} \\ +& \qquad \\ +& \qquad \qquad \textbf{return} \ index \leqslant stake \\ +& \qquad \textbf{else} \\ +& \qquad \qquad \textbf{return} \ False \\ +& \qquad \textbf{end if} \\ +& \textbf{end function} +\end{align*}\] + +where:
+ +There is no need to send \(index\) alongside \(proof\) because the +result should be less than the validator’s stake, and the validator’s stake is known at each block.
+ +The sortition algorithm relies on a random and publicly verifiable seed that cannot be manipulated by adversaries. +Otherwise, adversaries may select a seed that favors the selection of corrupt users.
+ +To prevent this, the BLS signature scheme is used to generate the sortition seed. +Since BLS signatures are unique and deterministic, adversaries cannot generate more than one valid signature per block. +In each block, the block proposer generates a new sortition seed based on the previous seed using the following function:
+ +\[\begin{align*} +& \textbf{function} \ generateSeed(sk, prev\_seed) \\ +& \qquad \textbf{return} \ S_{BLS}(sk, H(prev\_seed)) \\ +& \textbf{end function} +\end{align*}\] + +Since the proposer’s public key is known, the seed for the next block can be easily verified. +If the seed is invalid, the proposed block will be rejected. +The verification function is as follows:
+ +\[\begin{align*} +& \textbf{function} \ verifySeed(pk, prev\_seed, seed) \\ +& \qquad \textbf{return} \ V_{BLS}(pk, H(prev\_seed), seed) \\ +& \textbf{end function} +\end{align*}\] + +The sortition seed for the genesis block set to 0.
+ +The Sortition probability refers to the expected number of validators that may join the committee in each block, +assuming all validators are actively online and executing the sortition algorithm.
+ +The probability of a validator \(i\) being selected depends on their stake relative to the total stake in the system:
+ +\[p_i=\frac{S_i}{S_t}\] + +where:
+ +Therefore, the expected number of validators joining the committee at each block can be represented as:
+ +\[P=\sum_{i=1}^{n}{p_i}=\sum_{i=1}^{n}{\frac{S_i}{S_t}}=\frac{S_1+S_2+\ldots+S_n}{S_t}\] + +where \(n\) is the total number of validators. We know that \(S_t={S_1+S_2+\ldots+S_n}\). Therefore we will have:
+ +\[P=\frac{S_t}{S_t}=1\] + +Thus, on average, we expect one validator to join the committee at each block. +In practice, the actual number of validators joining the committee in each block +may differ due to the randomness in the sortition algorithm, or the possibility of some validators being offline.
+ +The total staked coin in each block is calculated by summing the staked coins of all active validators. +An active validator is a validator that has not yet unbonded.
+ +The height at which the validator joined the committee is recorded as the “Last Joined Height” field in +the validator structure. +The validator with the lowest “Last Joined Height” is considered the oldest.
+ +Developing distributed and concurrent systems is a complex task that requires careful attention to the details. +Testing such systems is challenging because it’s difficult to simulate all possible states, +including those that can happen due to system failures, network latency, and other factors. +This makes it hard to ensure that the system behaves correctly in all circumstances.
+ +Therefore it’s essential to have a proactive approach that involves modeling the system’s behavior in a formal way. +Such an approach can help identify potential issues before they occur, saving time and preventing costly flaws.
+ +TLA+ is a formal specification language developed by +Leslie Lamport based on the idea of +specifying systems using simple mathematics. +It is used for designing, modelling, documentation, and verification of programs, especially concurrent and +distributed systems. +TLA+ and its tools are useful for eliminating fundamental design errors, which are hard to find and +expensive to correct in code.
+ +To know more about TLA+, check The TLA+ Home Page.
+ +Pactus consensus specification +has written in TLA+ format. It includes all invariants that can be held +in every state of every execution that the protocol allows. The TLA+ specification is compiled into +PDF file.
+ +By defining some invariants we can ensure the safety of the consensus +protocol in any possible and +distinct state, and therefore we have the informal safety proof of the Pactus consensus protocol using TLA+.
+ +Checking the liveness is not easy, but with defining some constraints, we have the informal proof of +liveness of Pactus consensus protocol using TLA+.
+ +هنا يمكنك العثور على الوثائق التقنية لمشروع بكتوس.
+ +Ethereum friendly blockchains keep storage in a separate key/value database per request. This has +some drawbacks:
+ +Here we discuss how we can address the above issues by dedicating a separate file as Storage +File per smart contract. In this scenario, users should purchase the storage file with required +capacity before deploying the smart contract. Once the purchase is done, a separate empty file will +be created and dedicated for the user. The size of the file is the same as the purchase size. For +example users can purchase 10 MB or 120 MB of storage files depending on their need and renew them +yearly.
+ +Each storage file has three parts: Header, ByteCodes and contract storage.
+ + + +The Header of the storage file keeps some meta data like storage file index, last payment time, +total storage size, etc. In the ByteCodes section the byte codes of the smart contract will be saved +and in the storage section, the actual storage of the smart contract will be stored.
+ +Smart contracts can only change data in storage sections. To achieve that the smart contract +executer (virtual machine) should introduce these APIs:
+ +/// This API requests the host to read the slice of `data` from the storage file
+/// at the given `offset`.
+fn read(&self, offset: u32, data: &mut [u8]) -> Result<(), HostError>;
+
+/// This API requests the host to write the slice of `data` into the storage file
+/// at the given `offset`
+fn write(&self, offset: u32, data: &[u8]) -> Result<(), HostError>;
+
+
These APIs are similar to SLoad
and SStore
opcodes in Ethereum Virtual Machine (EVM). But
+instead of key and value, they accept offset and data parameters.
In order to allocate storage space safely and efficiently user can use these predefined methods:
+ +/// Allocates storage space with the specific `length` and returns the
+/// offset of allocated space in the storage file.
+pub fn allocate(&self, length: u32) -> Result<Offset, Error>;
+
+/// Deallocates the storage space at the specific `offset` and `length`
+pub fn deallocate(&self, offset: Offset, length: u32) -> Result<(), Error>;
+
There is a fixed stack with 32 elements at the beginning of the storage . The first item in this +stack is reserved and used for managing deallocated storage spaces. Users can use other stack items +to keep the offset of the allocated spaces for the smart contract variables.
+ + + +Usually in smart contracts developers are interested in data collections like Search Trees or Hash +Tables to look up values by the associated keys. Most programming languages come up with some +builtin collections, however we can’t use them in smart contracts because they use RAM that is +inconsistent. However we can have storage equivalent of these data collections that instead of +dealing with memory they are dealing with the storage file. You can naively consider storage as +dedicated consistent memory for the smart contract.
+ +Right now these data collection is available to use inside the smart contract: StorageVector
,
+StorageString
, StorageLinkedList
, StorageBST
and StorageHasTable
.
To make sure all the nodes have the same state we need to calculate the hash of all storage files. +Merkle tree can help us to easily calculate the root hash very fast. We need two Merkle trees, one +for calculating the root hash of each storage file and the second for calculating the root hash of +all storage files.
+ +We can divide each file into small chunks of data and calculate the hash of each chunk once. Since +we know exactly which chunk has changed after executing the smart, contract we can easily +reconstruct the tree and calculate the merkle root again.
+ +Each file has a unique index. With using that index we can make sure that the position of the leaf +nodes in the Merkle tree is always the same. The same technique we used for calculating the +state hash.
+ + + +As an example we have implemented the ERC20 smart contract based on this idea. The implementation +can be found here
+ +One of the consequences of Storage as File is that testing smart contracts becomes easier. What we +need is only to mock the storage file.
+ +Bond transaction is used to bond stake to a validator. +If the validator does not exist, it will be created. +Once a bond transaction committed, the validator cannot participate in the +sortition algorithm for 1 hour. +This is called the “bond interval” and is defined in the +consensus parameter.
+ +The bond transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
96 bytes (optional) | +Public key | +
8 bytes | +Amount | +
Transaction fees in the Pactus blockchain are calculated using a percentage-based fee model. +The fee is a percentage of the transferred amount, within a minimum and maximum range. +The percentage, minimum fee, and maximum fee parameters are part of the blockchain +consensus parameters.
+ +The formula to calculate the transaction fee is as follows:
+ + + +\[\begin{align*} +fee = amount \times percentage \\ +\\ +fee = +\begin{cases} + & fee_{min} & \textbf{ if } \ fee < fee_{min} \\ + & \\ + & fee_{max} & \textbf{ if } \ fee > fee_{max} \\ + & \\ + & fee & \textbf{otherwise} + \end{cases} +\end{align*}\] + +Currently, the fee fraction or percentage is set to 0.01%, the minimum fee is set to 0.000,001 coin, +and the maximum fee is set to 0.001 coin.
+ +Transactions in Pactus consists the following fields:
+ +Size | +Field | +
---|---|
1 byte | +Version | +
4 bytes | +Lock Time | +
8 bytes | +Fee | +
Variant | +Memo | +
1 byte | +Payload Type | +
Variant | +Payload Data | +
48 bytes | +Signature | +
96 bytes | +Public Key | +
The payload type field determines the format of the payload data field in the transaction. +Different payload types have different formats for the payload data. +The following are the supported transactions in Pactus blockchain:
+ +The Transaction ID is a unique identifier for a transaction on the blockchain. +It is generated by taking the hash of the transaction data without including the public key and signature fields.
+ +Sortition transaction is used to enter a validator +in the committee. +By committing a sortition transaction, the validator will enter the committee. +Sortition transactions are valid for 7 blocks, which is defined as “sortition interval” in the +consensus parameters.
+ +The sortition transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Address | +
48 bytes | +Sortition Proof | +
Validators do not need to pay a fee for sortition transactions, and the fee should be set to zero.
+ +Transfer transaction is used to transfer coins between the accounts. +If the receiver account does not exist, it will be created.
+ +The transfer transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
8 bytes | +Amount | +
The reward transaction is the first transaction in each block. There is only one reward transaction +per block, and it has the same format as a transfer transaction, but with zero fees and no signature.
+ +The sender address is the Treasury address, +and the receiver address is defined by the block proposer. +The amount of the reward transaction should be equal to the +block reward plus transaction fees. +This amount will go to the proposer account as a block reward. +Therefore, in each block, one coin from the +Treasury account transfers to +the proposer account as a block reward.
+ +Unbond transaction is used to unbond a validator. +An unbonded validator cannot participate in the sortition algorithm anymore, and after 21 days, the stake can be withdrawn. +This is called the “unbond interval” and is defined in the consensus parameter.
+ +The unbond transaction has a payload consists the following field:
+ +Size | +Field | +
---|---|
21 bytes | +Validator address | +
Withdraw transaction is used to withdraw the staked coins from an unbonded +validator
+ +The withdraw transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
8 bytes | +Amount | +
هنا، يمكنك العثور على بعض التوجيهات لمساعدتك على استخدام والتفاعل مع بلوكشين بكتوس.
+ +Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). +This tutorial will guide you through the steps to run Pactus in CLI mode, suitable for advanced users.
+ +Before proceeding with the steps below, ensure that you have the following:
+ +To get started, download and extract the Pactus CLI file from +here.
+ +Now you need to create a wallet and setup a working directory for your node. +A working directory is a place where you save blockchain data and wallets. +Open the Terminal and run the following command:
+ + +./pactus-daemon init -w ~/pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus
.
./pactus-daemon init -w ~/pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus
.
pactus-daemon.exe init -w c:\pactus --testnet
+
This command creates your wallet and setup the working working directory at c:\pactus
.
Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future +in case your computer is lost, damaged, or stolen.
+ +The working directory contains:
+ +Feel free to take a look at these files.
+ +Now you can start the node and sync with the network. Run the following command in the Terminal:
+ + +./pactus-daemon start -w ~/pactus
+
./pactus-daemon start -w ~/pactus
+
pactus-daemon.exe start -w c:\pactus
+
When the Pactus node starts running, it begins syncing with the network. +This process may take some time, as your node needs to download and verify the entire blockchain history. +Please be patient while your node syncs.
+ +To become a validator and participate in the +consensus algorithm to earn rewards, you first need to +stake some coins. In the next +tutorial, +we will explain how to send a Bond transaction to become a validator.
+ +By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +Docker is a tool that simplifies the process of creating, deploying, and running applications using containers. +With containers, developers can bundle all the necessary parts of an application, including libraries and dependencies, +and deploy them as a single package.
+ +In this document, we will guide you on how to run Pactus using Docker, step by step.
+ +The only thing you need is installing docker in your machine. +If you are using Windows please make sure you have installed WSL.
+ +The Pactus docker images are available at Docker Hub. +You can pull the latest image with this command:
+ +docker pull pactus/pactus
+
Now you need to create a wallet and setup a working directory for your node. +A working directory is a place where you save blockchain data and wallets. +Open the Terminal and run the following command:
+ + +docker run -it --rm -v ~/pactus/testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus/testnet
.
docker run -it --rm -v ~/pactus/testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus/testnet
.
docker run -it --rm -v c:\pactus\testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at c:\pactus\testnet
.
Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future +in case your computer is lost, damaged, or stolen.
+ +The working directory contains:
+ +Feel free to take a look at these files.
+ +Now you can start the node and sync with the network. Run the following command in the Terminal:
+ + +docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
docker run -it -v c:\pactus\testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
To run pactus-testnet in background just add a -d flag in the command.
+ +Hint: Remember to pass in your wallet passphrase as well with -p flag after /pactus.
+ +docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 -d --name pactus-testnet pactus/pactus start -w /pactus -p {YOUR_PASSPHRASE}
+
docker run -it -v c:\pactus\testnet:/pactus -p 8080:8080 -p 21777:21777 -d --name pactus-testnet pactus/pactus start -w /pactus -p {YOUR_PASSPHRASE}
+
You can stop/start docker:
+ +docker stop pactus-testnet
+docker start pactus-testnet
+
Or check the logs:
+ +docker logs pactus-testnet --tail 1000 -f
+
By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). +This tutorial will guide you through the steps to run Pactus in GUI mode, suitable for beginner to advanced users.
+ +Before proceeding with the steps below, ensure that you have the following:
+ +Download the Pactus GUI installer or archived file from +here.
+ +Windows and macOS users may encounter a warning message stating that Pactus is an untrusted application. +This is because Pactus does not have a +code signing certificate.
+ + + +A code certificate is a digital signature that verifies the identity and authenticity of the software publisher. +However, obtaining a code certificate is complex and expensive process, and requires registering a company and +passing Know Your Customer (KYC) checks.
+ +As Pactus is an open-source and community-based application, we don’t have a code certificate yet. +Therefore, you can safely ignore the warning message and proceed with installing Pactus.
+ +To install Pactus GUI, simply follow the on-screen instructions provided by the installer. +The process is straightforward and similar to installing any other application on your computer.
+ + + +When you run Pactus for the first time, a wizard dialog will appear to guide you through the wallet creation and +initialization process. This process consists of several steps:
+ +On the first page, you will ask you how you want to create your wallet. +Select the option to “Create a new wallet from scratch” and proceed to the next page.
+ + + +The next page will display your wallet seed phrase, which consists of 12 words. +It is essential to securely back up this seed phrase, as it is required for wallet recovery +in case your computer is lost, damaged, or stolen.
+ + + +Warning: Keep your wallet seed phrase private and secure. +If someone else gains access to your seed phrase, they can control your wallet and funds.
+ +In this step, you will be asked to confirm your seed phrase. +Input the 12 words you received in the previous step into the dialog. +If the seed phrase is entered correctly, you will be able to proceed to the next page.
+ + + +On this page, you will be asked to set a password for your wallet. +Enter a strong password in the first dialog box and confirm it in the second one. +This password will be used to encrypt your wallet and protect it from unauthorized access.
+ + + +Note: Choose a strong password and keep it safe. +If you forget or lose your password, you will need your seed phrase to regain access to your wallet.
+ +Each node in the Pactus blockchain can run up to 32 validators, and each validator can stake up to +1000 coins. Here, you can define how many validators you want to create for your node. +Select the number of validators based on the amount of coins you want to stake.
+ + + +If you want to stake more than 32,000 coins, you need to set up a new node.
+ +The last page of the initialization process shows the node information, such as the working directory, validator address, +and reward address. Review this information and click “Close” to complete the initialization process.
+ + + +Upon closing the wizard dialog, your Pactus node will start running. You are now ready to use Pactus in GUI mode.
+ +After completing the initialization process, you are ready to run the Pactus node. +Running a Pactus node allows you to synchronize with the network, enabling you to view and manage your wallet and +sending transactions.
+ +When the Pactus node starts running, it begins syncing with the network. This process may take some time, +as your node needs to download and verify the entire blockchain history. +Please be patient while your node syncs.
+ + + +You can check the “Default Wallet” tab to access your wallet information. Please note that the displayed +information may not be accurate until the syncing process is complete.
+ + + +In the “Default Wallet” tab, you can view your account details, including your balance and +address information such as the validator and reward addresses. +Your computer acts as a node and is recognized by the validator address in the Pactus network. +The reward address is the account address where you collect the +rewards earned by participating in +the consensus algorithm and proposing new blocks.
+ +To become a validator and participate in the +consensus algorithm to earn rewards, you first need to +stake some coins. In the next +tutorial, +we will explain how to send a Bond transaction to become a validator.
+ +By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +The Pactus Blockchain offers a Graphical User Interface (GUI) that comes with a built-in wallet to create, +sign and broadcast transactions. +This tutorial aims to guide you step-by-step on how to use the GUI application to send transactions to the Pactus blockchain. +Whether you are a beginner or an advanced user, this tutorial is suitable for you.
+ +Before we begin, you’ll need to run the Pactus GUI application and ensure that it is synced with the network. +You can find detailed instructions on how to do this in the following tutorial.
+ +To send a transfer transaction, click on the “Transaction” menu and +select “Transfer.” +This will bring up a new window where you can select the +account address from which you wish to send the transfer, +as well as the recipient’s account address and the amount you wish to send.
+ +After reviewing the transaction details and ensuring that they are correct, +click on the “Send” button to sign and broadcast the transaction to the Pactus blockchain.
+ + + +It’s important to note that the transaction fee +will be calculated based on the amount you’re sending.
+ +To send a bond transaction, navigate to the “Transaction” menu +and select “Bond.” +A new window will appear where you can select the account address from which you wish to send the bond transaction, +as well as the validator address of the recipient and +the amount you wish to stake.
+ +If the validator address is not already registered on the Pactus blockchain, you will need to provide the +validator’s public key as the first staking transaction will create the validator on the Pactus blockchain. +To obtain the public key, you can right-click on the validator’s address in your wallet +and select “Details.”
+ + + +It’s important to note that the transaction fee +will be calculated based on the amount you’re sending.
+ + +The Pactus Blockchain provides a wallet application that allows users to interact with the Pactus blockchain +without the need to run a node. +This is ideal for users who do not wish to operate a node but still want to create a personal wallet to manage their funds. +This tutorial will guide you step-by-step on how to use the wallet application.
+ +To get started, download and extract the Pactus CLI file from +here.
+ +In this section, we will explore various wallet commands that help you create, manage, +and recover your Pactus wallet.
+ +First, you need to create a wallet. To create a new wallet, run the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 create
+
This command creates a new wallet and store it in the ~/pactus/wallets/wallet_1
.
./pactus-wallet ~/pactus/wallets/wallet_1 create
+
This command creates a new wallet and store it in the ~/pactus/wallets/wallet_1
.
pactus-wallet.exe c:\pactus\wallets\wallet_1 create --testnet
+
This command creates a new wallet and save it in the c:\pactus\wallets\wallet_1 directory.
+This command creates a new wallet and store it in the c:\pactus\wallets\wallet_1
.
Don’t forget to back up your wallet seed, as it allows you to recover your wallet if you lose it.
+ +You can change the wallet password by tunning this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 password
+
./pactus-wallet ~/pactus/wallets/wallet_1 password
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 password
+
If you forget your password, you can still recover your wallet using the wallet seed.
+ +You can obtain the wallet seed by running this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 seed
+
./pactus-wallet ~/pactus/wallets/wallet_1 seed
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 seed
+
The wallet seed is encrypted within your wallet, and +you’ll need to enter the wallet password to access it.
+ +If you lose your wallet, you can recover it by running this command:
+ + +./pactus-wallet ~/pactus/wallets/recovered_wallet recover
+
./pactus-wallet ~/pactus/wallets/recovered_wallet recover
+
pactus-wallet.exe c:\pactus\wallets\recovered_wallet recover
+
Please note that if you lose your seed, there is no way to recover your wallet.
+ +In this section, we’ll cover address commands that help you manage your wallet addresses.
+ +You can create a new address by running this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address new
+
./pactus-wallet ~/pactus/wallets/wallet_1 address new
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address new
+
You can also assign a label to your address to better organize your address book.
+ +To view the list of wallet addresses, use this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address all
+
./pactus-wallet ~/pactus/wallets/wallet_1 address all
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address all
+
To obtain the public key for a specific address, run this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address pub <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve its public key.
You can get the public key of your address by this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address pub <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve its private key.
+Keep your private key secure. If someone gains access to your private key,
+they will have full control over that address.
In this section, we’ll cover transaction commands that help you create, sign, and +broadcast transactions on the Pactus Blockchain. +You’ll need to provide the password to sign the transaction. +Please note that once a transaction is broadcasted, it cannot be reversed.
+ +To create, sign, and broadcast a +Transfer transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx transfer <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx transfer <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx transfer <FROM> <TO> <AMOUNT>
+
In this command, <FROM>
should be one of the addresses in your wallet as the sender address,
+and <TO>
is the receiver address.
To create, sign, and broadcast a +Bond transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx bond <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx bond <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx bond <FROM> <TO> <AMOUNT>
+
In this command, <FROM>
should be one of the addresses in your wallet as the sender address,
+and <TO>
is the receiver validator address.
If the validator associated with this address does not exist yet, +you need to provide the public key to create it:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx bond --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
Replace <PUBLIC_KEY>
with the validator’s public key,
+which is the public key of the <TO>
address.
To create, sign, and broadcast a +Unbond transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <ADDRESS>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx unbond <ADDRESS>
+
In this command, <ADDRESS>
is the address of the validator that you want to unbond.
To create, sign, and broadcast a +Withdraw transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx withdraw <FROM> <TO> <AMOUNT>
+
By joining the Pactus community, you become a part of a global network of innovators, thinkers, and doers who are all united by a shared vision of building a better future with blockchain technology. Whether you’re a developer, entrepreneur, investor, or simply a blockchain enthusiast, there’s a place for you here at Pactus.
So, let’s come together and make a difference!
As an open-source platform, Pactus blockchain empowers from its community. +Whether you’re a developer, designer, or enthusiast, your contributions can make a meaningful impact.
+ +There are several ways to support the Pactus project:
+ +One of the most effective ways to contribute to the Pactus network is by running a node. +A “node” is a software program that downloads a copy of the Pactus blockchain and +ensure the network keeps running safe and decentralized.
+ +These guides can help you to run and configure your node:
+ +Validators play an important role in the Pactus blockchain by verifying transactions and +adding them to the blockchain. +By becoming a validator, you can earn rewards +for contributing to the network’s security and decentralization.
+ +To become a validator, you will need to stake a certain amount of Pactus coins. +These guides can help you to send a Bond transaction and stake some coins:
+ + + +Pactus is an open-source project that welcomes and encourages contributions from developers. +By contributing to the project, you can help improve the Pactus platform and create new features that +benefit the entire community.
+ +You can check our Contributing page +for more information on how to get involved and contribute to the project.
+ +Another way to contribute to the Pactus project is by translating this website into other languages and +improving its content.
+ +The more people who know about Pactus, the more opportunities there are for collaboration and growth. +Share our project on social media, attend Pactus events, or simply tell your friends and colleagues about us.
+ +Together, Let’s build a better future for blockchain technology.
+ + +On this page you can find how to download and get the latest version of the Pactus software.
+ +Project Pactus is distributed as open source software, so the preferred way for installing it is to clone the source code from the GitHub repository and compile the source code.
+ +Instructions for compiling Pactus is provided on the install page.
+ +You can also download the latest stable releases of Pactus. These releases are updated automatically when a new version is released in GitHub repository.
+ +You can run Pactus in a graphical user interface (GUI) mode and it is suitable for both beginners and advanced users.
+ + + +File name | +Kind | +OS | +Arch | +
---|---|---|---|
pactus-gui_0.16.1_darwin_amd64.tar.gz | +Archive | +macOS | +64-bit | +
pactus-gui_0.16.1_darwin_amd64.dmg | +DMG | +macOS | +64-bit | +
pactus-gui_0.16.1_linux_amd64.tar.gz | +Archive | +Linux | +64-bit | +
pactus-gui_0.16.1_windows_amd64.zip | +Archive | +Windows | +64-bit | +
pactus-gui_0.16.1_windows_amd64_installer.exe | +Installer | +Windows | +64-bit | +
Once you have downloaded the Pactus GUI, you may follow this tutorial to set up and run your node: + How to run Pactus in Graphic Mode?
+ +Advanced users can run Pactus in command line interface (CLI) mode.
+ + + +File name | +OS | +Arch | +
---|---|---|
pactus-cli_0.16.1_android_arm64.tar.gz | +Android | +ARM64 | +
pactus-cli_0.16.1_darwin_amd64.tar.gz | +macOS | +64-bit | +
pactus-cli_0.16.1_darwin_arm64.tar.gz | +macOS | +ARM64 | +
pactus-cli_0.16.1_freebsd_amd64.tar.gz | +FreeBSD | +64-bit | +
pactus-cli_0.16.1_freebsd_arm.tar.gz | +FreeBSD | +ARM | +
pactus-cli_0.16.1_linux_amd64.tar.gz | +Linux | +64-bit | +
pactus-cli_0.16.1_linux_arm64.tar.gz | +Linux | +ARM64 | +
pactus-cli_0.16.1_windows_386.zip | +Windows | +32-bit | +
pactus-cli_0.16.1_windows_amd64.zip | +Windows | +64-bit | +
Once you have downloaded the Pactus CLI, you may follow this tutorial to set up and run your node: + How to run Pactus in Command Line Mode?
+ +Advanced users can get the Pactus docker image from Docker Hub.
+ +You may follow this tutorial to set up and run your node using Docker: + How to run Pactus using Docker?
+ +Pactus Blockchain Version 0.16.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +In this version, the private IP address won’t be advertised, and by default,
+nodes try to find if they have any public IP address.
+If so, they will advertise it. Users can also set the public_address
in the config file.
+This feature specifically helps users who have both public and private IP addresses to always advertise the public addresses.
+Users can still use the private network if they enable the force_private_network
option inside the config file.
+Most users don’t need to change their node’s configuration.
This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.16.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows users to create new addresses for both validators and accounts. +The networking module has been improved, and users can now set limits on the number of connections. +A random crash on the agreement protocol has been fixed in this version.
+ + + +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version address an unforeseen issue in the consensus protocol. +We kindly ask all validators to upgrade their nodes to this version.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.2 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows nodes to set limits on the number of connections they can establish. +By default, each node can have a minimum of 8 connections and a maximum of 16 connections. +Users can easily change these numbers in the configuration file.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ + + +This version is the bootstrap version for +Testnet-2. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Exciting news for the Pactus Community: Testnet-2 is has launched! +The journey through Testnet-1 +brought success and invaluable experiences, with over 500 validators joining the network. +Despite its noteworthy achievements, it also faced challenges that led to a tough decision: to pause the Testnet and +thoroughly address these issues. +After two months of dedicated work and testing, many problems have been resolved, and +we feel confident launching the Testnet again. +Testnet-2 comes with substantial improvements compared to its predecessor by enhancing the core of the Pactus Blockchain. +Notably, the new consensus mechanism and improved overall network performance.
+ +At this point, we want to assure the Pactus community that this version of +the Testnet will not stop until the mainnet launches, +and our main focus is on improving its overall performance and launching the Mainnet.
+ +If you’re new to the concept of Testnet, check out our informative post: +What is the Testnet?
+ +Testnet-2 has important tasks ahead. +Firstly, we aim to confirm that the new consensus mechanism is both safe and efficient. +A close eye will be kept on the network’s performance, ensuring it operates as expected. +For Testnet-2, the committee +size has been expanded to 51 members. +Both the committee’s performance and block production will be closely monitored. +The goal is a blockchain that remains stable and trustworthy, +even with thousands of validators in the network, +ensuring it manages its regular duties seamlessly.
+ +Want to join the Testnet-2? Great! It’s super easy. +Just download the latest Pactus software and you’re good to go. +no fancy setups or special gear needed. +You can run the software straight from your personal computer or laptop. +Need some test coins? Pop over to our Discord channel and share your validator address there.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
]]>In all Blockchain protocols, there is a concept called a consensus mechanism. +This mechanism is used to enable nodes to reach an agreement +on the state of the Blockchain they are +maintaining, in order to have a synchronized and integrated Blockchain.
+ +For now, we have a lot of consensus mechanisms in the Blockchain world. +Pactus Blockchain uses the SSPoS (Solid State Proof of State) which is a new consensus model.
+ +To explain how it works let’s start with explaining one of the first and simplest +consensus mechanisms (or if you already know them, just jump into the last part named SSPoS).
+ + + +In the proof of work model, each node in the network should solve a complex mathematical +problem that requires lots of computing resources to make a new block.
+ +In this way, it’s highly unlikely that anyone would be able to change +past transactions and change Blockchain states such as balances, +without expending equivalent computational power.
+ +By doing this we ensure the security and integrity of the Blockchain.
+ +The concept was adapted from digital tokens by Hal Finney in 2004 +through the idea of “reusable proof of work” using the 160-bit secure hash algorithm 1 (SHA-1).
+ +Bitcoin uses this consensus model.
+ +On the other hand, PoS or Proof of Stake is another consensus mechanism that instead of miners has validators!
+ +Validators lock a number of their assets in the Blockchain and they can transfer or use it +till it is locked which we call staking. +after each Block is committed one of the validators will be chosen randomly (more amount of stake, +more chance to be chosen) when a validator is chosen +it proposes a block and announces it to other nodes to be validated, +when a supermajority of validators accept the block it’s going to be committed.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk losing the stake amount.
+ +More amount of validators in a PoS Blockchain makes it more secure, +decentralized, and trustable, but it also makes the validation and consensus process slower and more difficult.
+ +Ethereum uses this model.
+ +DPoS or Delegated Proof of Stake, is a variant of the PoS consensus algorithm. +users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions +and creating blocks. The number of delegates is limited +to ensure accountability and efficiency in the validation process.
+ +Some Blockchains like Cardano and Tron use DPoS.
+ +DPoS tries to solve the issue of PoS which when validators +increase we have an inefficient validation process. but the main issue with DPoS itself is putting a lot +of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +BUT, HOW ABOUT SSPoS? HOW ABOUT PACTUS?
+ +In Pactus Blockchain, we have something called Solid State Proof of Stake +and we try to fix the previous model’s issue, let me explain.
+ +Pactus uses a dynamic committee of validators with a fixed size of 21, +but the members of the committee randomly change in each round, +based on stake amount the chance of being chosen is higher. on the other hand, +the number of validators out on the committee is unlimited, allowing anyone +to become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm by generating a random number +between zero and the total staked coins. If the number is less +than the validator’s stake, they can enter the committee and replace the oldest committee member.
+ +So, in SSPoS models which are a variant of PoS, we can reach a consensus, +without using high computation resources, having an inefficient +validation process by increasing validator numbers, +and also without breaking the principle of “don’t trust, verify”.
]]>there is several activities in Pactus github in September month, here is a clear report and explain of activities.
+ + + +After starting Pactus Labs and PIPs, +we start implementing each accepted PIP one by one to improve Pactus, here is a list of implemented PIPs:
+ +There is some very good change and new features for Pactus network module, +this list contain a list of important changes in Pactus networking:
+ +We also updated, improved and enhanced gRPC and nanomessage services for better developer experience, +for third-party and side project developers, here is some changes:
+ +We had some not implemented feature request, not fixed bugs and some issue with new golang version, +list of this changes:
+ +]]>In our commitment to transparency and innovation, we’re excited to introduce a major step in Pactus’s journey: +the Pactus Improvement Proposals, or PIPs.
+ + + +Pactus Improvement Proposals (PIPs) define standards for the ongoing development and enhancement of the Pactus platform. +Each PIP has a unique number like PIP-2, +PIP-3, and so on. +These proposals provide technical details for suggested modifications or enactments, serving as a guide for development.
+ +The PIP process is open, allowing any member of the Pactus community to propose a PIP. +The author should provide a summary, motivation, and a detailed technical explanation. +The Pactus Laboratory team will carefully review each PIP. +Security considerations must be addressed before finalizing a PIP. +Once finalized, it can be added to the code. +This process helps avoid unexpected issues during development and maintain consistency and safety.
+ +The Pactus Improvement Proposals (PIPs) was inspired by the +Ethereum Improvement Proposals (EIPs) system, +which had its roots in the Bitcoin Improvement Proposals (BIPs) and +Python Enhancement Proposals (PEPs).
+ +From now on, all major changes or new features in the Pactus project require a PIP. +Any implementation must reference its specific PIP. +Without approval from Pactus Laboratory team, changes won’t be approved and added to the codebase.
+ +For a complete list of Pactus Improvement Proposals, visit this link. +The corresponding GitHub repository is accessible here.
+ +]]>there is several activities in pactus github this month, here is a clear report and explain of activities.
+ + + +one of new changes in pactus project is new linters we added this month. +what is linters? +linters are just a set of rules for the style of source codes, they force developers to write new codes +in correct, clean and safe way.
+ +why we use them? +the reason we are using linters in Pactus and add new ones, is to make the code more safe, +and also make it easy to work on for new contributors because we are focus on being decentralized even in development.
+ + + +one another new change in Pactus is updating TLA+ spec, which is related to consensus, +as you know we had some problem with consensus in Testnet-1, we fixed the issues and now we are trying to make it more clean.
+ + + +if you wish you can learn more about Pactus consensus here.
+ +some of previous Pactus dependencies was so old, so we start refactoring them and use new libraries. +also we used some libraries with higher performance which is make Pactus full node more faster in mainnet.
+ +]]>Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In May 2023, we launched our second Testnet. +The main purpose of this Testnet was to measure block time creation and the responsiveness of the blockchain. +The development team also focused on evaluating the network’s performance. +Additionally, the overall performance of the software and the syncing process were closely examined and assessed.
+ +The committee for Testnet-1 was set to 21 validators, +and 584 validators joined during the Testnet period. +More than 600,000 blocks were created, and more than 1 million transactions were processed during this time. +The size of the blockchain is about 300 megabytes.
+ +About 300,000 coins were staked during this period, it was almost 50% of the total generated coins. +It shows that users, even in Testnet, tend to stake their coins.
+ + + +We were able to extract the confirmation time of transactions. +More than 97% of transactions were confirmed in just one block after submission. +This indicates that the transaction pool and broadcasting models are working fine.
+ + + +Based on logs from one of the validators, the time for creating a block is about 3 seconds in normal cases. +More than 97% of blocks are committed in the first rounds.
+ + + +During Testnet-1, we released three versions(Version +0.11.0, +0.12.0, +0.13.0), and the upgrade process was smooth. +At this time, the development team decided to stop Testnet-1 and work on improvements that are not backward compatible, +including:
+ +After stabilizing the changes, we will announce the next Testnet, and hopefully, this will be the pre-launch Testnet.
+ +This Testnet was important for us. +It helped us learn what we need to do to make Pactus work even better. +Without the community that supports us and dedicates their time and resources to testing and feedback, +we wouldn’t have been able to progress as we have.
+ +we thank all of them for their valuable contributions. +As promised, participants in Testnets will be given priority as validators for the MainNet, and +will receive bounty tokens from the bootstrap accounts to set up their validator.
+ +We are grateful to all those who participated in Testnet-1, and +we encourage them to join our next Testnet to help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
]]>The meeting took place on 09 July 2023, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting began with an overview of the Network module in Pactus. +This module uses Libp2p as its underlying network protocol.
+ +The Network module is agnostic about the content of the message and +handles two types of messages: Gossip messages, which are broadcasted, +and Stream messages, which are sent directly to a specific peer. +The team discussed the relay nodes that enable communication for nodes behind NAT. +Upon receiving a message, the module publishes an event. +The two types of events are Gossip events and Steam events.
+ + + +The team discussed the issue of Relay connections resetting, and explored solutions such as +hole punching or using UDP and IPv6.
+ +Some users in the Testnet reported high network usage. +The team discussed implementing metrics for LibP2P to monitor network usage effectively. +The discussion related to this issue can be found here. +Additionally, the team discussed the customization of network resources, +including setting limits for inbound and outbound connections.
+ +Moving on, the Sync module was discussed. +Unlike the Network module, the Sync module has full knowledge about the messages and packets. +The module handles a range of message types, which can be found +here.
+ +It was suggested that we need to define metrics for each message type. +There was also a discussion about the need for reducing the messages to optimize the use of network resources.
+ +The team decided to continue discussing these topics in future meetings. +They also plan to work on improving the Network and Sync modules based on these discussions.
]]>Pactus as a real Proof of Stake blockchain, has achieved a significant milestone. +More than 500 validators joined the Testnet +in less than 2 months. +This accomplishment proves that Pactus is reliable, resilient, and trustworthy. More importantly, it sets new standards +in the blockchain world. In fact, the Pactus Testnet is even more decentralized than some well-known blockchains.
+ + + +One key reason why Pactus can accommodate more validators is its powerful +consensus mechanism. +The consensus mechanism in Pactus eliminates the need for delegation, making it possible for anyone to become a validator. +Additionally, the user-friendly application ensures that even those new to blockchain can easily contribute to the network.
+ +To remain competitive in the market, Pactus recognizes the importance of prioritizing user space. +We aim to ensure that running Pactus is affordable and accessible to anyone, regardless of their technical expertise or +available resources.
+ +To achieve this, the Pactus team constantly monitors network, storage, and computational usage, striving to keep them +at minimal levels. +By doing so, we enable more individuals to participate in the Pactus blockchain.
+ +Currently, the Pactus team is working on optimizing and reducing network usage. This effort will lead to reduced costs, +especially for users who are using home internet connections.
+ +Furthermore, we are planning to introduce a pruning mode, allowing users to run the Pactus blockchain with significantly +less storage. +Although we believe the storage size is already small, our goal is to enable users to +retain only the most recent blockchain history. +This approach ensures that the blockchain size remains as compact as possible by disregarding some history of the blockchain.
]]>Pactus Blockchain Version 0.13.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +Users can now restore the default_wallet
during the node initialization.
+If users have a backup of the seed phrase (mnemonic) for the default_wallet
,
+they can now restore it and re-initialize the node.
This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.12.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version is focused on improving the sync time to make it faster. +This is achieved by implementing a caching mechanism that executes transactions more quickly and +improves the calculation of total power (stake) of the blockchain in a more effective way.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.11.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version is the fix for the relay +connection issue. +A relay is a peer in the network that facilitates the connection between two peers, +particularly when they are using home internet.
+ +Another significant update is that sending a Bond transaction +is now more user-friendly. +Users no longer need to set the validator public key if they want to bond Test PAC coins to their validators.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>The Pactus blockchain Testnet-1 is now available for participation. +This version simulates the Mainnet environment and evaluate the system’s performance, stability, +and security in a controlled environment. +The primary goal of this version of Testnet is to determine the efficient and secure committee size for the Mainnet.
+ +To join the Testnet, download Pactus software +version 0.10.0 and +connect to Testnet without any special configuration or hardware. +You can run the software on your personal computer or laptop. +To acquire test coins, visit the Discord channel and +provide your validator address.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
]]>Pactus Blockchain Version 0.10.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version allows users to set up multiple validators in one node. +Users can set up to 32 validators in a single node, and each validator can stake up to 1,000 coins.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +GetBlockchainInfo
API in gRPC now returns the total number of validators and accounts (#439)You can find the full list of changes on Github, +as well as the source code
]]>Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In September 2022, we launched our first Testnet. +The purpose of this Testnet was to +check the consensus protocol, +test different transaction types, +and ensure the stability of the blockchain. +We also wanted to test the sortition algorithm +to make sure it works properly.
+ +The committee +for the Testnet-0 was set to five validators, and more than 19 validators joined during the Testnet period. +Over 2 million blocks were created, and more than 3.2 million transactions were processed during this time. +The size of the blockchain is approximately 1 gigabyte. +The maximum number of transactions recorded in a single block was 386. With a block time of 10 seconds, +we can confirm that Pactus blockchain can support up to 30 transactions per second (TPS), +which is a reasonable number for TPS. Based on real-time statistics available at realtps, +we can see that Pactus is among the top 10 blockchains in terms of TPS.
+ +At this point, the development team decided to end the Testnet-0 and move on to the next one, +Testnet-1. We are planning to run the Testnet-1 to prepare for the MainNet launch. +We will provide updates on our progress and share the details of the new Testnet soon.
+ +As promised, participants in Testnets will be given priority as validators for the MainNet, +and will receive bounty tokens from the bootstrap accounts to set up their validator. +We are grateful to all those who participated in Testnet-0, and we encourage them to join our next Testnet to +help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
]]>If you have ever wondered what Testnet is and how it is different from Mainnet, read this article to the end to find out!
+ +Mainnet and Testnet are two widely used terminologies in the Blockchain ecosystem; +so it is important to understand the meaning and differences while working in the industry or +following announcements of the Blockchain projects like Pactus.
+ +Here’s a quick explanation: +Before the actual live version of a Blockchain network that is used for real transactions, +functions and smart-contracts (which is referred as Mainnet), +there is a test version of the Blockchain network for testing purposes (which is referred as Testnet). +In Testnet, a safe environment is provided to help developers experiment and test their applications, +and make sure that everything functions smoothly in the Mainnet version.
+ +A Testnet is a simulation of a Blockchain, in which developers can test all the functionalities of +their Blockchain network without risking their assets and convenience of end-users. +Using Testnet, any possible error, bug or malfunctions can be fixed before the Mainnet launch. +Testnet also can be an experimental environment for new features, updates and upgrades. +So several Testnet networks of the same version or newer version of the Mainnet can be implemented on the roadmap.
+ +A secure environment to test development ideas and updates. +So many features and minor details in Pactus project have been successfully developed so far using the Testnet; such as:
+ +Providing a safe testing ground for resolve scalability and security problems, as well as decentralization issues. +Pactus network is also a secure and purely decentralized network. However in the last updates during the Testnet, +developers are now able to decrease the database size by approximately 10% without compromising performance. +They did it by utilizing block height instead of hash to store blocks within the database. (you can find out more +here).
+ +Testing new versions, patches and features on Testnet. it is vital for enhancing the security, load testing, +Blockchain migration, integration tests, and etc. This is why you can now use the latest version of Pactus-GUI +that works like clockwork and is extremely secure.
+ +Testing the functions of cryptocurrency without disrupting the Mainnet. In the Testnet of Pactus Blockchain, +you as a user or validator can use all the features to send, receive, bond or unbond your assets in the Pactus-GUI.
+ +Development and simulation of smart contract features and DApps. Note that many Blockchain projects like Pactus, +can be used as smart-contract platforms. So the Testnet can be designed in different stages to test and improve +different applications of the network.
+ +Please note that after a certain period of time, when developers get satisfied with the functionality and debugging process, +they launch Mainnet. Mainnet has its own independent genesis blocks; +so the assets and addresses that users use in Testnet are not valid inside the new Mainnet Blockchain anymore. +In fact the whole Blockchain network starts working from the scratch and users and validators start to +work with real tokens and transactions instead of the simulated ones. But since Testnet has an important effect +on the health and improvement of the network, in Pactus Blockchain, we have several advantages +for the people who join the Testnet.
+ +There are different contributors in a Blockchain network; +Some people are developers and programmers that use the Testnet to contribute, enhance and lead the project to a better future. +Testnet is actually vital for them to perform their changes and try their innovations and ideas.
+ +But you might also be an end user; you might want to either be a validator and stake your assets to earn more Pactus coins, +or you might want to learn how to use the network for future personal applications. Either way, +you might find it handy to give it a try and be familiar with Pactus-GUI and its different features.
+ +However, there is another advantage for end users who join the Testnet. +While using the network, running a node or testing the Pactus-GUI in Testnet period, you are contributing to +the community to find improvement potentials, that’s why there are more advantages contemplated for the Testnet users; +Soon our Mainnet will be launched and also Pactus network will be announced and listed in well-known exchanges. +As an early contributor, you will have the advantage of getting some extra initial tokens at the beginning of Mainnet launch. +So that you can use it to run a validator node and earn more from staking your assets. This airdrop is considered +for every individual who installs Pactus-GUI and starts a node in Testnet.
+ +There are other positive conditions you may experience as an early contributor.
+ +An account is an entity that is identified by a unique address, +which can send transactions on the blockchain.
+ +The account structure is 12 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
4 bytes | +Number | +
8 bytes | +Balance | +
The Treasury account is a special account that is defined at the genesis time. +The Treasury account holds the total supply of Pactus coins, which is fixed at 21 million coins, +and each coin is divided into 1 billion units.
+ +In each block, one coin from the treasury account is transferred to the proposer account +as block reward.
+ +This block reward serves as an incentive for validators to propose and validate new blocks on the blockchain. +As a result, the total number of Pactus coins in circulation increases gradually over time as new blocks +are added to the blockchain.
+ +An address is a unique identifier that is used to send and receive transactions on the Pactus blockchain. +It is represented as a string of 42 alphanumeric characters and always begins with the letters “pc1”. +Here is an example of an address on the Pactus blockchain:
+ +pc1p4e92hx0erqyx939crndvthvpn7qcdhefc9r6s7
+
An address in the Pactus blockchain is made up of 21 bytes and it is derived from the public key. +The first byte of the address specifies the address type, +while the remaining 20 bytes represent the hash of the public key. +The hash function used is RIPEMD-160, +which is applied after Blake2b): +The resulting byte array is then converted into a bech32m1 string.
+ + + +The address type specifies the type of the address and its defined as below:
+ +The Treasury address on the Pactus blockchain is a fixed address that is defined as follows:
+ +TreasuryAddress: 000000000000000000000000000000000000000000
+
The address type for the Treasury address is set to zero, which +means there is no key associated with the Treasury address. +The remaining characters of the address are all zeros.
+ +In the Pactus, a block is a set of data that contains a header, the certificate of the previous block +and list of the transactions. +Once a block comes with a valid certificate, it is committed and added to the blockchain, and +the certificate will be included in the next block. +A committed block is immutable, and any modifications to the block will invalidate the certificate.
+ + + +The block header is a data structure in the Pactus blockchain that contains important information about +the block.
+ +The block header is 138 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
1 byte | +Version | +
4 bytes | +Timestamp | +
32 bytes | +Previous Block Hash | +
32 bytes | +State Hash | +
48 bytes | +Sortition Seed | +
21 bytes | +Proposer Address | +
A block certificate is a proof of commitment for the block in the Pactus blockchain. +It is the result of the Pactus consensus algorithm and ensures that the block has been agreed upon by committee members.
+ +The block certificate consists the following fields:
+ +Size | +Field | +
---|---|
4 bytes | +Height | +
2 bytes | +Round | +
Variant | +Committers | +
Variant | +Absentees | +
48 bytes | +Signature | +
Each block in the Pactus blockchain contains a list of transactions. +The maximum number of transactions in a block is determined by the +consensus parameters, and currently set to 1000. +The first transaction in each block is the reward transaction. +Once a block is committed and added to the blockchain, all the transactions inside the block will be executed. +This means that the state of the blockchain will be updated based on the transactions in the committed block.
+ +The block hash is a unique identifier for each block, which is computed by hashing the following data:
+ +The previous certificate hash and the Merkle root hash of transactions are included in the block hash to +ensure that they cannot be modified. +The block hash is used to link the blocks together in the blockchain.
+ +There is no completely empty block in Pactus. +Each block contains at least one transaction, which is the reward transaction.
+ +In the Pactus blockchain, a validator called a Proposer is responsible for collecting all transactions and +creating a block every 10 seconds. +The Proposer broadcasts the proposed block to other validators inside the committee. +Other validators verify the proposed block, and if it is valid, they cast their votes in favor of the proposed block by +signing the combination of the block hash and the consensus round. +More details about the consensus mechanism can be found in the +consensus protocol document.
+ +To issue a valid certificate, signatures from validators who hold more than ⅔ of the stake in +the committee are required. +Once enough votes are collected, the signatures are aggregated and combined into a single signature, and +the certificate is issued.
+ +To verify a certificate for a block, the block hash is computed, and +the aggregated public key can be formed using the Committers and Absentees list. +Then, the signature can be verified using the aggregated public key and +the aggregated signature inside the certificate.
+ +The Pactus blockchain employs various advanced cryptographic algorithms, including hashing and signature schemes, +to protect user data and transactions.
+ +Pactus uses a hashing algorithm called Blake2b. +This algorithm is known for being a fast and secure way of creating unique digital fingerprints of data.
+ +To ensure secure transactions, Pactus uses a signature scheme called +BLS (Boneh–Lynn–Shacham) +threshold signature for cryptographic signing and verification.
+ +One of the advantages of BLS signatures is signature aggregation. BLS individual signatures can be +combined into one single aggregated signature, so that the overall size does not grow beyond one +signature.
+ +BLS signatures have an important property called non-malleability, +which means that it is impossible to generate two valid signatures for the same message. +In other words, each message has a unique signature, and signatures cannot be altered without invalidating the signature.
+ +The Pactus blockchain starts from scratch, with no pre-existing accounts or pre-allocated tokens. +Its starting point is known as the genesis block, which is created by the bootstrap validators.
+ +The Pactus blockchain starts with four bootstrap validators. +These bootstrap validators do not have any stake, however their voting power is set to one within the consensus algorithm. +Their primary role is to initiate the blockchain during a brief period known as the bootstrapping phase. +As the bootstrapping phase progresses, these validators are able to earn rewards, +which they can later use to invite other validators to join the network.
+ +Once the network reaches 21 validators, the bootstrap validators will retire, and +the blockchain will be secured by other validators.
+ +The genesis block is the first block in the Pactus blockchain, and it is created by the bootstrap validators. +This block marks the beginning of the blockchain and serves as the foundation for subsequent blocks.
+ +The previous block hash in the genesis block sets to 0, +indicating that it has no predecessor. +Additionally, the genesis block does not have a previous certificate.
+ +In Pactus, the Genesis Information is pre-defined and indicates the initial state of the network. +These parameters are hardcoded into the project and include:
+ +You can find the pre-defined Genesis Information for the Testnet of the Pactus blockchain in the genesis.json
file,
+which is located in the project repository, here.
++ +The incentive may help encourage nodes to stay honest.
+ + +
In Pactus, rewards are given to validators for proposing and validating new blocks on the blockchain. +These rewards serve as an incentive for validators to participate in the consensus process and +maintain the security and integrity of the network.
+ +To better understand the incentive model in Pactus, let’s compare it with the Bitcoin reward model. +This comparison will help to understand how the incentive model works in Pactus.
+ +Pactus | +Bitcoin | +
---|---|
Consensus engine is Proof of Stake | +Consensus engine is Proof of Work | +
Exactly every 10 seconds one block is minted | +Around every 10 minutes one block is mined | +
Total supply is 21,000,000 coin | +Total supply is 21,000,000 coin | +
Always one coin per block | +Initial block reward is 50 coin | +
No halving | +Halving happens every 4 years | +
The halving mechanism in Bitcoin rewards early contributors more significantly. +However, in a Proof-of-Stake blockchain, this mechanism can lead to wealth centralization, +as early validators gain too much power based on their staked coins.
+ +To promote fairer block rewards, Pactus has introduced a simple and straightforward incentive model called the “Flat Reward.” +In this model, the block reward remains constant at one coin per block and does not change over time.
+ + + + + +In Pactus, the coin distribution is linear. This linear distribution is a direct result of the Flat Reward system. +Unlike other blockchains that have a curved distribution, Pactus maintains a consistent coin distribution.
+ + + + + +Data serialization is the process of converting data into a format that can be easily stored or transmitted over a network. +It typically involves encoding data into a sequence of bytes, which can later be decoded to +reconstruct the original data structure. +Pactus has two methods for data serialization: Deterministic serialization and CBOR serialization:
+ +Pactus uses a deterministic serialization for the deterministic data like blocks and transactions. +The serialization format for different types of data is listed in the table below:
+ +Data Type | +Size (bytes) | +Description | +
---|---|---|
uint8 | +1 | +An 8 bits unsigned integer | +
int8 | +1 | +An 8 bits signed integer | +
uint16 | +2 | +A 16 bits unsigned integer | +
int16 | +2 | +A 16 bits signed integer | +
uint32 | +4 | +A 32 bits unsigned integer | +
int32 | +4 | +A 32 bits signed signed integer | +
uint64 | +8 | +A 64 bits unsigned integer | +
int64 | +8 | +A 64 bits signed signed integer | +
VarInt | +Variable | +A compact representation of an unsigned integer. | +
VarByte | +Variable | +A variable length bytes | +
VarString | +Variable | +A variable length string | +
Address | +21 | +21 bytes of address data | +
Hash32 | +32 | +32 bytes of hash data | +
Variable length integer (VarInt) is encoded by 7-bit chunks. The MSB indicates whether there are
+more octets (1) or it is the last one (0). It means 0x00
to 0x7f
encoded in 1 byte, 0x80
to
+0x3fff
encoded in 2 bytes, …
Example:
+ +0x0f -> 0f
+0x1000 -> 8020
+0xffff -> ffff03
+0xffffff -> ffffff07
+
Variable length byte (VarByte) is encoded as a variable length integer (VarInt) containing the
+length of the array followed by the bytes themselves: VarInt(len(bytes)) || bytes
Variable length string (VarString) is encoded as a variable length integer (VarInt) containing the
+length of the string followed by the bytes that represent the string
+itself:VarInt(len(str)) || str
All the internal number representation are in little-endian byte order.
+ +Here is an example of a block header data that encoded using deterministic serialization:
+ + + + +For non-deterministic data, such as networking messages, Pactus uses +“Concise Binary Object Representation” or CBOR. +CBOR is a binary data serialization format that is widely used in various application, +including IoT, web services, security, and automotive, due to its compact representation and efficient parsing.
+ +cbor.me +is an online tool for encoding and decoding CBOR data, offering developers an easy way to test and +validate their CBOR data without having to set up a local environment.
+ +Here is an example of a vote message that encoded using CBOR.
+ + + + + +The State Hash is used to ensure the integrity of the data in the Pactus blockchain. +It serves as a unique identifier or fingerprint of the current state of the blockchain, +allowing all nodes to verify that their data matches that of the other nodes. +This helps to prevent any tampering or inconsistencies in the data, ensuring the accuracy and consistency of the blockchain.
+ +++ +In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node +is labelled with the cryptographic hash of a data block, and every non-leaf node is labelled with +the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure +verification of the contents of large data structures.
+ +From Wikipedia
+
A Hash tree or Merkle tree is a data structure that used by many blockchains to solve this problem: +“How can data be securely stored and verified in a decentralized network?”
+ +By using a Merkle tree, nodes can easily verify that they store the same data +without having to share the entire dataset. Additionally, this helps to prevent any tampering with the data, +as any changes made to the data would cause inconsistencies in the Merkle tree and +can be easily detected by the network.
+ +In Pactus, the Merkle tree is used to verify the state of the blockchain in each block. +The state hash in each block is calculated by taking the hash of two Merkle trees: +the accounts Merkle tree and the validators Merkle tree. +Each leaf in these trees contains the hash of the associated account or validator. +By using the state hash, all nodes in the network can ensure they have the same data stored.
+ + + +Using a Merkle tree to calculate the state of the blockchain can be challenging +because when the number of accounts is large, calculating the root hash can be difficult. +In other words, a simple Merkle tree may not be scalable because calculating all the leaf +and node hashes requires a significant amount of computation.
+ +In Pactus, all accounts and validators have unique and sequential numbers. +This means that each account and validator has a dedicated account number that helps us to +calculate the hash of leaf nodes in the Merkle tree. +By using these account numbers, we can ensure that the position of the leaf nodes in +the Merkle tree is always the same. +This approach allows us to avoid rebuilding the Merkle tree whenever an account or validator’s state changes. +Instead, we can save the previous Merkle tree and recalculate the parent hashes by +fetching neighbor hashes as needed. +This helps to ensure scalability and reduces the computational resources required for recalculating the Merkle tree.
+ + + +In this example, only account 6 has been updated. +By locating the corresponding leaf node in the existing Merkle tree and +traversing the tree towards the root node, we can calculate new root hash. +This approach has a complexity of \(O(log n)\), making it efficient for large numbers of accounts.
+ +A Validator is an entity that participates in the consensus process by sharing its votes. +Validators get rewarded for creating new blocks, and to become a Validator, +they must “bond” or lock up a certain amount of coins as stake. +The amount of stake held by validators determines their power in the consensus.
+ +The Validator structure is 120 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
96 bytes | +Public Key | +
4 bytes | +Number | +
8 bytes | +Stake | +
4 bytes | +Last Bonding Height | +
4 bytes | +Unbonding Height | +
4 bytes | +Last Joined Height | +
The committee is a group of 51 validators responsible for generating new blocks. +Validators in the committee participate in the consensus algorithm by casting votes, +with their voting power determined by their stake. +While in the committee, validators cannot send Bond or Unbond transactions, +meaning their voting power remains the same. +The members of the committee changes randomly over time through Sortition transactions. +Each block can contain zero or more Sortition transactions.
+ +These rules are applied when committing sortition transactions:
+ +Proposer selection within the committee operates on a deterministic, clockwise rotation system. +If a validator is unable to propose, for any reason, it stays within the committee, but +the proposer’s role shifts to the next validator in the committee.
+ + + +When a new validator joins the committee, they take a position before the current proposer. +After the addition of a new validator, the committee adjusts to maintain the total number of validators at 51. +This is achieved by removing the oldest validator from the committee, +i.e., the one that has been in the committee for the longest time.
+ + + +For an adversary to take control of the committee, they would need to control more than ⅔ of the stake within the committee. +To assess the security of the committee, let’s assume all validators in the committee have the same voting power. +In this case, an adversary would need to control more than ⅔ of the validators in the committee.
+ +Now, let’s imagine an adversary holds 10% of the total stake. +As a result, one of their validators can enter the committee every 10 blocks. +In the first 10 blocks, one of the adversary’s validators enters the committee. +In the next 10 blocks, another validator enters the committee, giving the adversary two validators within the committee. +In the subsequent 10 blocks, another validator enters, but at the same time, the first validator leaves the committee. +Therefore, an adversary with 10 10% of the total stake can have, on average, two validators in a committee of 51 validators.
+ +Using the Poisson distribution, +we can estimate the probability of an adversary controlling ⅔ of the committee:
+ +Adversarial Stake | +Committee size | +⅔+ of committee | +Adversarial committee members | +Probability of controlling ⅔+ | +
---|---|---|---|---|
15% | +21 | +15 | +3 | +\(5.46 \times 10^{-07}\) | +
15% | +55 | +35 | +7 | +\(3.34 \times 10^{-14}\) | +
15% | +99 | +67 | +14 | +\(1.41 \times 10^{-24}\) | +
10% | +21 | +15 | +2 | +\(3.39 \times 10^{-09}\) | +
10% | +55 | +35 | +5 | +\(1.90 \times 10^{-18}\) | +
10% | +99 | +67 | +9 | +\(2.91 \times 10^{-35}\) | +
5% | +21 | +15 | +1 | +\(2.81 \times 10^{-13}\) | +
5% | +55 | +35 | +2 | +\(4.50 \times 10^{-31}\) | +
5% | +99 | +67 | +4 | +\(1.09 \times 10^{-56}\) | +
The height at which the validator joined the committee is recorded as the “Last Joined Height” field in +the validator structure. +Once a validator enters the committee, this field is set to the current height it +evaluated the sortition proof.
+ +A validator within the committee can run the sortition algorithm. +If they generate a valid sortition transaction, the height of their entry into the committee is set +to the current block height, allowing them to stay in the committee for a longer period.
+ +Consensus parameters are a set of configurable settings that determine how the Pactus blockchain operates. +These parameters are agreed upon by all validators in the network, +ensuring that validators behave in the same way and that the network operates consistently.
+ +Here is the list of the consensus parameters:
+ +Proof of Stake is a way to secure a blockchain through requesting users to stake some amount of their coins. +These stakeholders, called validators, are responsible to collect, validate and add transactions to the blockchain. +The validators will be rewarded with native coins.
+ +Unlike Proof of Work, which is based on competition, Proof of Stake is based on collaboration. +Validators work together to manage the expansion of the blockchain. +A Proof of Stake blockchain becomes more decentralized and secure as more validators participate in it.
+ +To understand how Proof of Stake works, imagine a community bank without any centralized authority. +In this bank, users decide to run it together. +Some of these users volunteer to collect, validate, and record transactions, +ensuring that everything runs smoothly.
+ +These volunteers, known as validators, must temporarily lock or freeze some of their money as a stake. +This stake can’t be transferred or used. +The more money a validator stakes, the more influence they have in the system.
+ +From time to time, one of the validators is chosen by the others to collect all the recent transactions, +bundle them together, and send a copy to the other validators. +If a supermajority of the validators agree with the proposed bundle by signing it, +the bundle will be committed to the bank’s ledger.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk harming the bank’s reputation and the value of their own stakes as well.
+ +In Proof of Stake, if the number of validators increases, +the voting time will also increase, and this can lead to an inefficient consensus mechanism. +In our community bank example, running the bank becomes more difficult as the number of validators increases.
+ +To solve this problem, some blockchains use the concept of “delegators”. +In Delegated Proof of Stake, users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions and creating blocks. +The number of delegates is limited to ensure accountability and efficiency in the validation process.
+ + + +The delegation model puts a lot of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +Pactus introduced a mechanism that doesn’t rely on delegation, we call it Solid State Proof of Stake. +It utilizes a dynamic committee of validators +that are responsible for creating new blocks. +The size of the committee is fixed, but the members of the committee are randomly changed. +On the other hand, the number of validators outside the committee is unlimited, allowing anyone to +become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm +by generating a random number between zero and the total staked coins. +If the number is less than the validator’s stake, they can enter the committee and replaces the oldest committee member.
+ + + +The chance of entering the committee depends on the validator’s stake and luck. +But on average, one validator should enter the committee in each block.
+ +Pactus consensus algorithm is a state machine +replication with Byzantine fault tolerance. +The Pactus consensus algorithm starts with the block creation phase. +In this phase one validator acts as the proposer. The proposer collects all the transactions, +creates a block, and proposes it to other validators.
+ +When a proposed block is seen by other validators, they validate the block and +cast their vote for the proposed block, moving to the “prepare” state.
+ +If more than two-thirds (⅔) of the total stakes cast their votes, the proposed block becomes prepared, +and validators move to the “precommit” state.
+ +If, once again, more than two-thirds (⅔) of the total stakes cast their vote for the prepared block, +the block is committed, and the next proposer is ready to propose a new block. This cycle repeats every 10 seconds.
+ +If a proposer fails to propose in any round, other validators start the “change proposer” phase to +decide to change the proposer for this round.
+ + + +There are \(R = 3f+1\) validators. where \(f\) is the maximum +number of validators that may be faulty or byzantine. For example, if there is one faulty validator, +the resiliency of the algorithm is optimal if we have at least \(3\) non-faulty +validators. So the minimum number of validators should be \(3+1=4\).
+ +We denote a message as \(\langle m \rangle\) tuple and a signed message by node \(i\) as +\(\langle m \rangle_{\sigma_i}\).
+ +Pactus consensus algorithms has two phases: Block creation phase and change proposer phase.
+ +The block creation phase in Pactus consensus algorithm includes these three steps1: +Propose, Prepare and Precommit. +The protocol proceeds in rounds \(r = 0, 1, 2, \ldots\).
+ +In each round \(r\), one validator is the proposer and the others act as validators. +The proposer \(p\) collects transactions and creates a proposal block \(B\). It signs and +broadcasts a proposal message with the proposed block piggybacked to all the validators. +Propose message has this form:
+ +\[\langle \langle \text{PROPOSE},h,r \rangle_{\sigma_p}, B \rangle\] + +where:
+ +If validator \(i\) accepts the proposal, it enters prepare step and signs and +broadcasts prepare message to all other validators. Otherwise, it does nothing. +The prepare message has this form:
+ +\[\langle \text{PREPARE},h,r,d \rangle_{\sigma_i}\] + +where:
+ +If validator \(i\) received \(2f+1\) prepare messages from other +validators (including its own), it becomes prepared and enters to precommit step.
+ +In precommit step, validator \(i\) signs and broadcasts precommit message to +the other validators. +The precommit message has this form:
+ +\[\langle \text{PRECOMMIT},h,r,d \rangle_{\sigma_i}\] + +Each validator executes and commits block \(b\) after receiving +\(2f+1\) precommit messages (including its own) and becomes committed.
+ +Each validator that receives a valid proposal and with \(2f+1\) precommit messages from other +validators (including its own), can create a block-announce messages and broadcasts it to the network. +The block-announce message has this form:
+ +\[\langle \text{BLOCK-ANNOUNCE} ,h ,r ,B, C \rangle\] + +where:
+ +Validators can move to the next height and clear the message logs after receiving valid +block-announce message, even if their timer has expired.
+ +The picture below shows the operation of the algorithm in the normal case. validator 1 is the +proposer and validator 4 is faulty.
+ + + +The change-proposer provides liveness by allowing the system to make progress when the proposer fails. +The change-proposer phase is triggered by timeouts that +prevent validators from waiting indefinitely for the proposal to execute.
+ +If the timer of a validator expires in round \(r\), the validator starts a change-proposer phase. +The change-proposer phase is an Asynchronous Byzantine Binary Agreement (ABBA) 2 that is biased toward zero (No). +It means that during this phase, even if they don’t have the proposal, honest validators may decide to vote zero +if they obtain a valid quorum Certificate for the prepare step.
+ +If a supermajority of the validators decide to change the proposer, they move to round r+1r+1. However, +if they decide not to change the proposer, they will return to the prepare state and, +since a supermajority of the validators attested to a valid proposal, they can commit the proposed block.
+ +The change proposer phase in Pactus consensus algorithm includes these three steps: +Pre-vote, Main-vote and Decide +The protocol proceeds in rounds \(r_{cp} = 0, 1, 2, \ldots\).
+ +In Pre-vote step each validator casts a pre-vote for a value \(b \in \{0, 1\}\) +and broadcasts pre-vote message to the network. +The pre-vote message has this form:
+ +\[\langle\langle \text{CP:PRE-VOTE},h,r,r_{cp},b \rangle_{\sigma_i}, justification\rangle\] + +The first round is a special round and each validator starts with an initial value. +If the validator’s timer has expired in the prepare step, its initial value is zero, +and if the validator’s timer has expired in the precommit step, its initial value is one.
+ +\[b = \begin{cases} +1 & \text{if timer expired in prepare step,} \\ +0 & \text{if timer expired in precommit step.} +\end{cases}\] + +In the next rounds, each validator select \(2f+1\) properly justified main-votes from round \(r − 1\) and
+ +\[b = \begin{cases} +0 & \text{if there is a main-vote for 0,} \\ +1 & \text{if there is a main-vote for 1,} \\ +0 (biased) & \text{if all main-votes are abstain.} +\end{cases}\] + +These pre-votes must be justified with a appropriate justification. +For the first round, if the validator’s timer has expired in the prepare step, the justification is \(nil\) , +and if the validator’s timer expired in the precommit step, +the justification is the proper quorum certificate for the prepare step at round \(r\).
+ +In the next rounds, a pre-vote for \(b\) may be justified in two ways:
+ +After collecting \(2f+1\) valid and justified pre-votes, each validator casts a main-vote \(v \in \{0, 1, abstain\}\) +and broadcasts main-vote message to the network. +The main-vote message has this form:
+ +\[\langle\langle \text{CP:MAIN-VOTE},h,r,r_{cp},v \rangle_{\sigma_i}, justification\rangle\] + +The main-vote value \(v\) determine as below:
+ +\[v = \begin{cases} +0 & \text{if there are 2f+1 pre-vote for 0,} \\ +1 & \text{if there are 2f+1 pre-vote for 1,} \\ +abstain & \text{if there are pre-votes for 0 and 1.} +\end{cases}\] + +These main-votes must be justified with a appropriate justification. +A main-vote for \(v\) may be justified in two ways:
+ +After collecting \(2f+1\) valid and justified main-votes, each validator examines these votes. If all +votes are for a value \(b \in \{0, 1\}\), then the validator decides \(b\), but continues to +participate in the protocol for one more round. Otherwise, the validator proceeds to the next round \(r_{cp}+1\).
+ +Pactus consensus protocl doesn’t have any lcoking mechanism or +checkpointing and there will at most one valid proposla per round. +This ensures that each round can begin with a new proposal.
+ +Protocol | +Normal case | +Faulty case |
+ ||
---|---|---|---|---|
Steps | +Complexity | +Locking | +Checkpointing | +|
PBFT | +3 | +$$O(n^2)$$ | +No | +Yes | +
Tendermint | +3 | +$$O(n^2)$$ | +Yes | +No | +
HotStuff | +4 | +$$O(n)$$ | +Yes | +No | +
Pactus | +3 | +$$O(n^2)$$ | +No | +No | +
References:
+ + + +The sortition algorithm is an important part of the Pactus blockchain, responsible for the fair, transparent +and random selection of validators to join the committee. +It utilizes a Verifiable Random Function, or VRF for short, to generate a verifiable random number.
+ +The generated random number should be in the range of 0 to the total staked coins. +If validators can prove that their generated number is less than their stake, +they can send the sortition transaction. +Once a sortition transaction is included in a block, the validator will join the committee, +and the oldest validator in the committee will leave it.
+ +Verifiable Random Function is a pseudo-random function that the owner of key \(s\) can evaluate \(v = f_s(x)\) and also provides +\(proof_{x}\) efficiently proving that \(v\) is correct. We call such a mathematical +object a verifiable pseudo-random function, VRF for brevity 1.
+ +Pactus uses the BLS signature scheme as the source of VRF. +Since BLS signatures are unique, +the hash of a BLS signature can be used to produce a secure and verifiable random number.
+ +The VRF takes three parameters:
+ +Once the VRF is executed, it produces an index with a proof. +The index is a number between zero and the total staked coins, and the proof allows other validators to verify the correctness +of the generated index.
+ +The pseudocode below demonstrates the evaluation of the VRF for the sortition algorithm:
+ +\[\begin{align*} +& \textbf{function} \ VRF(sk, seed, total\_stake) \\ +& \qquad pk \gets P_{BLS}(sk) \\ +& \qquad proof \gets S_{BLS}(sk, seed \| pk) \\ +& \qquad rnd \gets H(proof) \\ +& \qquad index \gets \frac{(rnd \times total\_stake)}{2^{256}} \\ +& \qquad \\ +& \qquad \textbf{return} \ index, proof \\ +& \textbf{end function} +\end{align*}\] + +where:
+ +To verify a sortition proof, both the validator’s public key and stake are required:
+ +\[\begin{align*} +& \textbf{function} \ verifyVRF(pk, seed, proof, stake, total\_stake) \\ +& \qquad \textbf{if} \ V_{BLS}(pk, seed \| pk, proof) = True \ \textbf{then} \\ +& \qquad \qquad rnd \gets H(proof) \\ +& \qquad \qquad index \gets \frac{(rnd \times total\_stake)}{2^{256}} \\ +& \qquad \\ +& \qquad \qquad \textbf{return} \ index \leqslant stake \\ +& \qquad \textbf{else} \\ +& \qquad \qquad \textbf{return} \ False \\ +& \qquad \textbf{end if} \\ +& \textbf{end function} +\end{align*}\] + +where:
+ +There is no need to send \(index\) alongside \(proof\) because the +result should be less than the validator’s stake, and the validator’s stake is known at each block.
+ +The sortition algorithm relies on a random and publicly verifiable seed that cannot be manipulated by adversaries. +Otherwise, adversaries may select a seed that favors the selection of corrupt users.
+ +To prevent this, the BLS signature scheme is used to generate the sortition seed. +Since BLS signatures are unique and deterministic, adversaries cannot generate more than one valid signature per block. +In each block, the block proposer generates a new sortition seed based on the previous seed using the following function:
+ +\[\begin{align*} +& \textbf{function} \ generateSeed(sk, prev\_seed) \\ +& \qquad \textbf{return} \ S_{BLS}(sk, H(prev\_seed)) \\ +& \textbf{end function} +\end{align*}\] + +Since the proposer’s public key is known, the seed for the next block can be easily verified. +If the seed is invalid, the proposed block will be rejected. +The verification function is as follows:
+ +\[\begin{align*} +& \textbf{function} \ verifySeed(pk, prev\_seed, seed) \\ +& \qquad \textbf{return} \ V_{BLS}(pk, H(prev\_seed), seed) \\ +& \textbf{end function} +\end{align*}\] + +The sortition seed for the genesis block set to 0.
+ +The Sortition probability refers to the expected number of validators that may join the committee in each block, +assuming all validators are actively online and executing the sortition algorithm.
+ +The probability of a validator \(i\) being selected depends on their stake relative to the total stake in the system:
+ +\[p_i=\frac{S_i}{S_t}\] + +where:
+ +Therefore, the expected number of validators joining the committee at each block can be represented as:
+ +\[P=\sum_{i=1}^{n}{p_i}=\sum_{i=1}^{n}{\frac{S_i}{S_t}}=\frac{S_1+S_2+\ldots+S_n}{S_t}\] + +where \(n\) is the total number of validators. We know that \(S_t={S_1+S_2+\ldots+S_n}\). Therefore we will have:
+ +\[P=\frac{S_t}{S_t}=1\] + +Thus, on average, we expect one validator to join the committee at each block. +In practice, the actual number of validators joining the committee in each block +may differ due to the randomness in the sortition algorithm, or the possibility of some validators being offline.
+ +The total staked coin in each block is calculated by summing the staked coins of all active validators. +An active validator is a validator that has not yet unbonded.
+ +The height at which the validator joined the committee is recorded as the “Last Joined Height” field in +the validator structure. +The validator with the lowest “Last Joined Height” is considered the oldest.
+ +Developing distributed and concurrent systems is a complex task that requires careful attention to the details. +Testing such systems is challenging because it’s difficult to simulate all possible states, +including those that can happen due to system failures, network latency, and other factors. +This makes it hard to ensure that the system behaves correctly in all circumstances.
+ +Therefore it’s essential to have a proactive approach that involves modeling the system’s behavior in a formal way. +Such an approach can help identify potential issues before they occur, saving time and preventing costly flaws.
+ +TLA+ is a formal specification language developed by +Leslie Lamport based on the idea of +specifying systems using simple mathematics. +It is used for designing, modelling, documentation, and verification of programs, especially concurrent and +distributed systems. +TLA+ and its tools are useful for eliminating fundamental design errors, which are hard to find and +expensive to correct in code.
+ +To know more about TLA+, check The TLA+ Home Page.
+ +Pactus consensus specification +has written in TLA+ format. It includes all invariants that can be held +in every state of every execution that the protocol allows. The TLA+ specification is compiled into +PDF file.
+ +By defining some invariants we can ensure the safety of the consensus +protocol in any possible and +distinct state, and therefore we have the informal safety proof of the Pactus consensus protocol using TLA+.
+ +Checking the liveness is not easy, but with defining some constraints, we have the informal proof of +liveness of Pactus consensus protocol using TLA+.
+ +Here you can find the technical documentations for the Pactus project.
+ +Ethereum friendly blockchains keep storage in a separate key/value database per request. This has +some drawbacks:
+ +Here we discuss how we can address the above issues by dedicating a separate file as Storage +File per smart contract. In this scenario, users should purchase the storage file with required +capacity before deploying the smart contract. Once the purchase is done, a separate empty file will +be created and dedicated for the user. The size of the file is the same as the purchase size. For +example users can purchase 10 MB or 120 MB of storage files depending on their need and renew them +yearly.
+ +Each storage file has three parts: Header, ByteCodes and contract storage.
+ + + +The Header of the storage file keeps some meta data like storage file index, last payment time, +total storage size, etc. In the ByteCodes section the byte codes of the smart contract will be saved +and in the storage section, the actual storage of the smart contract will be stored.
+ +Smart contracts can only change data in storage sections. To achieve that the smart contract +executer (virtual machine) should introduce these APIs:
+ +/// This API requests the host to read the slice of `data` from the storage file
+/// at the given `offset`.
+fn read(&self, offset: u32, data: &mut [u8]) -> Result<(), HostError>;
+
+/// This API requests the host to write the slice of `data` into the storage file
+/// at the given `offset`
+fn write(&self, offset: u32, data: &[u8]) -> Result<(), HostError>;
+
+
These APIs are similar to SLoad
and SStore
opcodes in Ethereum Virtual Machine (EVM). But
+instead of key and value, they accept offset and data parameters.
In order to allocate storage space safely and efficiently user can use these predefined methods:
+ +/// Allocates storage space with the specific `length` and returns the
+/// offset of allocated space in the storage file.
+pub fn allocate(&self, length: u32) -> Result<Offset, Error>;
+
+/// Deallocates the storage space at the specific `offset` and `length`
+pub fn deallocate(&self, offset: Offset, length: u32) -> Result<(), Error>;
+
There is a fixed stack with 32 elements at the beginning of the storage . The first item in this +stack is reserved and used for managing deallocated storage spaces. Users can use other stack items +to keep the offset of the allocated spaces for the smart contract variables.
+ + + +Usually in smart contracts developers are interested in data collections like Search Trees or Hash +Tables to look up values by the associated keys. Most programming languages come up with some +builtin collections, however we can’t use them in smart contracts because they use RAM that is +inconsistent. However we can have storage equivalent of these data collections that instead of +dealing with memory they are dealing with the storage file. You can naively consider storage as +dedicated consistent memory for the smart contract.
+ +Right now these data collection is available to use inside the smart contract: StorageVector
,
+StorageString
, StorageLinkedList
, StorageBST
and StorageHasTable
.
To make sure all the nodes have the same state we need to calculate the hash of all storage files. +Merkle tree can help us to easily calculate the root hash very fast. We need two Merkle trees, one +for calculating the root hash of each storage file and the second for calculating the root hash of +all storage files.
+ +We can divide each file into small chunks of data and calculate the hash of each chunk once. Since +we know exactly which chunk has changed after executing the smart, contract we can easily +reconstruct the tree and calculate the merkle root again.
+ +Each file has a unique index. With using that index we can make sure that the position of the leaf +nodes in the Merkle tree is always the same. The same technique we used for calculating the +state hash.
+ + + +As an example we have implemented the ERC20 smart contract based on this idea. The implementation +can be found here
+ +One of the consequences of Storage as File is that testing smart contracts becomes easier. What we +need is only to mock the storage file.
+ +Bond transaction is used to bond stake to a validator. +If the validator does not exist, it will be created. +Once a bond transaction committed, the validator cannot participate in the +sortition algorithm for 1 hour. +This is called the “bond interval” and is defined in the +consensus parameter.
+ +The bond transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
96 bytes (optional) | +Public key | +
8 bytes | +Amount | +
Transaction fees in the Pactus blockchain are calculated using a percentage-based fee model. +The fee is a percentage of the transferred amount, within a minimum and maximum range. +The percentage, minimum fee, and maximum fee parameters are part of the blockchain +consensus parameters.
+ +The formula to calculate the transaction fee is as follows:
+ + + +\[\begin{align*} +fee = amount \times percentage \\ +\\ +fee = +\begin{cases} + & fee_{min} & \textbf{ if } \ fee < fee_{min} \\ + & \\ + & fee_{max} & \textbf{ if } \ fee > fee_{max} \\ + & \\ + & fee & \textbf{otherwise} + \end{cases} +\end{align*}\] + +Currently, the fee fraction or percentage is set to 0.01%, the minimum fee is set to 0.000,001 coin, +and the maximum fee is set to 0.001 coin.
+ +Transactions in Pactus consists the following fields:
+ +Size | +Field | +
---|---|
1 byte | +Version | +
4 bytes | +Lock Time | +
8 bytes | +Fee | +
Variant | +Memo | +
1 byte | +Payload Type | +
Variant | +Payload Data | +
48 bytes | +Signature | +
96 bytes | +Public Key | +
The payload type field determines the format of the payload data field in the transaction. +Different payload types have different formats for the payload data. +The following are the supported transactions in Pactus blockchain:
+ +The Transaction ID is a unique identifier for a transaction on the blockchain. +It is generated by taking the hash of the transaction data without including the public key and signature fields.
+ +Sortition transaction is used to enter a validator +in the committee. +By committing a sortition transaction, the validator will enter the committee. +Sortition transactions are valid for 7 blocks, which is defined as “sortition interval” in the +consensus parameters.
+ +The sortition transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Address | +
48 bytes | +Sortition Proof | +
Validators do not need to pay a fee for sortition transactions, and the fee should be set to zero.
+ +Transfer transaction is used to transfer coins between the accounts. +If the receiver account does not exist, it will be created.
+ +The transfer transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
8 bytes | +Amount | +
The reward transaction is the first transaction in each block. There is only one reward transaction +per block, and it has the same format as a transfer transaction, but with zero fees and no signature.
+ +The sender address is the Treasury address, +and the receiver address is defined by the block proposer. +The amount of the reward transaction should be equal to the +block reward plus transaction fees. +This amount will go to the proposer account as a block reward. +Therefore, in each block, one coin from the +Treasury account transfers to +the proposer account as a block reward.
+ +Unbond transaction is used to unbond a validator. +An unbonded validator cannot participate in the sortition algorithm anymore, and after 21 days, the stake can be withdrawn. +This is called the “unbond interval” and is defined in the consensus parameter.
+ +The unbond transaction has a payload consists the following field:
+ +Size | +Field | +
---|---|
21 bytes | +Validator address | +
Withdraw transaction is used to withdraw the staked coins from an unbonded +validator
+ +The withdraw transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
8 bytes | +Amount | +
Here, you can find some guidance to help you use and interact with the Pactus blockchain.
+ +Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). +This tutorial will guide you through the steps to run Pactus in CLI mode, suitable for advanced users.
+ +Before proceeding with the steps below, ensure that you have the following:
+ +To get started, follow the steps below based on your operating system:
+ +Windows: Download and extract the Pactus CLI file from +here.
+ +Linux and macOS: You have two options:
+ +Download and extract the Pactus CLI file from here.
+Use the following command in the Terminal:
+curl --proto '=https' --tlsv1.2 -sSL https://github.com/pactus-project/pactus/releases/download/v0.16.1/pactus_downloader.sh | sh
+
This command will download the CLI archive file, verify it, and extract it for you.
+ +Once you have downloaded and extracted the Pactus CLI file, you can proceed to the next step.
+ +Now you need to create a wallet and setup a working directory for your node. +A working directory is a place where you save blockchain data and wallets. +Open the Terminal and run the following command:
+ + +./pactus-daemon init -w ~/pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus
.
./pactus-daemon init -w ~/pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus
.
pactus-daemon.exe init -w c:\pactus --testnet
+
This command creates your wallet and setup the working working directory at c:\pactus
.
Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future +in case your computer is lost, damaged, or stolen.
+ +The working directory contains:
+ +Feel free to explore the contents of these files as needed, particularly the config file. +The config file contains parameters that can customize your node.
+ +If you ever need to restore your node, for instance on a new device,
+you can use the --restore
option followed by your mnemonic:
./pactus-daemon init -w ~/pactus --testnet --restore "<your-mnemonic>"
+
Replace <your-mnemonic>
with your previously noted mnemonic phrase.
+This command will restore your wallet in the ~/pactus
directory.
./pactus-daemon init -w ~/pactus --testnet --restore "<your-mnemonic>"
+
Replace <your-mnemonic>
with your previously noted mnemonic phrase.
+This command will restore your wallet in the ~/pactus
directory.
pactus-daemon.exe init -w c:\pactus --testnet --restore "<your-mnemonic>"
+
Replace <your-mnemonic>
with your previously noted mnemonic phrase.
+This command will restore your wallet in the c:\pactus
directory.
Now you can start the node and sync with the network. Run the following command in the Terminal:
+ + +./pactus-daemon start -w ~/pactus
+
./pactus-daemon start -w ~/pactus
+
pactus-daemon.exe start -w c:\pactus
+
When the Pactus node starts running, it begins syncing with the network. +This process may take some time, as your node needs to download and verify the entire blockchain history. +Please be patient while your node syncs.
+ +To become a validator and participate in the +consensus algorithm to earn rewards, you first need to +stake some coins. In the next +tutorial, +we will explain how to send a Bond transaction to become a validator.
+ +By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +Docker is a tool that simplifies the process of creating, deploying, and running applications using containers. +With containers, developers can bundle all the necessary parts of an application, including libraries and dependencies, +and deploy them as a single package.
+ +In this document, we will guide you on how to run Pactus using Docker, step by step.
+ +The only thing you need is installing docker in your machine. +If you are using Windows please make sure you have installed WSL.
+ +The Pactus docker images are available at Docker Hub. +You can pull the latest image with this command:
+ +docker pull pactus/pactus
+
Now you need to create a wallet and setup a working directory for your node. +A working directory is a place where you save blockchain data and wallets. +Open the Terminal and run the following command:
+ + +docker run -it --rm -v ~/pactus/testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus/testnet
.
docker run -it --rm -v ~/pactus/testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus/testnet
.
docker run -it --rm -v c:\pactus\testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at c:\pactus\testnet
.
Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future +in case your computer is lost, damaged, or stolen.
+ +The working directory contains:
+ +Feel free to take a look at these files.
+ +Now you can start the node and sync with the network. Run the following command in the Terminal:
+ + +docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
docker run -it -v c:\pactus\testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
To run pactus-testnet in background just add a -d flag in the command.
+ +Hint: Remember to pass in your wallet passphrase as well with -p flag after /pactus.
+ +docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 -d --name pactus-testnet pactus/pactus start -w /pactus -p {YOUR_PASSPHRASE}
+
docker run -it -v c:\pactus\testnet:/pactus -p 8080:8080 -p 21777:21777 -d --name pactus-testnet pactus/pactus start -w /pactus -p {YOUR_PASSPHRASE}
+
You can stop/start docker:
+ +docker stop pactus-testnet
+docker start pactus-testnet
+
Or check the logs:
+ +docker logs pactus-testnet --tail 1000 -f
+
By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). +This tutorial will guide you through the steps to run Pactus in GUI mode, suitable for beginner to advanced users.
+ +Before proceeding with the steps below, ensure that you have the following:
+ +Download the Pactus GUI installer or archived file from +here.
+ +Windows and macOS users may encounter a warning message stating that Pactus is an untrusted application. +This is because Pactus does not have a +code signing certificate.
+ + + +A code certificate is a digital signature that verifies the identity and authenticity of the software publisher. +However, obtaining a code certificate is complex and expensive process, and requires registering a company and +passing Know Your Customer (KYC) checks.
+ +As Pactus is an open-source and community-based application, we don’t have a code certificate yet. +Therefore, you can safely ignore the warning message and proceed with installing Pactus.
+ +To install Pactus GUI, simply follow the on-screen instructions provided by the installer. +The process is straightforward and similar to installing any other application on your computer.
+ + + +When you run Pactus for the first time, a wizard dialog will appear to guide you through the wallet creation and +initialization process. This process consists of several steps:
+ +On the first page, you will ask you how you want to create your wallet. +Select the option to “Create a new wallet from scratch” and proceed to the next page.
+ + + +The next page will display your wallet seed phrase, which consists of 12 words. +It is essential to securely back up this seed phrase, as it is required for wallet recovery +in case your computer is lost, damaged, or stolen.
+ + + +Warning: Keep your wallet seed phrase private and secure. +If someone else gains access to your seed phrase, they can control your wallet and funds.
+ +In this step, you will be asked to confirm your seed phrase. +Input the 12 words you received in the previous step into the dialog. +If the seed phrase is entered correctly, you will be able to proceed to the next page.
+ + + +On this page, you will be asked to set a password for your wallet. +Enter a strong password in the first dialog box and confirm it in the second one. +This password will be used to encrypt your wallet and protect it from unauthorized access.
+ + + +Note: Choose a strong password and keep it safe. +If you forget or lose your password, you will need your seed phrase to regain access to your wallet.
+ +Each node in the Pactus blockchain can run up to 32 validators, and each validator can stake up to +1000 coins. Here, you can define how many validators you want to create for your node. +Select the number of validators based on the amount of coins you want to stake.
+ + + +If you want to stake more than 32,000 coins, you need to set up a new node.
+ +The last page of the initialization process shows the node information, such as the working directory, validator address, +and reward address. Review this information and click “Close” to complete the initialization process.
+ + + +Upon closing the wizard dialog, your Pactus node will start running. You are now ready to use Pactus in GUI mode.
+ +After completing the initialization process, you are ready to run the Pactus node. +Running a Pactus node allows you to synchronize with the network, enabling you to view and manage your wallet and +sending transactions.
+ +When the Pactus node starts running, it begins syncing with the network. This process may take some time, +as your node needs to download and verify the entire blockchain history. +Please be patient while your node syncs.
+ + + +You can check the “Default Wallet” tab to access your wallet information. Please note that the displayed +information may not be accurate until the syncing process is complete.
+ + + +In the “Default Wallet” tab, you can view your account details, including your balance and +address information such as the validator and reward addresses. +Your computer acts as a node and is recognized by the validator address in the Pactus network. +The reward address is the account address where you collect the +rewards earned by participating in +the consensus algorithm and proposing new blocks.
+ +To become a validator and participate in the +consensus algorithm to earn rewards, you first need to +stake some coins. In the next +tutorial, +we will explain how to send a Bond transaction to become a validator.
+ +By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +The Pactus Blockchain offers a Graphical User Interface (GUI) that comes with a built-in wallet to create, +sign and broadcast transactions. +This tutorial aims to guide you step-by-step on how to use the GUI application to send transactions to the Pactus blockchain. +Whether you are a beginner or an advanced user, this tutorial is suitable for you.
+ +Before we begin, you’ll need to run the Pactus GUI application and ensure that it is synced with the network. +You can find detailed instructions on how to do this in the following tutorial.
+ +To send a transfer transaction, click on the “Transaction” menu and +select “Transfer”. +A new window will appear where you can select the +account address from which you wish to send the “transfer” transaction, +as well as the recipient’s account address and the amount you wish to send.
+ +After reviewing the transaction details and ensuring that they are correct, +click on the “Send” button to sign and broadcast the transaction to the Pactus blockchain.
+ + + +It’s important to note that the transaction fee +will be calculated based on the amount you’re sending.
+ +To send a bond transaction, click on the “Transaction” menu +and select “Bond”. +A new window will appear where you can select the account address from which you wish to send the “bond” transaction, +as well as the recipient’s validator address and +the amount you wish to stake.
+ + + +It’s important to note that the transaction fee +will be calculated based on the amount you’re sending.
+ + +The Pactus Blockchain provides a wallet application that allows users to interact with the Pactus blockchain +without the need to run a node. +This is ideal for users who do not wish to operate a node but still want to create a personal wallet to manage their funds. +This tutorial will guide you step-by-step on how to use the wallet application.
+ +To get started, download and extract the Pactus CLI file from +here.
+ +In this section, we will explore various wallet commands that help you create, manage, +and recover your Pactus wallet.
+ +First, you need to create a wallet. To create a new wallet, run the following command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet create
+
This command creates a new wallet and stores it in the ~/pactus/wallets/default_wallet
.
./pactus-wallet --path ~/pactus/wallets/default_wallet create
+
This command creates a new wallet and stores it in the ~/pactus/wallets/default_wallet
.
pactus-wallet.exe c:\pactus\wallets\default_wallet create --testnet
+
This command creates a new wallet and stores it in the c:\pactus\wallets\default_wallet
.
Don’t forget to back up your wallet seed, as it allows you to recover your wallet if you lose it.
+ +You can change the wallet password by running this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet password
+
./pactus-wallet --path ~/pactus/wallets/default_wallet password
+
pactus-wallet.exe c:\pactus\wallets\default_wallet password
+
If you forget your password, you can still recover your wallet using the wallet seed.
+ +You can obtain the wallet seed by running this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet seed
+
./pactus-wallet --path ~/pactus/wallets/default_wallet seed
+
pactus-wallet.exe c:\pactus\wallets\default_wallet seed
+
The wallet seed is encrypted within your wallet, and +you’ll need to enter the wallet password to access it.
+ +If you lose your wallet, you can recover it by running this command:
+ + +./pactus-wallet --path ~/pactus/wallets/recovered_wallet recover
+
./pactus-wallet --path ~/pactus/wallets/recovered_wallet recover
+
pactus-wallet.exe c:\pactus\wallets\recovered_wallet recover
+
Please note that if you lose your seed, there is no way to recover your wallet.
+ +In this section, we’ll cover address commands that help you manage your wallet addresses.
+ +You can create a new address by running this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet address new
+
./pactus-wallet --path ~/pactus/wallets/default_wallet address new
+
pactus-wallet.exe c:\pactus\wallets\default_wallet address new
+
You can also assign a label to your address to better organize your address book.
+ +To view the list of wallet addresses, use this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet address all
+
./pactus-wallet --path ~/pactus/wallets/default_wallet address all
+
pactus-wallet.exe c:\pactus\wallets\default_wallet address all
+
To obtain the public key for a specific address, run this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet address pub <ADDRESS>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet address pub <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet address pub <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve its public key.
You can get the public key of your address by this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet address pub <ADDRESS>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet address pub <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet address pub <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve its private key.
+Keep your private key secure. If someone gains access to your private key,
+they will have full control over that address.
You can get the balance of your address by this command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet address balance <ADDRESS>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet address balance <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet address balance <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve your balance.
In this section, we’ll cover transaction commands that help you create, sign, and +broadcast transactions on the Pactus Blockchain. +You’ll need to provide the password to sign the transaction. +Please note that once a transaction is broadcasted, it cannot be reversed.
+ +To create, sign, and broadcast a +Transfer transaction, use the following command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet tx transfer <FROM> <TO> <AMOUNT>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet tx transfer <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet tx transfer <FROM> <TO> <AMOUNT>
+
In this command, <FROM>
should be one of the addresses in your wallet as the sender address,
+and <TO>
is the receiver address.
To create, sign, and broadcast a +Bond transaction, use the following command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet tx bond <FROM> <TO> <AMOUNT>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet tx bond <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet tx bond <FROM> <TO> <AMOUNT>
+
In this command, <FROM>
should be one of the addresses in your wallet as the sender address,
+and <TO>
is the receiver validator address.
If the validator associated with this address does not exist yet, +you need to provide the public key to create it:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet tx bond --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
Replace <PUBLIC_KEY>
with the validator’s public key,
+which is the public key of the <TO>
address.
To create, sign, and broadcast a +Unbond transaction, use the following command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet tx unbond <ADDRESS>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet tx unbond <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet tx unbond <ADDRESS>
+
In this command, <ADDRESS>
is the address of the validator that you want to unbond.
To create, sign, and broadcast a +Withdraw transaction, use the following command:
+ + +./pactus-wallet --path ~/pactus/wallets/default_wallet tx unbond <FROM> <TO> <AMOUNT>
+
./pactus-wallet --path ~/pactus/wallets/default_wallet tx unbond <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\default_wallet tx withdraw <FROM> <TO> <AMOUNT>
+
The meeting took place on 04 September 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +During the meeting, Joseph suggested using Nanomsg instead of ZeroMQ because building ZeroMQ is not easy, +especially in Windows. Additionally, we can use the pure Go implementation of Nanomsg.
+ +The format of block events was defined as follows:
+ +<event_id: 1 byte><event_data: variant><height: 4 bytes><seq_num: 4 bytes>
+
As a consequence of this, smart contracts events can be defined more easily and +Infura-like services become simple, as we can just replay the events.
+ +Nagaraj’s pull request reviewed.
+ +The team discussed renaming (rebranding) the project and decided to create an online survey to +gather suggestions for a new name. +Everyone is encouraged to participate in the survey and suggest new names for the project.
+ +The meeting took place on 29 August 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +During the last meeting, the team conducted an online survey to rename the project. +A total of 31 responses were received, and the following names were suggested:
+ +Name | +Votes | +
---|---|
Sirius | +11 | +
Pactus | +10 | +
Nova | +7 | +
Texo | +6 | +
Zemus | +6 | +
Helios | +6 | +
Tutti | +5 | +
Haki | +5 | +
Aegeus | +4 | +
Virgo | +4 | +
Zentora | +3 | +
Zinova | +3 | +
Xerxes | +2 | +
Ledgeria | +2 | +
Solidus | +2 | +
Welt | +2 | +
Ventura | +2 | +
Zebra | +2 | +
Miranet | +2 | +
Monetha | +2 | +
FutureHub | +1 | +
Muonet | +1 | +
Mentha | +1 | +
Hypatios | +0 | +
Chaintopia | +0 | +
Sycee | +0 | +
Lepus | +0 | +
After reviewing the responses, the team chose “Pactus” as the new name for the project. 🎉 +The project will be moved to “pactus-project/pactus,” and the team plans to announce it on social media.
+ +In terms of the GUI, Joseph suggested using Flutter, and the team agreed. +To interact with the wallet, gRPC APIs will be provided, and the GUI will use these APIs.
+ +The meeting took place on 18 September 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The team discussed Testnet and related issues, including IP block issues that were found by Hadi. +Due to sanctions, some IPs are blocked, so the team will run a support node to assist users inside Iran. +The GUI application had some issues on Windows, but they were fixed and tested by Hadi.
+ +The website still has some issues, such as the need to rename the animation to “Pactus” and the lack of a logo. +The community suggested some logos. Additionally, the roadmap page is missing.
+ +The team discussed the status of social media platforms, including:
+ +The team also decided to announce the project on social media on 29 September.
+ +The team discussed the current consensus parameters:
+ +Pactus Blockchain Release Version 0.9.0 +is now available for download. +This release includes a new graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version has been implemented for Testnet-0 and is preparing for the upcoming Mainnet launch. +To get started with the Pactus Blockchain Testnet-0, simply download +the latest version and run the Pactus software.
+ +Join the Testnet now and get ready for the future!
+ +The Pactus blockchain Testnet-0 is now accessible. +To participate, simply download the Pactus application version 0.9.0 and +connect to the Testnet without any special configurations. +For test coins, please visit our Discord channel and share your validator address.
+ +By taking part in the Testnet, you can familiarize yourself with the Pactus blockchain and +get ready for the Mainnet launch. +Testnet participants will also be given higher priority during the Mainnet launch.
+ +Please share your feedback with us to help improve the user experience in future versions of the software.
+ +The meeting took place on 30 October 2022, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting started in memory of Mahsa Amini. +We in the Pactus family stand in solidarity with courageous people who are fighting for equality, equity and freedom in Iran.
+ + + +The beta version of the block explorer has been launched 🚀 and is now available at +https://pacscan.org.
+ +Nagaraj explained the block explorer and some of the features.
+ +Project road map was discussed.
+ +Ali presented the Pactus pitch deck for the IdeaKita in Malaysia. +The IdeaKita program, under the Malaysia Digital Economy Corporation (MDEC), is designed to +support entrepreneurs and startups in Malaysia.
+ +The latest pull requests were reviewed:
+ +Pactus Blockchain Release Version 0.9.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version has been implemented for Testnet-0 and is preparing for the upcoming Mainnet launch. +To start using the Pactus Blockchain Testnet-0, +you can download the latest version from download page +and join the Testnet.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +If you have ever wondered what Testnet is and how it is different from Mainnet, read this article to the end to find out!
+ +Mainnet and Testnet are two widely used terminologies in the Blockchain ecosystem; +so it is important to understand the meaning and differences while working in the industry or +following announcements of the Blockchain projects like Pactus.
+ +Here’s a quick explanation: +Before the actual live version of a Blockchain network that is used for real transactions, +functions and smart-contracts (which is referred as Mainnet), +there is a test version of the Blockchain network for testing purposes (which is referred as Testnet). +In Testnet, a safe environment is provided to help developers experiment and test their applications, +and make sure that everything functions smoothly in the Mainnet version.
+ +A Testnet is a simulation of a Blockchain, in which developers can test all the functionalities of +their Blockchain network without risking their assets and convenience of end-users. +Using Testnet, any possible error, bug or malfunctions can be fixed before the Mainnet launch. +Testnet also can be an experimental environment for new features, updates and upgrades. +So several Testnet networks of the same version or newer version of the Mainnet can be implemented on the roadmap.
+ +A secure environment to test development ideas and updates. +So many features and minor details in Pactus project have been successfully developed so far using the Testnet; such as:
+ +Providing a safe testing ground for resolve scalability and security problems, as well as decentralization issues. +Pactus network is also a secure and purely decentralized network. However in the last updates during the Testnet, +developers are now able to decrease the database size by approximately 10% without compromising performance. +They did it by utilizing block height instead of hash to store blocks within the database. (you can find out more +here).
+ +Testing new versions, patches and features on Testnet. it is vital for enhancing the security, load testing, +Blockchain migration, integration tests, and etc. This is why you can now use the latest version of Pactus-GUI +that works like clockwork and is extremely secure.
+ +Testing the functions of cryptocurrency without disrupting the Mainnet. In the Testnet of Pactus Blockchain, +you as a user or validator can use all the features to send, receive, bond or unbond your assets in the Pactus-GUI.
+ +Development and simulation of smart contract features and DApps. Note that many Blockchain projects like Pactus, +can be used as smart-contract platforms. So the Testnet can be designed in different stages to test and improve +different applications of the network.
+ +Please note that after a certain period of time, when developers get satisfied with the functionality and debugging process, +they launch Mainnet. Mainnet has its own independent genesis blocks; +so the assets and addresses that users use in Testnet are not valid inside the new Mainnet Blockchain anymore. +In fact the whole Blockchain network starts working from the scratch and users and validators start to +work with real tokens and transactions instead of the simulated ones. But since Testnet has an important effect +on the health and improvement of the network, in Pactus Blockchain, we have several advantages +for the people who join the Testnet.
+ +There are different contributors in a Blockchain network; +Some people are developers and programmers that use the Testnet to contribute, enhance and lead the project to a better future. +Testnet is actually vital for them to perform their changes and try their innovations and ideas.
+ +But you might also be an end user; you might want to either be a validator and stake your assets to earn more Pactus coins, +or you might want to learn how to use the network for future personal applications. Either way, +you might find it handy to give it a try and be familiar with Pactus-GUI and its different features.
+ +However, there is another advantage for end users who join the Testnet. +While using the network, running a node or testing the Pactus-GUI in Testnet period, you are contributing to +the community to find improvement potentials, that’s why there are more advantages contemplated for the Testnet users; +Soon our Mainnet will be launched and also Pactus network will be announced and listed in well-known exchanges. +As an early contributor, you will have the advantage of getting some extra initial tokens at the beginning of Mainnet launch. +So that you can use it to run a validator node and earn more from staking your assets. This airdrop is considered +for every individual who installs Pactus-GUI and starts a node in Testnet.
+ +There are other positive conditions you may experience as an early contributor.
+ +Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In September 2022, we launched our first Testnet. +The purpose of this Testnet was to +check the consensus protocol, +test different transaction types, +and ensure the stability of the blockchain. +We also wanted to test the sortition algorithm +to make sure it works properly.
+ +The committee +for the Testnet-0 was set to five validators, and more than 19 validators joined during the Testnet period. +Over 2 million blocks were created, and more than 3.2 million transactions were processed during this time. +The size of the blockchain is approximately 1 gigabyte. +The maximum number of transactions recorded in a single block was 386. With a block time of 10 seconds, +we can confirm that Pactus blockchain can support up to 30 transactions per second (TPS), +which is a reasonable number for TPS. Based on real-time statistics available at realtps, +we can see that Pactus is among the top 10 blockchains in terms of TPS.
+ +At this point, the development team decided to end the Testnet-0 and move on to the next one, +Testnet-1. We are planning to run the Testnet-1 to prepare for the MainNet launch. +We will provide updates on our progress and share the details of the new Testnet soon.
+ +As promised, participants in Testnets will be given priority as validators for the MainNet, +and will receive bounty tokens from the bootstrap accounts to set up their validator. +We are grateful to all those who participated in Testnet-0, and we encourage them to join our next Testnet to +help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
+ +Pactus Blockchain Version 0.10.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version allows users to set up multiple validators in one node. +Users can set up to 32 validators in a single node, and each validator can stake up to 1,000 coins.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +GetBlockchainInfo
API in gRPC now returns the total number of validators and accounts (#439)You can find the full list of changes on Github, +as well as the source code
+ +The Pactus blockchain Testnet-1 is now available for participation. +This version simulates the Mainnet environment and evaluate the system’s performance, stability, +and security in a controlled environment. +The primary goal of this version of Testnet is to determine the efficient and secure committee size for the Mainnet.
+ +To join the Testnet, download Pactus software +version 0.10.0 and +connect to Testnet without any special configuration or hardware. +You can run the software on your personal computer or laptop. +To acquire test coins, visit the Discord channel and +provide your validator address.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
+ +Pactus Blockchain Version 0.11.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version is the fix for the relay +connection issue. +A relay is a peer in the network that facilitates the connection between two peers, +particularly when they are using home internet.
+ +Another significant update is that sending a Bond transaction +is now more user-friendly. +Users no longer need to set the validator public key if they want to bond Test PAC coins to their validators.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.12.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version is focused on improving the sync time to make it faster. +This is achieved by implementing a caching mechanism that executes transactions more quickly and +improves the calculation of total power (stake) of the blockchain in a more effective way.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.13.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +Users can now restore the default_wallet
during the node initialization.
+If users have a backup of the seed phrase (mnemonic) for the default_wallet
,
+they can now restore it and re-initialize the node.
This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +For a Proof of Stake blockchain, validators are important for +maintaining the network’s integrity and security. They are similar to miners in Proof of Work blockchains like Bitcoin.
+ +Pactus as a real Proof of Stake blockchain, has achieved a significant milestone. +More than 500 validators joined the Testnet +in less than 2 months. +This accomplishment proves that Pactus is reliable, resilient, and trustworthy. More importantly, it sets new standards +in the blockchain world. In fact, the Pactus Testnet is even more decentralized than some well-known blockchains.
+ + + +One key reason why Pactus can accommodate more validators is its powerful +consensus mechanism. +The consensus mechanism in Pactus eliminates the need for delegation, making it possible for anyone to become a validator. +Additionally, the user-friendly application ensures that even those new to blockchain can easily contribute to the network.
+ +To remain competitive in the market, Pactus recognizes the importance of prioritizing user space. +We aim to ensure that running Pactus is affordable and accessible to anyone, regardless of their technical expertise or +available resources.
+ +To achieve this, the Pactus team constantly monitors network, storage, and computational usage, striving to keep them +at minimal levels. +By doing so, we enable more individuals to participate in the Pactus blockchain.
+ +Currently, the Pactus team is working on optimizing and reducing network usage. This effort will lead to reduced costs, +especially for users who are using home internet connections.
+ +Furthermore, we are planning to introduce a pruning mode, allowing users to run the Pactus blockchain with significantly +less storage. +Although we believe the storage size is already small, our goal is to enable users to +retain only the most recent blockchain history. +This approach ensures that the blockchain size remains as compact as possible by disregarding some history of the blockchain.
+ +The meeting took place on 09 July 2023, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting began with an overview of the Network module in Pactus. +This module uses Libp2p as its underlying network protocol.
+ +The Network module is agnostic about the content of the message and +handles two types of messages: Gossip messages, which are broadcasted, +and Stream messages, which are sent directly to a specific peer. +The team discussed the relay nodes that enable communication for nodes behind NAT. +Upon receiving a message, the module publishes an event. +The two types of events are Gossip events and Steam events.
+ + + +The team discussed the issue of Relay connections resetting, and explored solutions such as +hole punching or using UDP and IPv6.
+ +Some users in the Testnet reported high network usage. +The team discussed implementing metrics for LibP2P to monitor network usage effectively. +The discussion related to this issue can be found here. +Additionally, the team discussed the customization of network resources, +including setting limits for inbound and outbound connections.
+ +Moving on, the Sync module was discussed. +Unlike the Network module, the Sync module has full knowledge about the messages and packets. +The module handles a range of message types, which can be found +here.
+ +It was suggested that we need to define metrics for each message type. +There was also a discussion about the need for reducing the messages to optimize the use of network resources.
+ +The team decided to continue discussing these topics in future meetings. +They also plan to work on improving the Network and Sync modules based on these discussions.
+ +Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In May 2023, we launched our second Testnet. +The main purpose of this Testnet was to measure block time creation and the responsiveness of the blockchain. +The development team also focused on evaluating the network’s performance. +Additionally, the overall performance of the software and the syncing process were closely examined and assessed.
+ +The committee for Testnet-1 was set to 21 validators, +and 584 validators joined during the Testnet period. +More than 600,000 blocks were created, and more than 1 million transactions were processed during this time. +The size of the blockchain is about 300 megabytes.
+ +About 300,000 coins were staked during this period, it was almost 50% of the total generated coins. +It shows that users, even in Testnet, tend to stake their coins.
+ + + +We were able to extract the confirmation time of transactions. +More than 97% of transactions were confirmed in just one block after submission. +This indicates that the transaction pool and broadcasting models are working fine.
+ + + +Based on logs from one of the validators, the time for creating a block is about 3 seconds in normal cases. +More than 97% of blocks are committed in the first rounds.
+ + + +During Testnet-1, we released three versions(Version +0.11.0, +0.12.0, +0.13.0), and the upgrade process was smooth. +At this time, the development team decided to stop Testnet-1 and work on improvements that are not backward compatible, +including:
+ +After stabilizing the changes, we will announce the next Testnet, and hopefully, this will be the pre-launch Testnet.
+ +This Testnet was important for us. +It helped us learn what we need to do to make Pactus work even better. +Without the community that supports us and dedicates their time and resources to testing and feedback, +we wouldn’t have been able to progress as we have.
+ +we thank all of them for their valuable contributions. +As promised, participants in Testnets will be given priority as validators for the MainNet, and +will receive bounty tokens from the bootstrap accounts to set up their validator.
+ +We are grateful to all those who participated in Testnet-1, and +we encourage them to join our next Testnet to help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
+ +there is several activities in pactus github this month, here is a clear report and explain of activities.
+ + + +one of new changes in pactus project is new linters we added this month. +what is linters? +linters are just a set of rules for the style of source codes, they force developers to write new codes +in correct, clean and safe way.
+ +why we use them? +the reason we are using linters in Pactus and add new ones, is to make the code more safe, +and also make it easy to work on for new contributors because we are focus on being decentralized even in development.
+ + + +one another new change in Pactus is updating TLA+ spec, which is related to consensus, +as you know we had some problem with consensus in Testnet-1, we fixed the issues and now we are trying to make it more clean.
+ + + +if you wish you can learn more about Pactus consensus here.
+ +some of previous Pactus dependencies was so old, so we start refactoring them and use new libraries. +also we used some libraries with higher performance which is make Pactus full node more faster in mainnet.
+ + + +In our commitment to transparency and innovation, we’re excited to introduce a major step in Pactus’s journey: +the Pactus Improvement Proposals, or PIPs.
+ + + +Pactus Improvement Proposals (PIPs) define standards for the ongoing development and enhancement of the Pactus platform. +Each PIP has a unique number like PIP-2, +PIP-3, and so on. +These proposals provide technical details for suggested modifications or enactments, serving as a guide for development.
+ +The PIP process is open, allowing any member of the Pactus community to propose a PIP. +The author should provide a summary, motivation, and a detailed technical explanation. +The Pactus Laboratory team will carefully review each PIP. +Security considerations must be addressed before finalizing a PIP. +Once finalized, it can be added to the code. +This process helps avoid unexpected issues during development and maintain consistency and safety.
+ +The Pactus Improvement Proposals (PIPs) was inspired by the +Ethereum Improvement Proposals (EIPs) system, +which had its roots in the Bitcoin Improvement Proposals (BIPs) and +Python Enhancement Proposals (PEPs).
+ +From now on, all major changes or new features in the Pactus project require a PIP. +Any implementation must reference its specific PIP. +Without approval from Pactus Laboratory team, changes won’t be approved and added to the codebase.
+ +For a complete list of Pactus Improvement Proposals, visit this link. +The corresponding GitHub repository is accessible here.
+ + + +there is several activities in Pactus github in September month, here is a clear report and explain of activities.
+ + + +After starting Pactus Labs and PIPs, +we start implementing each accepted PIP one by one to improve Pactus, here is a list of implemented PIPs:
+ +There is some very good change and new features for Pactus network module, +this list contain a list of important changes in Pactus networking:
+ +We also updated, improved and enhanced gRPC and nanomessage services for better developer experience, +for third-party and side project developers, here is some changes:
+ +We had some not implemented feature request, not fixed bugs and some issue with new golang version, +list of this changes:
+ +In all Blockchain protocols, there is a concept called a consensus mechanism. +This mechanism is used to enable nodes to reach an agreement +on the state of the Blockchain they are +maintaining, in order to have a synchronized and integrated Blockchain.
+ +For now, we have a lot of consensus mechanisms in the Blockchain world. +Pactus Blockchain uses the SSPoS (Solid State Proof of State) which is a new consensus model.
+ +To explain how it works let’s start with explaining one of the first and simplest +consensus mechanisms (or if you already know them, just jump into the last part named SSPoS).
+ + + +In the proof of work model, each node in the network should solve a complex mathematical +problem that requires lots of computing resources to make a new block.
+ +In this way, it’s highly unlikely that anyone would be able to change +past transactions and change Blockchain states such as balances, +without expending equivalent computational power.
+ +By doing this we ensure the security and integrity of the Blockchain.
+ +The concept was adapted from digital tokens by Hal Finney in 2004 +through the idea of “reusable proof of work” using the 160-bit secure hash algorithm 1 (SHA-1).
+ +Bitcoin uses this consensus model.
+ +On the other hand, PoS or Proof of Stake is another consensus mechanism that instead of miners has validators!
+ +Validators lock a number of their assets in the Blockchain and they can transfer or use it +till it is locked which we call staking. +after each Block is committed one of the validators will be chosen randomly (more amount of stake, +more chance to be chosen) when a validator is chosen +it proposes a block and announces it to other nodes to be validated, +when a supermajority of validators accept the block it’s going to be committed.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk losing the stake amount.
+ +More amount of validators in a PoS Blockchain makes it more secure, +decentralized, and trustable, but it also makes the validation and consensus process slower and more difficult.
+ +Ethereum uses this model.
+ +DPoS or Delegated Proof of Stake, is a variant of the PoS consensus algorithm. +users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions +and creating blocks. The number of delegates is limited +to ensure accountability and efficiency in the validation process.
+ +Some Blockchains like Cardano and Tron use DPoS.
+ +DPoS tries to solve the issue of PoS which when validators +increase we have an inefficient validation process. but the main issue with DPoS itself is putting a lot +of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +BUT, HOW ABOUT SSPoS? HOW ABOUT PACTUS?
+ +In Pactus Blockchain, we have something called Solid State Proof of Stake +and we try to fix the previous model’s issue, let me explain.
+ +Pactus uses a dynamic committee of validators with a fixed size of 21, +but the members of the committee randomly change in each round, +based on stake amount the chance of being chosen is higher. on the other hand, +the number of validators out on the committee is unlimited, allowing anyone +to become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm by generating a random number +between zero and the total staked coins. If the number is less +than the validator’s stake, they can enter the committee and replace the oldest committee member.
+ +So, in SSPoS models which are a variant of PoS, we can reach a consensus, +without using high computation resources, having an inefficient +validation process by increasing validator numbers, +and also without breaking the principle of “don’t trust, verify”.
+ +Pactus Blockchain Version 0.15.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ + + +This version is the bootstrap version for +Testnet-2. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Exciting news for the Pactus Community: Testnet-2 is has launched! +The journey through Testnet-1 +brought success and invaluable experiences, with over 500 validators joining the network. +Despite its noteworthy achievements, it also faced challenges that led to a tough decision: to pause the Testnet and +thoroughly address these issues. +After two months of dedicated work and testing, many problems have been resolved, and +we feel confident launching the Testnet again. +Testnet-2 comes with substantial improvements compared to its predecessor by enhancing the core of the Pactus Blockchain. +Notably, the new consensus mechanism and improved overall network performance.
+ +At this point, we want to assure the Pactus community that this version of +the Testnet will not stop until the mainnet launches, +and our main focus is on improving its overall performance and launching the Mainnet.
+ +If you’re new to the concept of Testnet, check out our informative post: +What is the Testnet?
+ +Testnet-2 has important tasks ahead. +Firstly, we aim to confirm that the new consensus mechanism is both safe and efficient. +A close eye will be kept on the network’s performance, ensuring it operates as expected. +For Testnet-2, the committee +size has been expanded to 51 members. +Both the committee’s performance and block production will be closely monitored. +The goal is a blockchain that remains stable and trustworthy, +even with thousands of validators in the network, +ensuring it manages its regular duties seamlessly.
+ +Want to join the Testnet-2? Great! It’s super easy. +Just download the latest Pactus software and you’re good to go. +no fancy setups or special gear needed. +You can run the software straight from your personal computer or laptop. +Need some test coins? Pop over to our Discord channel and share your validator address there.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
+ +Pactus Blockchain Version 0.15.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version address an unforeseen issue in the consensus protocol. +We kindly ask all validators to upgrade their nodes to this version.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.15.2 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows nodes to set limits on the number of connections they can establish. +By default, each node can have a minimum of 8 connections and a maximum of 16 connections. +Users can easily change these numbers in the configuration file.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.16.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows users to create new addresses for both validators and accounts. +The networking module has been improved, and users can now set limits on the number of connections. +A random crash on the agreement protocol has been fixed in this version.
+ + + +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Pactus Blockchain Version 0.16.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +In this version, the private IP address won’t be advertised, and by default,
+nodes try to find if they have any public IP address.
+If so, they will advertise it. Users can also set the public_address
in the config file.
+This feature specifically helps users who have both public and private IP addresses to always advertise the public addresses.
+Users can still use the private network if they enable the force_private_network
option inside the config file.
+Most users don’t need to change their node’s configuration.
This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
+ +Page not found :(
+The requested page could not be found.
+该常见问题解答页面旨在提供有关Pactus的常见问题和关注点的有用信息和指导。 +
+加入帕克图斯社区,您将成为一个全球创新者、思想家和实践者网络的一部分, 所有这些人都有一个共同的愿景,即利用区块链技术构建更美好的未来。无论您是开发人员、企业家、投资者, 还是一个区块链爱好者,在这里,都有一个属于您的位置。
所以,让我们携手并肩,创造改变吧!
As an open-source platform, Pactus blockchain empowers from its community. +Whether you’re a developer, designer, or enthusiast, your contributions can make a meaningful impact.
+ +There are several ways to support the Pactus project:
+ +One of the most effective ways to contribute to the Pactus network is by running a node. +A “node” is a software program that downloads a copy of the Pactus blockchain and +ensure the network keeps running safe and decentralized.
+ +These guides can help you to run and configure your node:
+ + + +Validators play an important role in the Pactus blockchain by verifying transactions and +adding them to the blockchain. +By becoming a validator, you can earn rewards +for contributing to the network’s security and decentralization.
+ +To become a validator, you will need to stake a certain amount of Pactus coins. +These guides can help you to send a Bond transaction and stake some coins:
+ +Pactus is an open-source project that welcomes and encourages contributions from developers. +By contributing to the project, you can help improve the Pactus platform and create new features that +benefit the entire community.
+ +You can check our Contributing page +for more information on how to get involved and contribute to the project.
+ +Another way to contribute to the Pactus project is by translating this website into other languages and +improving its content.
+ +The more people who know about Pactus, the more opportunities there are for collaboration and growth. +Share our project on social media, attend Pactus events, or simply tell your friends and colleagues about us.
+ +Together, Let’s build a better future for blockchain technology.
+ + +在此页面上,您可以找到如何下载和获取帕克图斯软件的最新版本。
+ +帕克图斯项目是作为开源软件分发的,因此安装的首选方法是从 GitHub存储库克隆源代码并编译源代码。
+ +有关编译帕克图斯的说明在安装页面中提供。
+ +您还可以下载最新的稳定版本的帕克图斯。 这些版本会在发布GitHub存储库中的新版本时自动更新。
+ +您可以以图形用户界面(GUI)模式运行帕克图斯,适用于初学者和高级用户。
+ + + +File name | +Kind | +OS | +Arch | +
---|---|---|---|
pactus-gui_0.16.1_darwin_amd64.tar.gz | +Archive | +macOS | +64-bit | +
pactus-gui_0.16.1_darwin_amd64.dmg | +DMG | +macOS | +64-bit | +
pactus-gui_0.16.1_linux_amd64.tar.gz | +Archive | +Linux | +64-bit | +
pactus-gui_0.16.1_windows_amd64.zip | +Archive | +Windows | +64-bit | +
pactus-gui_0.16.1_windows_amd64_installer.exe | +Installer | +Windows | +64-bit | +
一旦您下载了帕克图斯GUI,您可以按照本教程设置和运行节点: + 如何以图形模式运行帕克图斯?
+ +高级用户可以以命令行界面(CLI)模式运行帕克图斯。
+ + + +File name | +OS | +Arch | +
---|---|---|
pactus-cli_0.16.1_android_arm64.tar.gz | +Android | +ARM64 | +
pactus-cli_0.16.1_darwin_amd64.tar.gz | +macOS | +64-bit | +
pactus-cli_0.16.1_darwin_arm64.tar.gz | +macOS | +ARM64 | +
pactus-cli_0.16.1_freebsd_amd64.tar.gz | +FreeBSD | +64-bit | +
pactus-cli_0.16.1_freebsd_arm.tar.gz | +FreeBSD | +ARM | +
pactus-cli_0.16.1_linux_amd64.tar.gz | +Linux | +64-bit | +
pactus-cli_0.16.1_linux_arm64.tar.gz | +Linux | +ARM64 | +
pactus-cli_0.16.1_windows_386.zip | +Windows | +32-bit | +
pactus-cli_0.16.1_windows_amd64.zip | +Windows | +64-bit | +
一旦您下载了帕克图斯CLI,您可以按照本教程设置和运行节点: + 如何以命令行模式运行帕克图斯?
+ +高级用户可以从Docker Hub获取帕克图斯docker镜像。
+ +您可以按照本教程使用Docker设置和运行节点: + 如何使用Docker运行帕克图斯?
+ +Pactus Blockchain Version 0.16.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +In this version, the private IP address won’t be advertised, and by default,
+nodes try to find if they have any public IP address.
+If so, they will advertise it. Users can also set the public_address
in the config file.
+This feature specifically helps users who have both public and private IP addresses to always advertise the public addresses.
+Users can still use the private network if they enable the force_private_network
option inside the config file.
+Most users don’t need to change their node’s configuration.
This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.16.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows users to create new addresses for both validators and accounts. +The networking module has been improved, and users can now set limits on the number of connections. +A random crash on the agreement protocol has been fixed in this version.
+ + + +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.1 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version address an unforeseen issue in the consensus protocol. +We kindly ask all validators to upgrade their nodes to this version.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.2 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version allows nodes to set limits on the number of connections they can establish. +By default, each node can have a minimum of 8 connections and a maximum of 16 connections. +Users can easily change these numbers in the configuration file.
+ +This version has been implemented for Testnet-2 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-2, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to download, install and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.15.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ + + +This version is the bootstrap version for +Testnet-2. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Exciting news for the Pactus Community: Testnet-2 is has launched! +The journey through Testnet-1 +brought success and invaluable experiences, with over 500 validators joining the network. +Despite its noteworthy achievements, it also faced challenges that led to a tough decision: to pause the Testnet and +thoroughly address these issues. +After two months of dedicated work and testing, many problems have been resolved, and +we feel confident launching the Testnet again. +Testnet-2 comes with substantial improvements compared to its predecessor by enhancing the core of the Pactus Blockchain. +Notably, the new consensus mechanism and improved overall network performance.
+ +At this point, we want to assure the Pactus community that this version of +the Testnet will not stop until the mainnet launches, +and our main focus is on improving its overall performance and launching the Mainnet.
+ +If you’re new to the concept of Testnet, check out our informative post: +What is the Testnet?
+ +Testnet-2 has important tasks ahead. +Firstly, we aim to confirm that the new consensus mechanism is both safe and efficient. +A close eye will be kept on the network’s performance, ensuring it operates as expected. +For Testnet-2, the committee +size has been expanded to 51 members. +Both the committee’s performance and block production will be closely monitored. +The goal is a blockchain that remains stable and trustworthy, +even with thousands of validators in the network, +ensuring it manages its regular duties seamlessly.
+ +Want to join the Testnet-2? Great! It’s super easy. +Just download the latest Pactus software and you’re good to go. +no fancy setups or special gear needed. +You can run the software straight from your personal computer or laptop. +Need some test coins? Pop over to our Discord channel and share your validator address there.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
]]>In all Blockchain protocols, there is a concept called a consensus mechanism. +This mechanism is used to enable nodes to reach an agreement +on the state of the Blockchain they are +maintaining, in order to have a synchronized and integrated Blockchain.
+ +For now, we have a lot of consensus mechanisms in the Blockchain world. +Pactus Blockchain uses the SSPoS (Solid State Proof of State) which is a new consensus model.
+ +To explain how it works let’s start with explaining one of the first and simplest +consensus mechanisms (or if you already know them, just jump into the last part named SSPoS).
+ + + +In the proof of work model, each node in the network should solve a complex mathematical +problem that requires lots of computing resources to make a new block.
+ +In this way, it’s highly unlikely that anyone would be able to change +past transactions and change Blockchain states such as balances, +without expending equivalent computational power.
+ +By doing this we ensure the security and integrity of the Blockchain.
+ +The concept was adapted from digital tokens by Hal Finney in 2004 +through the idea of “reusable proof of work” using the 160-bit secure hash algorithm 1 (SHA-1).
+ +Bitcoin uses this consensus model.
+ +On the other hand, PoS or Proof of Stake is another consensus mechanism that instead of miners has validators!
+ +Validators lock a number of their assets in the Blockchain and they can transfer or use it +till it is locked which we call staking. +after each Block is committed one of the validators will be chosen randomly (more amount of stake, +more chance to be chosen) when a validator is chosen +it proposes a block and announces it to other nodes to be validated, +when a supermajority of validators accept the block it’s going to be committed.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk losing the stake amount.
+ +More amount of validators in a PoS Blockchain makes it more secure, +decentralized, and trustable, but it also makes the validation and consensus process slower and more difficult.
+ +Ethereum uses this model.
+ +DPoS or Delegated Proof of Stake, is a variant of the PoS consensus algorithm. +users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions +and creating blocks. The number of delegates is limited +to ensure accountability and efficiency in the validation process.
+ +Some Blockchains like Cardano and Tron use DPoS.
+ +DPoS tries to solve the issue of PoS which when validators +increase we have an inefficient validation process. but the main issue with DPoS itself is putting a lot +of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +BUT, HOW ABOUT SSPoS? HOW ABOUT PACTUS?
+ +In Pactus Blockchain, we have something called Solid State Proof of Stake +and we try to fix the previous model’s issue, let me explain.
+ +Pactus uses a dynamic committee of validators with a fixed size of 21, +but the members of the committee randomly change in each round, +based on stake amount the chance of being chosen is higher. on the other hand, +the number of validators out on the committee is unlimited, allowing anyone +to become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm by generating a random number +between zero and the total staked coins. If the number is less +than the validator’s stake, they can enter the committee and replace the oldest committee member.
+ +So, in SSPoS models which are a variant of PoS, we can reach a consensus, +without using high computation resources, having an inefficient +validation process by increasing validator numbers, +and also without breaking the principle of “don’t trust, verify”.
]]>there is several activities in Pactus github in September month, here is a clear report and explain of activities.
+ + + +After starting Pactus Labs and PIPs, +we start implementing each accepted PIP one by one to improve Pactus, here is a list of implemented PIPs:
+ +There is some very good change and new features for Pactus network module, +this list contain a list of important changes in Pactus networking:
+ +We also updated, improved and enhanced gRPC and nanomessage services for better developer experience, +for third-party and side project developers, here is some changes:
+ +We had some not implemented feature request, not fixed bugs and some issue with new golang version, +list of this changes:
+ +]]>In our commitment to transparency and innovation, we’re excited to introduce a major step in Pactus’s journey: +the Pactus Improvement Proposals, or PIPs.
+ + + +Pactus Improvement Proposals (PIPs) define standards for the ongoing development and enhancement of the Pactus platform. +Each PIP has a unique number like PIP-2, +PIP-3, and so on. +These proposals provide technical details for suggested modifications or enactments, serving as a guide for development.
+ +The PIP process is open, allowing any member of the Pactus community to propose a PIP. +The author should provide a summary, motivation, and a detailed technical explanation. +The Pactus Laboratory team will carefully review each PIP. +Security considerations must be addressed before finalizing a PIP. +Once finalized, it can be added to the code. +This process helps avoid unexpected issues during development and maintain consistency and safety.
+ +The Pactus Improvement Proposals (PIPs) was inspired by the +Ethereum Improvement Proposals (EIPs) system, +which had its roots in the Bitcoin Improvement Proposals (BIPs) and +Python Enhancement Proposals (PEPs).
+ +From now on, all major changes or new features in the Pactus project require a PIP. +Any implementation must reference its specific PIP. +Without approval from Pactus Laboratory team, changes won’t be approved and added to the codebase.
+ +For a complete list of Pactus Improvement Proposals, visit this link. +The corresponding GitHub repository is accessible here.
+ +]]>there is several activities in pactus github this month, here is a clear report and explain of activities.
+ + + +one of new changes in pactus project is new linters we added this month. +what is linters? +linters are just a set of rules for the style of source codes, they force developers to write new codes +in correct, clean and safe way.
+ +why we use them? +the reason we are using linters in Pactus and add new ones, is to make the code more safe, +and also make it easy to work on for new contributors because we are focus on being decentralized even in development.
+ + + +one another new change in Pactus is updating TLA+ spec, which is related to consensus, +as you know we had some problem with consensus in Testnet-1, we fixed the issues and now we are trying to make it more clean.
+ + + +if you wish you can learn more about Pactus consensus here.
+ +some of previous Pactus dependencies was so old, so we start refactoring them and use new libraries. +also we used some libraries with higher performance which is make Pactus full node more faster in mainnet.
+ +]]>Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In May 2023, we launched our second Testnet. +The main purpose of this Testnet was to measure block time creation and the responsiveness of the blockchain. +The development team also focused on evaluating the network’s performance. +Additionally, the overall performance of the software and the syncing process were closely examined and assessed.
+ +The committee for Testnet-1 was set to 21 validators, +and 584 validators joined during the Testnet period. +More than 600,000 blocks were created, and more than 1 million transactions were processed during this time. +The size of the blockchain is about 300 megabytes.
+ +About 300,000 coins were staked during this period, it was almost 50% of the total generated coins. +It shows that users, even in Testnet, tend to stake their coins.
+ + + +We were able to extract the confirmation time of transactions. +More than 97% of transactions were confirmed in just one block after submission. +This indicates that the transaction pool and broadcasting models are working fine.
+ + + +Based on logs from one of the validators, the time for creating a block is about 3 seconds in normal cases. +More than 97% of blocks are committed in the first rounds.
+ + + +During Testnet-1, we released three versions(Version +0.11.0, +0.12.0, +0.13.0), and the upgrade process was smooth. +At this time, the development team decided to stop Testnet-1 and work on improvements that are not backward compatible, +including:
+ +After stabilizing the changes, we will announce the next Testnet, and hopefully, this will be the pre-launch Testnet.
+ +This Testnet was important for us. +It helped us learn what we need to do to make Pactus work even better. +Without the community that supports us and dedicates their time and resources to testing and feedback, +we wouldn’t have been able to progress as we have.
+ +we thank all of them for their valuable contributions. +As promised, participants in Testnets will be given priority as validators for the MainNet, and +will receive bounty tokens from the bootstrap accounts to set up their validator.
+ +We are grateful to all those who participated in Testnet-1, and +we encourage them to join our next Testnet to help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
]]>The meeting took place on 09 July 2023, at 2:00 PM UTC via Google Meet, +with team members from different time zones joining to discuss key aspects of the Pactus project.
+ +The meeting began with an overview of the Network module in Pactus. +This module uses Libp2p as its underlying network protocol.
+ +The Network module is agnostic about the content of the message and +handles two types of messages: Gossip messages, which are broadcasted, +and Stream messages, which are sent directly to a specific peer. +The team discussed the relay nodes that enable communication for nodes behind NAT. +Upon receiving a message, the module publishes an event. +The two types of events are Gossip events and Steam events.
+ + + +The team discussed the issue of Relay connections resetting, and explored solutions such as +hole punching or using UDP and IPv6.
+ +Some users in the Testnet reported high network usage. +The team discussed implementing metrics for LibP2P to monitor network usage effectively. +The discussion related to this issue can be found here. +Additionally, the team discussed the customization of network resources, +including setting limits for inbound and outbound connections.
+ +Moving on, the Sync module was discussed. +Unlike the Network module, the Sync module has full knowledge about the messages and packets. +The module handles a range of message types, which can be found +here.
+ +It was suggested that we need to define metrics for each message type. +There was also a discussion about the need for reducing the messages to optimize the use of network resources.
+ +The team decided to continue discussing these topics in future meetings. +They also plan to work on improving the Network and Sync modules based on these discussions.
]]>Pactus as a real Proof of Stake blockchain, has achieved a significant milestone. +More than 500 validators joined the Testnet +in less than 2 months. +This accomplishment proves that Pactus is reliable, resilient, and trustworthy. More importantly, it sets new standards +in the blockchain world. In fact, the Pactus Testnet is even more decentralized than some well-known blockchains.
+ + + +One key reason why Pactus can accommodate more validators is its powerful +consensus mechanism. +The consensus mechanism in Pactus eliminates the need for delegation, making it possible for anyone to become a validator. +Additionally, the user-friendly application ensures that even those new to blockchain can easily contribute to the network.
+ +To remain competitive in the market, Pactus recognizes the importance of prioritizing user space. +We aim to ensure that running Pactus is affordable and accessible to anyone, regardless of their technical expertise or +available resources.
+ +To achieve this, the Pactus team constantly monitors network, storage, and computational usage, striving to keep them +at minimal levels. +By doing so, we enable more individuals to participate in the Pactus blockchain.
+ +Currently, the Pactus team is working on optimizing and reducing network usage. This effort will lead to reduced costs, +especially for users who are using home internet connections.
+ +Furthermore, we are planning to introduce a pruning mode, allowing users to run the Pactus blockchain with significantly +less storage. +Although we believe the storage size is already small, our goal is to enable users to +retain only the most recent blockchain history. +This approach ensures that the blockchain size remains as compact as possible by disregarding some history of the blockchain.
]]>Pactus Blockchain Version 0.13.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +Users can now restore the default_wallet
during the node initialization.
+If users have a backup of the seed phrase (mnemonic) for the default_wallet
,
+they can now restore it and re-initialize the node.
This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.12.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +This version is focused on improving the sync time to make it faster. +This is achieved by implementing a caching mechanism that executes transactions more quickly and +improves the calculation of total power (stake) of the blockchain in a more effective way.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>Pactus Blockchain Version 0.11.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version is the fix for the relay +connection issue. +A relay is a peer in the network that facilitates the connection between two peers, +particularly when they are using home internet.
+ +Another significant update is that sending a Bond transaction +is now more user-friendly. +Users no longer need to set the validator public key if they want to bond Test PAC coins to their validators.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +If you are running an older version, shut it down. +Uninstall the previous version and install the newer version. +If you are using the archived version, simply use the new version.
+ +This version includes several changes and improvements, such as:
+ +You can find the full list of changes on Github, +as well as the source code
]]>The Pactus blockchain Testnet-1 is now available for participation. +This version simulates the Mainnet environment and evaluate the system’s performance, stability, +and security in a controlled environment. +The primary goal of this version of Testnet is to determine the efficient and secure committee size for the Mainnet.
+ +To join the Testnet, download Pactus software +version 0.10.0 and +connect to Testnet without any special configuration or hardware. +You can run the software on your personal computer or laptop. +To acquire test coins, visit the Discord channel and +provide your validator address.
+ +By taking part in the Testnet, users can familiarize themselves with the Pactus blockchain and +be well-prepared for the Mainnet launch. +Testnet participants will also receive higher priority during the Mainnet launch and +get free coins for initial staking on the Mainnet.
+ +User feedback plays a vital role in the improvement of the Pactus blockchain. +Share your thoughts and experiences to contribute to the enhancement of future software versions.
]]>Pactus Blockchain Version 0.10.0 +is now available for download. +This release includes a graphical user interface (GUI) that +is suitable for both beginners and experienced users. +It also includes a command-line interface (CLI) for advanced users and wallet software +that allows users to interact with the blockchain without the need to sync the entire blockchain.
+ +The main update in this version allows users to set up multiple validators in one node. +Users can set up to 32 validators in a single node, and each validator can stake up to 1,000 coins.
+ + + +This version has been implemented for Testnet-1 and +is being prepared for the upcoming Mainnet launch. +To start using Pactus Blockchain Testnet-1, download the latest version from the +download page and join the Testnet.
+ +These guides can help you to run and configure your node:
+ +This version includes several changes and improvements, such as:
+ +GetBlockchainInfo
API in gRPC now returns the total number of validators and accounts (#439)You can find the full list of changes on Github, +as well as the source code
]]>Testnet is a testing environment where developers and users can try out the functionality of a blockchain project, +without putting real assets or data at risk. +It helps to ensure that the final product is reliable and secure for users to use. +If you like to read more about the Testnet you can check out our post on +“What is Testnet?”.
+ +In September 2022, we launched our first Testnet. +The purpose of this Testnet was to +check the consensus protocol, +test different transaction types, +and ensure the stability of the blockchain. +We also wanted to test the sortition algorithm +to make sure it works properly.
+ +The committee +for the Testnet-0 was set to five validators, and more than 19 validators joined during the Testnet period. +Over 2 million blocks were created, and more than 3.2 million transactions were processed during this time. +The size of the blockchain is approximately 1 gigabyte. +The maximum number of transactions recorded in a single block was 386. With a block time of 10 seconds, +we can confirm that Pactus blockchain can support up to 30 transactions per second (TPS), +which is a reasonable number for TPS. Based on real-time statistics available at realtps, +we can see that Pactus is among the top 10 blockchains in terms of TPS.
+ +At this point, the development team decided to end the Testnet-0 and move on to the next one, +Testnet-1. We are planning to run the Testnet-1 to prepare for the MainNet launch. +We will provide updates on our progress and share the details of the new Testnet soon.
+ +As promised, participants in Testnets will be given priority as validators for the MainNet, +and will receive bounty tokens from the bootstrap accounts to set up their validator. +We are grateful to all those who participated in Testnet-0, and we encourage them to join our next Testnet to +help us improve Pactus. +As a community-based project, we rely on the support of our community members, and we value any help we receive.
]]>If you have ever wondered what Testnet is and how it is different from Mainnet, read this article to the end to find out!
+ +Mainnet and Testnet are two widely used terminologies in the Blockchain ecosystem; +so it is important to understand the meaning and differences while working in the industry or +following announcements of the Blockchain projects like Pactus.
+ +Here’s a quick explanation: +Before the actual live version of a Blockchain network that is used for real transactions, +functions and smart-contracts (which is referred as Mainnet), +there is a test version of the Blockchain network for testing purposes (which is referred as Testnet). +In Testnet, a safe environment is provided to help developers experiment and test their applications, +and make sure that everything functions smoothly in the Mainnet version.
+ +A Testnet is a simulation of a Blockchain, in which developers can test all the functionalities of +their Blockchain network without risking their assets and convenience of end-users. +Using Testnet, any possible error, bug or malfunctions can be fixed before the Mainnet launch. +Testnet also can be an experimental environment for new features, updates and upgrades. +So several Testnet networks of the same version or newer version of the Mainnet can be implemented on the roadmap.
+ +A secure environment to test development ideas and updates. +So many features and minor details in Pactus project have been successfully developed so far using the Testnet; such as:
+ +Providing a safe testing ground for resolve scalability and security problems, as well as decentralization issues. +Pactus network is also a secure and purely decentralized network. However in the last updates during the Testnet, +developers are now able to decrease the database size by approximately 10% without compromising performance. +They did it by utilizing block height instead of hash to store blocks within the database. (you can find out more +here).
+ +Testing new versions, patches and features on Testnet. it is vital for enhancing the security, load testing, +Blockchain migration, integration tests, and etc. This is why you can now use the latest version of Pactus-GUI +that works like clockwork and is extremely secure.
+ +Testing the functions of cryptocurrency without disrupting the Mainnet. In the Testnet of Pactus Blockchain, +you as a user or validator can use all the features to send, receive, bond or unbond your assets in the Pactus-GUI.
+ +Development and simulation of smart contract features and DApps. Note that many Blockchain projects like Pactus, +can be used as smart-contract platforms. So the Testnet can be designed in different stages to test and improve +different applications of the network.
+ +Please note that after a certain period of time, when developers get satisfied with the functionality and debugging process, +they launch Mainnet. Mainnet has its own independent genesis blocks; +so the assets and addresses that users use in Testnet are not valid inside the new Mainnet Blockchain anymore. +In fact the whole Blockchain network starts working from the scratch and users and validators start to +work with real tokens and transactions instead of the simulated ones. But since Testnet has an important effect +on the health and improvement of the network, in Pactus Blockchain, we have several advantages +for the people who join the Testnet.
+ +There are different contributors in a Blockchain network; +Some people are developers and programmers that use the Testnet to contribute, enhance and lead the project to a better future. +Testnet is actually vital for them to perform their changes and try their innovations and ideas.
+ +But you might also be an end user; you might want to either be a validator and stake your assets to earn more Pactus coins, +or you might want to learn how to use the network for future personal applications. Either way, +you might find it handy to give it a try and be familiar with Pactus-GUI and its different features.
+ +However, there is another advantage for end users who join the Testnet. +While using the network, running a node or testing the Pactus-GUI in Testnet period, you are contributing to +the community to find improvement potentials, that’s why there are more advantages contemplated for the Testnet users; +Soon our Mainnet will be launched and also Pactus network will be announced and listed in well-known exchanges. +As an early contributor, you will have the advantage of getting some extra initial tokens at the beginning of Mainnet launch. +So that you can use it to run a validator node and earn more from staking your assets. This airdrop is considered +for every individual who installs Pactus-GUI and starts a node in Testnet.
+ +There are other positive conditions you may experience as an early contributor.
+ +An account is an entity that is identified by a unique address, +which can send transactions on the blockchain.
+ +The account structure is 12 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
4 bytes | +Number | +
8 bytes | +Balance | +
The Treasury account is a special account that is defined at the genesis time. +The Treasury account holds the total supply of Pactus coins, which is fixed at 21 million coins, +and each coin is divided into 1 billion units.
+ +In each block, one coin from the treasury account is transferred to the proposer account +as block reward.
+ +This block reward serves as an incentive for validators to propose and validate new blocks on the blockchain. +As a result, the total number of Pactus coins in circulation increases gradually over time as new blocks +are added to the blockchain.
+ +An address is a unique identifier that is used to send and receive transactions on the Pactus blockchain. +It is represented as a string of 42 alphanumeric characters and always begins with the letters “pc1”. +Here is an example of an address on the Pactus blockchain:
+ +pc1p4e92hx0erqyx939crndvthvpn7qcdhefc9r6s7
+
An address in the Pactus blockchain is made up of 21 bytes and it is derived from the public key. +The first byte of the address specifies the address type, +while the remaining 20 bytes represent the hash of the public key. +The hash function used is RIPEMD-160, +which is applied after Blake2b): +The resulting byte array is then converted into a bech32m1 string.
+ + + +The address type specifies the type of the address and its defined as below:
+ +The Treasury address on the Pactus blockchain is a fixed address that is defined as follows:
+ +TreasuryAddress: 000000000000000000000000000000000000000000
+
The address type for the Treasury address is set to zero, which +means there is no key associated with the Treasury address. +The remaining characters of the address are all zeros.
+ +In the Pactus, a block is a set of data that contains a header, the certificate of the previous block +and list of the transactions. +Once a block comes with a valid certificate, it is committed and added to the blockchain, and +the certificate will be included in the next block. +A committed block is immutable, and any modifications to the block will invalidate the certificate.
+ + + +The block header is a data structure in the Pactus blockchain that contains important information about +the block.
+ +The block header is 138 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
1 byte | +Version | +
4 bytes | +Timestamp | +
32 bytes | +Previous Block Hash | +
32 bytes | +State Hash | +
48 bytes | +Sortition Seed | +
21 bytes | +Proposer Address | +
A block certificate is a proof of commitment for the block in the Pactus blockchain. +It is the result of the Pactus consensus algorithm and ensures that the block has been agreed upon by committee members.
+ +The block certificate consists the following fields:
+ +Size | +Field | +
---|---|
4 bytes | +Height | +
2 bytes | +Round | +
Variant | +Committers | +
Variant | +Absentees | +
48 bytes | +Signature | +
Each block in the Pactus blockchain contains a list of transactions. +The maximum number of transactions in a block is determined by the +consensus parameters, and currently set to 1000. +The first transaction in each block is the reward transaction. +Once a block is committed and added to the blockchain, all the transactions inside the block will be executed. +This means that the state of the blockchain will be updated based on the transactions in the committed block.
+ +The block hash is a unique identifier for each block, which is computed by hashing the following data:
+ +The previous certificate hash and the Merkle root hash of transactions are included in the block hash to +ensure that they cannot be modified. +The block hash is used to link the blocks together in the blockchain.
+ +There is no completely empty block in Pactus. +Each block contains at least one transaction, which is the reward transaction.
+ +In the Pactus blockchain, a validator called a Proposer is responsible for collecting all transactions and +creating a block every 10 seconds. +The Proposer broadcasts the proposed block to other validators inside the committee. +Other validators verify the proposed block, and if it is valid, they cast their votes in favor of the proposed block by +signing the combination of the block hash and the consensus round. +More details about the consensus mechanism can be found in the +consensus protocol document.
+ +To issue a valid certificate, signatures from validators who hold more than ⅔ of the stake in +the committee are required. +Once enough votes are collected, the signatures are aggregated and combined into a single signature, and +the certificate is issued.
+ +To verify a certificate for a block, the block hash is computed, and +the aggregated public key can be formed using the Committers and Absentees list. +Then, the signature can be verified using the aggregated public key and +the aggregated signature inside the certificate.
+ +The Pactus blockchain employs various advanced cryptographic algorithms, including hashing and signature schemes, +to protect user data and transactions.
+ +Pactus uses a hashing algorithm called Blake2b. +This algorithm is known for being a fast and secure way of creating unique digital fingerprints of data.
+ +To ensure secure transactions, Pactus uses a signature scheme called +BLS (Boneh–Lynn–Shacham) +threshold signature for cryptographic signing and verification.
+ +One of the advantages of BLS signatures is signature aggregation. BLS individual signatures can be +combined into one single aggregated signature, so that the overall size does not grow beyond one +signature.
+ +BLS signatures have an important property called non-malleability, +which means that it is impossible to generate two valid signatures for the same message. +In other words, each message has a unique signature, and signatures cannot be altered without invalidating the signature.
+ +The Pactus blockchain starts from scratch, with no pre-existing accounts or pre-allocated tokens. +Its starting point is known as the genesis block, which is created by the bootstrap validators.
+ +The Pactus blockchain starts with four bootstrap validators. +These bootstrap validators do not have any stake, however their voting power is set to one within the consensus algorithm. +Their primary role is to initiate the blockchain during a brief period known as the bootstrapping phase. +As the bootstrapping phase progresses, these validators are able to earn rewards, +which they can later use to invite other validators to join the network.
+ +Once the network reaches 21 validators, the bootstrap validators will retire, and +the blockchain will be secured by other validators.
+ +The genesis block is the first block in the Pactus blockchain, and it is created by the bootstrap validators. +This block marks the beginning of the blockchain and serves as the foundation for subsequent blocks.
+ +The previous block hash in the genesis block sets to 0, +indicating that it has no predecessor. +Additionally, the genesis block does not have a previous certificate.
+ +In Pactus, the Genesis Information is pre-defined and indicates the initial state of the network. +These parameters are hardcoded into the project and include:
+ +You can find the pre-defined Genesis Information for the Testnet of the Pactus blockchain in the genesis.json
file,
+which is located in the project repository, here.
++ +The incentive may help encourage nodes to stay honest.
+ + +
In Pactus, rewards are given to validators for proposing and validating new blocks on the blockchain. +These rewards serve as an incentive for validators to participate in the consensus process and +maintain the security and integrity of the network.
+ +To better understand the incentive model in Pactus, let’s compare it with the Bitcoin reward model. +This comparison will help to understand how the incentive model works in Pactus.
+ +Pactus | +Bitcoin | +
---|---|
Consensus engine is Proof of Stake | +Consensus engine is Proof of Work | +
Exactly every 10 seconds one block is minted | +Around every 10 minutes one block is mined | +
Total supply is 21,000,000 coin | +Total supply is 21,000,000 coin | +
Always one coin per block | +Initial block reward is 50 coin | +
No halving | +Halving happens every 4 years | +
The halving mechanism in Bitcoin rewards early contributors more significantly. +However, in a Proof-of-Stake blockchain, this mechanism can lead to wealth centralization, +as early validators gain too much power based on their staked coins.
+ +To promote fairer block rewards, Pactus has introduced a simple and straightforward incentive model called the “Flat Reward.” +In this model, the block reward remains constant at one coin per block and does not change over time.
+ + + + + +In Pactus, the coin distribution is linear. This linear distribution is a direct result of the Flat Reward system. +Unlike other blockchains that have a curved distribution, Pactus maintains a consistent coin distribution.
+ + + + + +Data serialization is the process of converting data into a format that can be easily stored or transmitted over a network. +It typically involves encoding data into a sequence of bytes, which can later be decoded to +reconstruct the original data structure. +Pactus has two methods for data serialization: Deterministic serialization and CBOR serialization:
+ +Pactus uses a deterministic serialization for the deterministic data like blocks and transactions. +The serialization format for different types of data is listed in the table below:
+ +Data Type | +Size (bytes) | +Description | +
---|---|---|
uint8 | +1 | +An 8 bits unsigned integer | +
int8 | +1 | +An 8 bits signed integer | +
uint16 | +2 | +A 16 bits unsigned integer | +
int16 | +2 | +A 16 bits signed integer | +
uint32 | +4 | +A 32 bits unsigned integer | +
int32 | +4 | +A 32 bits signed signed integer | +
uint64 | +8 | +A 64 bits unsigned integer | +
int64 | +8 | +A 64 bits signed signed integer | +
VarInt | +Variable | +A compact representation of an unsigned integer. | +
VarByte | +Variable | +A variable length bytes | +
VarString | +Variable | +A variable length string | +
Address | +21 | +21 bytes of address data | +
Hash32 | +32 | +32 bytes of hash data | +
Variable length integer (VarInt) is encoded by 7-bit chunks. The MSB indicates whether there are
+more octets (1) or it is the last one (0). It means 0x00
to 0x7f
encoded in 1 byte, 0x80
to
+0x3fff
encoded in 2 bytes, …
Example:
+ +0x0f -> 0f
+0x1000 -> 8020
+0xffff -> ffff03
+0xffffff -> ffffff07
+
Variable length byte (VarByte) is encoded as a variable length integer (VarInt) containing the
+length of the array followed by the bytes themselves: VarInt(len(bytes)) || bytes
Variable length string (VarString) is encoded as a variable length integer (VarInt) containing the
+length of the string followed by the bytes that represent the string
+itself:VarInt(len(str)) || str
All the internal number representation are in little-endian byte order.
+ +Here is an example of a block header data that encoded using deterministic serialization:
+ + + + +For non-deterministic data, such as networking messages, Pactus uses +“Concise Binary Object Representation” or CBOR. +CBOR is a binary data serialization format that is widely used in various application, +including IoT, web services, security, and automotive, due to its compact representation and efficient parsing.
+ +cbor.me +is an online tool for encoding and decoding CBOR data, offering developers an easy way to test and +validate their CBOR data without having to set up a local environment.
+ +Here is an example of a vote message that encoded using CBOR.
+ + + + + +The State Hash is used to ensure the integrity of the data in the Pactus blockchain. +It serves as a unique identifier or fingerprint of the current state of the blockchain, +allowing all nodes to verify that their data matches that of the other nodes. +This helps to prevent any tampering or inconsistencies in the data, ensuring the accuracy and consistency of the blockchain.
+ +++ +In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node +is labelled with the cryptographic hash of a data block, and every non-leaf node is labelled with +the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure +verification of the contents of large data structures.
+ +From Wikipedia
+
A Hash tree or Merkle tree is a data structure that used by many blockchains to solve this problem: +“How can data be securely stored and verified in a decentralized network?”
+ +By using a Merkle tree, nodes can easily verify that they store the same data +without having to share the entire dataset. Additionally, this helps to prevent any tampering with the data, +as any changes made to the data would cause inconsistencies in the Merkle tree and +can be easily detected by the network.
+ +In Pactus, the Merkle tree is used to verify the state of the blockchain in each block. +The state hash in each block is calculated by taking the hash of two Merkle trees: +the accounts Merkle tree and the validators Merkle tree. +Each leaf in these trees contains the hash of the associated account or validator. +By using the state hash, all nodes in the network can ensure they have the same data stored.
+ + + +Using a Merkle tree to calculate the state of the blockchain can be challenging +because when the number of accounts is large, calculating the root hash can be difficult. +In other words, a simple Merkle tree may not be scalable because calculating all the leaf +and node hashes requires a significant amount of computation.
+ +In Pactus, all accounts and validators have unique and sequential numbers. +This means that each account and validator has a dedicated account number that helps us to +calculate the hash of leaf nodes in the Merkle tree. +By using these account numbers, we can ensure that the position of the leaf nodes in +the Merkle tree is always the same. +This approach allows us to avoid rebuilding the Merkle tree whenever an account or validator’s state changes. +Instead, we can save the previous Merkle tree and recalculate the parent hashes by +fetching neighbor hashes as needed. +This helps to ensure scalability and reduces the computational resources required for recalculating the Merkle tree.
+ + + +In this example, only account 6 has been updated. +By locating the corresponding leaf node in the existing Merkle tree and +traversing the tree towards the root node, we can calculate new root hash. +This approach has a complexity of \(O(log n)\), making it efficient for large numbers of accounts.
+ +A Validator is an entity that participates in the consensus process by sharing its votes. +Validators get rewarded for creating new blocks, and to become a Validator, +they must “bond” or lock up a certain amount of coins as stake. +The amount of stake held by validators determines their power in the consensus.
+ +The Validator structure is 120 bytes long and consists the following fields:
+ +Size | +Field | +
---|---|
96 bytes | +Public Key | +
4 bytes | +Number | +
8 bytes | +Stake | +
4 bytes | +Last Bonding Height | +
4 bytes | +Unbonding Height | +
4 bytes | +Last Joined Height | +
The committee is a group of 51 validators responsible for generating new blocks. +Validators in the committee participate in the consensus algorithm by casting votes, +with their voting power determined by their stake. +While in the committee, validators cannot send Bond or Unbond transactions, +meaning their voting power remains the same. +The members of the committee changes randomly over time through Sortition transactions. +Each block can contain zero or more Sortition transactions.
+ +These rules are applied when committing sortition transactions:
+ +Proposer selection within the committee operates on a deterministic, clockwise rotation system. +If a validator is unable to propose, for any reason, it stays within the committee, but +the proposer’s role shifts to the next validator in the committee.
+ + + +When a new validator joins the committee, they take a position before the current proposer. +After the addition of a new validator, the committee adjusts to maintain the total number of validators at 51. +This is achieved by removing the oldest validator from the committee, +i.e., the one that has been in the committee for the longest time.
+ + + +For an adversary to take control of the committee, they would need to control more than ⅔ of the stake within the committee. +To assess the security of the committee, let’s assume all validators in the committee have the same voting power. +In this case, an adversary would need to control more than ⅔ of the validators in the committee.
+ +Now, let’s imagine an adversary holds 10% of the total stake. +As a result, one of their validators can enter the committee every 10 blocks. +In the first 10 blocks, one of the adversary’s validators enters the committee. +In the next 10 blocks, another validator enters the committee, giving the adversary two validators within the committee. +In the subsequent 10 blocks, another validator enters, but at the same time, the first validator leaves the committee. +Therefore, an adversary with 10 10% of the total stake can have, on average, two validators in a committee of 51 validators.
+ +Using the Poisson distribution, +we can estimate the probability of an adversary controlling ⅔ of the committee:
+ +Adversarial Stake | +Committee size | +⅔+ of committee | +Adversarial committee members | +Probability of controlling ⅔+ | +
---|---|---|---|---|
15% | +21 | +15 | +3 | +\(5.46 \times 10^{-07}\) | +
15% | +55 | +35 | +7 | +\(3.34 \times 10^{-14}\) | +
15% | +99 | +67 | +14 | +\(1.41 \times 10^{-24}\) | +
10% | +21 | +15 | +2 | +\(3.39 \times 10^{-09}\) | +
10% | +55 | +35 | +5 | +\(1.90 \times 10^{-18}\) | +
10% | +99 | +67 | +9 | +\(2.91 \times 10^{-35}\) | +
5% | +21 | +15 | +1 | +\(2.81 \times 10^{-13}\) | +
5% | +55 | +35 | +2 | +\(4.50 \times 10^{-31}\) | +
5% | +99 | +67 | +4 | +\(1.09 \times 10^{-56}\) | +
The height at which the validator joined the committee is recorded as the “Last Joined Height” field in +the validator structure. +Once a validator enters the committee, this field is set to the current height it +evaluated the sortition proof.
+ +A validator within the committee can run the sortition algorithm. +If they generate a valid sortition transaction, the height of their entry into the committee is set +to the current block height, allowing them to stay in the committee for a longer period.
+ +Consensus parameters are a set of configurable settings that determine how the Pactus blockchain operates. +These parameters are agreed upon by all validators in the network, +ensuring that validators behave in the same way and that the network operates consistently.
+ +Here is the list of the consensus parameters:
+ +Proof of Stake is a way to secure a blockchain through requesting users to stake some amount of their coins. +These stakeholders, called validators, are responsible to collect, validate and add transactions to the blockchain. +The validators will be rewarded with native coins.
+ +Unlike Proof of Work, which is based on competition, Proof of Stake is based on collaboration. +Validators work together to manage the expansion of the blockchain. +A Proof of Stake blockchain becomes more decentralized and secure as more validators participate in it.
+ +To understand how Proof of Stake works, imagine a community bank without any centralized authority. +In this bank, users decide to run it together. +Some of these users volunteer to collect, validate, and record transactions, +ensuring that everything runs smoothly.
+ +These volunteers, known as validators, must temporarily lock or freeze some of their money as a stake. +This stake can’t be transferred or used. +The more money a validator stakes, the more influence they have in the system.
+ +From time to time, one of the validators is chosen by the others to collect all the recent transactions, +bundle them together, and send a copy to the other validators. +If a supermajority of the validators agree with the proposed bundle by signing it, +the bundle will be committed to the bank’s ledger.
+ +In this system, validators have no incentive to behave maliciously or dishonestly. +If they do, they risk harming the bank’s reputation and the value of their own stakes as well.
+ +In Proof of Stake, if the number of validators increases, +the voting time will also increase, and this can lead to an inefficient consensus mechanism. +In our community bank example, running the bank becomes more difficult as the number of validators increases.
+ +To solve this problem, some blockchains use the concept of “delegators”. +In Delegated Proof of Stake, users entrust their stakes to a small group of “delegates”. +These delegates are responsible for validating transactions and creating blocks. +The number of delegates is limited to ensure accountability and efficiency in the validation process.
+ + + +The delegation model puts a lot of trust in the hands of a small number of delegates, +which goes against the principle of “don’t trust, verify”.
+ +Pactus introduced a mechanism that doesn’t rely on delegation, we call it Solid State Proof of Stake. +It utilizes a dynamic committee of validators +that are responsible for creating new blocks. +The size of the committee is fixed, but the members of the committee are randomly changed. +On the other hand, the number of validators outside the committee is unlimited, allowing anyone to +become a validator by staking coins.
+ +At each block, validators participate in a sortition algorithm +by generating a random number between zero and the total staked coins. +If the number is less than the validator’s stake, they can enter the committee and replaces the oldest committee member.
+ + + +The chance of entering the committee depends on the validator’s stake and luck. +But on average, one validator should enter the committee in each block.
+ +Pactus consensus algorithm is a state machine +replication with Byzantine fault tolerance. +The Pactus consensus algorithm starts with the block creation phase. +In this phase one validator acts as the proposer. The proposer collects all the transactions, +creates a block, and proposes it to other validators.
+ +When a proposed block is seen by other validators, they validate the block and +cast their vote for the proposed block, moving to the “prepare” state.
+ +If more than two-thirds (⅔) of the total stakes cast their votes, the proposed block becomes prepared, +and validators move to the “precommit” state.
+ +If, once again, more than two-thirds (⅔) of the total stakes cast their vote for the prepared block, +the block is committed, and the next proposer is ready to propose a new block. This cycle repeats every 10 seconds.
+ +If a proposer fails to propose in any round, other validators start the “change proposer” phase to +decide to change the proposer for this round.
+ + + +There are \(R = 3f+1\) validators. where \(f\) is the maximum +number of validators that may be faulty or byzantine. For example, if there is one faulty validator, +the resiliency of the algorithm is optimal if we have at least \(3\) non-faulty +validators. So the minimum number of validators should be \(3+1=4\).
+ +We denote a message as \(\langle m \rangle\) tuple and a signed message by node \(i\) as +\(\langle m \rangle_{\sigma_i}\).
+ +Pactus consensus algorithms has two phases: Block creation phase and change proposer phase.
+ +The block creation phase in Pactus consensus algorithm includes these three steps1: +Propose, Prepare and Precommit. +The protocol proceeds in rounds \(r = 0, 1, 2, \ldots\).
+ +In each round \(r\), one validator is the proposer and the others act as validators. +The proposer \(p\) collects transactions and creates a proposal block \(B\). It signs and +broadcasts a proposal message with the proposed block piggybacked to all the validators. +Propose message has this form:
+ +\[\langle \langle \text{PROPOSE},h,r \rangle_{\sigma_p}, B \rangle\] + +where:
+ +If validator \(i\) accepts the proposal, it enters prepare step and signs and +broadcasts prepare message to all other validators. Otherwise, it does nothing. +The prepare message has this form:
+ +\[\langle \text{PREPARE},h,r,d \rangle_{\sigma_i}\] + +where:
+ +If validator \(i\) received \(2f+1\) prepare messages from other +validators (including its own), it becomes prepared and enters to precommit step.
+ +In precommit step, validator \(i\) signs and broadcasts precommit message to +the other validators. +The precommit message has this form:
+ +\[\langle \text{PRECOMMIT},h,r,d \rangle_{\sigma_i}\] + +Each validator executes and commits block \(b\) after receiving +\(2f+1\) precommit messages (including its own) and becomes committed.
+ +Each validator that receives a valid proposal and with \(2f+1\) precommit messages from other +validators (including its own), can create a block-announce messages and broadcasts it to the network. +The block-announce message has this form:
+ +\[\langle \text{BLOCK-ANNOUNCE} ,h ,r ,B, C \rangle\] + +where:
+ +Validators can move to the next height and clear the message logs after receiving valid +block-announce message, even if their timer has expired.
+ +The picture below shows the operation of the algorithm in the normal case. validator 1 is the +proposer and validator 4 is faulty.
+ + + +The change-proposer provides liveness by allowing the system to make progress when the proposer fails. +The change-proposer phase is triggered by timeouts that +prevent validators from waiting indefinitely for the proposal to execute.
+ +If the timer of a validator expires in round \(r\), the validator starts a change-proposer phase. +The change-proposer phase is an Asynchronous Byzantine Binary Agreement (ABBA) 2 that is biased toward zero (No). +It means that during this phase, even if they don’t have the proposal, honest validators may decide to vote zero +if they obtain a valid quorum Certificate for the prepare step.
+ +If a supermajority of the validators decide to change the proposer, they move to round r+1r+1. However, +if they decide not to change the proposer, they will return to the prepare state and, +since a supermajority of the validators attested to a valid proposal, they can commit the proposed block.
+ +The change proposer phase in Pactus consensus algorithm includes these three steps: +Pre-vote, Main-vote and Decide +The protocol proceeds in rounds \(r_{cp} = 0, 1, 2, \ldots\).
+ +In Pre-vote step each validator casts a pre-vote for a value \(b \in \{0, 1\}\) +and broadcasts pre-vote message to the network. +The pre-vote message has this form:
+ +\[\langle\langle \text{CP:PRE-VOTE},h,r,r_{cp},b \rangle_{\sigma_i}, justification\rangle\] + +The first round is a special round and each validator starts with an initial value. +If the validator’s timer has expired in the prepare step, its initial value is zero, +and if the validator’s timer has expired in the precommit step, its initial value is one.
+ +\[b = \begin{cases} +1 & \text{if timer expired in prepare step,} \\ +0 & \text{if timer expired in precommit step.} +\end{cases}\] + +In the next rounds, each validator select \(2f+1\) properly justified main-votes from round \(r − 1\) and
+ +\[b = \begin{cases} +0 & \text{if there is a main-vote for 0,} \\ +1 & \text{if there is a main-vote for 1,} \\ +0 (biased) & \text{if all main-votes are abstain.} +\end{cases}\] + +These pre-votes must be justified with a appropriate justification. +For the first round, if the validator’s timer has expired in the prepare step, the justification is \(nil\) , +and if the validator’s timer expired in the precommit step, +the justification is the proper quorum certificate for the prepare step at round \(r\).
+ +In the next rounds, a pre-vote for \(b\) may be justified in two ways:
+ +After collecting \(2f+1\) valid and justified pre-votes, each validator casts a main-vote \(v \in \{0, 1, abstain\}\) +and broadcasts main-vote message to the network. +The main-vote message has this form:
+ +\[\langle\langle \text{CP:MAIN-VOTE},h,r,r_{cp},v \rangle_{\sigma_i}, justification\rangle\] + +The main-vote value \(v\) determine as below:
+ +\[v = \begin{cases} +0 & \text{if there are 2f+1 pre-vote for 0,} \\ +1 & \text{if there are 2f+1 pre-vote for 1,} \\ +abstain & \text{if there are pre-votes for 0 and 1.} +\end{cases}\] + +These main-votes must be justified with a appropriate justification. +A main-vote for \(v\) may be justified in two ways:
+ +After collecting \(2f+1\) valid and justified main-votes, each validator examines these votes. If all +votes are for a value \(b \in \{0, 1\}\), then the validator decides \(b\), but continues to +participate in the protocol for one more round. Otherwise, the validator proceeds to the next round \(r_{cp}+1\).
+ +Pactus consensus protocl doesn’t have any lcoking mechanism or +checkpointing and there will at most one valid proposla per round. +This ensures that each round can begin with a new proposal.
+ +Protocol | +Normal case | +Faulty case |
+ ||
---|---|---|---|---|
Steps | +Complexity | +Locking | +Checkpointing | +|
PBFT | +3 | +$$O(n^2)$$ | +No | +Yes | +
Tendermint | +3 | +$$O(n^2)$$ | +Yes | +No | +
HotStuff | +4 | +$$O(n)$$ | +Yes | +No | +
Pactus | +3 | +$$O(n^2)$$ | +No | +No | +
References:
+ + + +The sortition algorithm is an important part of the Pactus blockchain, responsible for the fair, transparent +and random selection of validators to join the committee. +It utilizes a Verifiable Random Function, or VRF for short, to generate a verifiable random number.
+ +The generated random number should be in the range of 0 to the total staked coins. +If validators can prove that their generated number is less than their stake, +they can send the sortition transaction. +Once a sortition transaction is included in a block, the validator will join the committee, +and the oldest validator in the committee will leave it.
+ +Verifiable Random Function is a pseudo-random function that the owner of key \(s\) can evaluate \(v = f_s(x)\) and also provides +\(proof_{x}\) efficiently proving that \(v\) is correct. We call such a mathematical +object a verifiable pseudo-random function, VRF for brevity 1.
+ +Pactus uses the BLS signature scheme as the source of VRF. +Since BLS signatures are unique, +the hash of a BLS signature can be used to produce a secure and verifiable random number.
+ +The VRF takes three parameters:
+ +Once the VRF is executed, it produces an index with a proof. +The index is a number between zero and the total staked coins, and the proof allows other validators to verify the correctness +of the generated index.
+ +The pseudocode below demonstrates the evaluation of the VRF for the sortition algorithm:
+ +\[\begin{align*} +& \textbf{function} \ VRF(sk, seed, total\_stake) \\ +& \qquad pk \gets P_{BLS}(sk) \\ +& \qquad proof \gets S_{BLS}(sk, seed \| pk) \\ +& \qquad rnd \gets H(proof) \\ +& \qquad index \gets \frac{(rnd \times total\_stake)}{2^{256}} \\ +& \qquad \\ +& \qquad \textbf{return} \ index, proof \\ +& \textbf{end function} +\end{align*}\] + +where:
+ +To verify a sortition proof, both the validator’s public key and stake are required:
+ +\[\begin{align*} +& \textbf{function} \ verifyVRF(pk, seed, proof, stake, total\_stake) \\ +& \qquad \textbf{if} \ V_{BLS}(pk, seed \| pk, proof) = True \ \textbf{then} \\ +& \qquad \qquad rnd \gets H(proof) \\ +& \qquad \qquad index \gets \frac{(rnd \times total\_stake)}{2^{256}} \\ +& \qquad \\ +& \qquad \qquad \textbf{return} \ index \leqslant stake \\ +& \qquad \textbf{else} \\ +& \qquad \qquad \textbf{return} \ False \\ +& \qquad \textbf{end if} \\ +& \textbf{end function} +\end{align*}\] + +where:
+ +There is no need to send \(index\) alongside \(proof\) because the +result should be less than the validator’s stake, and the validator’s stake is known at each block.
+ +The sortition algorithm relies on a random and publicly verifiable seed that cannot be manipulated by adversaries. +Otherwise, adversaries may select a seed that favors the selection of corrupt users.
+ +To prevent this, the BLS signature scheme is used to generate the sortition seed. +Since BLS signatures are unique and deterministic, adversaries cannot generate more than one valid signature per block. +In each block, the block proposer generates a new sortition seed based on the previous seed using the following function:
+ +\[\begin{align*} +& \textbf{function} \ generateSeed(sk, prev\_seed) \\ +& \qquad \textbf{return} \ S_{BLS}(sk, H(prev\_seed)) \\ +& \textbf{end function} +\end{align*}\] + +Since the proposer’s public key is known, the seed for the next block can be easily verified. +If the seed is invalid, the proposed block will be rejected. +The verification function is as follows:
+ +\[\begin{align*} +& \textbf{function} \ verifySeed(pk, prev\_seed, seed) \\ +& \qquad \textbf{return} \ V_{BLS}(pk, H(prev\_seed), seed) \\ +& \textbf{end function} +\end{align*}\] + +The sortition seed for the genesis block set to 0.
+ +The Sortition probability refers to the expected number of validators that may join the committee in each block, +assuming all validators are actively online and executing the sortition algorithm.
+ +The probability of a validator \(i\) being selected depends on their stake relative to the total stake in the system:
+ +\[p_i=\frac{S_i}{S_t}\] + +where:
+ +Therefore, the expected number of validators joining the committee at each block can be represented as:
+ +\[P=\sum_{i=1}^{n}{p_i}=\sum_{i=1}^{n}{\frac{S_i}{S_t}}=\frac{S_1+S_2+\ldots+S_n}{S_t}\] + +where \(n\) is the total number of validators. We know that \(S_t={S_1+S_2+\ldots+S_n}\). Therefore we will have:
+ +\[P=\frac{S_t}{S_t}=1\] + +Thus, on average, we expect one validator to join the committee at each block. +In practice, the actual number of validators joining the committee in each block +may differ due to the randomness in the sortition algorithm, or the possibility of some validators being offline.
+ +The total staked coin in each block is calculated by summing the staked coins of all active validators. +An active validator is a validator that has not yet unbonded.
+ +The height at which the validator joined the committee is recorded as the “Last Joined Height” field in +the validator structure. +The validator with the lowest “Last Joined Height” is considered the oldest.
+ +Developing distributed and concurrent systems is a complex task that requires careful attention to the details. +Testing such systems is challenging because it’s difficult to simulate all possible states, +including those that can happen due to system failures, network latency, and other factors. +This makes it hard to ensure that the system behaves correctly in all circumstances.
+ +Therefore it’s essential to have a proactive approach that involves modeling the system’s behavior in a formal way. +Such an approach can help identify potential issues before they occur, saving time and preventing costly flaws.
+ +TLA+ is a formal specification language developed by +Leslie Lamport based on the idea of +specifying systems using simple mathematics. +It is used for designing, modelling, documentation, and verification of programs, especially concurrent and +distributed systems. +TLA+ and its tools are useful for eliminating fundamental design errors, which are hard to find and +expensive to correct in code.
+ +To know more about TLA+, check The TLA+ Home Page.
+ +Pactus consensus specification +has written in TLA+ format. It includes all invariants that can be held +in every state of every execution that the protocol allows. The TLA+ specification is compiled into +PDF file.
+ +By defining some invariants we can ensure the safety of the consensus +protocol in any possible and +distinct state, and therefore we have the informal safety proof of the Pactus consensus protocol using TLA+.
+ +Checking the liveness is not easy, but with defining some constraints, we have the informal proof of +liveness of Pactus consensus protocol using TLA+.
+ +在这里,您可以找到帕克图斯项目的技术文档。
+ +Ethereum friendly blockchains keep storage in a separate key/value database per request. This has +some drawbacks:
+ +Here we discuss how we can address the above issues by dedicating a separate file as Storage +File per smart contract. In this scenario, users should purchase the storage file with required +capacity before deploying the smart contract. Once the purchase is done, a separate empty file will +be created and dedicated for the user. The size of the file is the same as the purchase size. For +example users can purchase 10 MB or 120 MB of storage files depending on their need and renew them +yearly.
+ +Each storage file has three parts: Header, ByteCodes and contract storage.
+ + + +The Header of the storage file keeps some meta data like storage file index, last payment time, +total storage size, etc. In the ByteCodes section the byte codes of the smart contract will be saved +and in the storage section, the actual storage of the smart contract will be stored.
+ +Smart contracts can only change data in storage sections. To achieve that the smart contract +executer (virtual machine) should introduce these APIs:
+ +/// This API requests the host to read the slice of `data` from the storage file
+/// at the given `offset`.
+fn read(&self, offset: u32, data: &mut [u8]) -> Result<(), HostError>;
+
+/// This API requests the host to write the slice of `data` into the storage file
+/// at the given `offset`
+fn write(&self, offset: u32, data: &[u8]) -> Result<(), HostError>;
+
+
These APIs are similar to SLoad
and SStore
opcodes in Ethereum Virtual Machine (EVM). But
+instead of key and value, they accept offset and data parameters.
In order to allocate storage space safely and efficiently user can use these predefined methods:
+ +/// Allocates storage space with the specific `length` and returns the
+/// offset of allocated space in the storage file.
+pub fn allocate(&self, length: u32) -> Result<Offset, Error>;
+
+/// Deallocates the storage space at the specific `offset` and `length`
+pub fn deallocate(&self, offset: Offset, length: u32) -> Result<(), Error>;
+
There is a fixed stack with 32 elements at the beginning of the storage . The first item in this +stack is reserved and used for managing deallocated storage spaces. Users can use other stack items +to keep the offset of the allocated spaces for the smart contract variables.
+ + + +Usually in smart contracts developers are interested in data collections like Search Trees or Hash +Tables to look up values by the associated keys. Most programming languages come up with some +builtin collections, however we can’t use them in smart contracts because they use RAM that is +inconsistent. However we can have storage equivalent of these data collections that instead of +dealing with memory they are dealing with the storage file. You can naively consider storage as +dedicated consistent memory for the smart contract.
+ +Right now these data collection is available to use inside the smart contract: StorageVector
,
+StorageString
, StorageLinkedList
, StorageBST
and StorageHasTable
.
To make sure all the nodes have the same state we need to calculate the hash of all storage files. +Merkle tree can help us to easily calculate the root hash very fast. We need two Merkle trees, one +for calculating the root hash of each storage file and the second for calculating the root hash of +all storage files.
+ +We can divide each file into small chunks of data and calculate the hash of each chunk once. Since +we know exactly which chunk has changed after executing the smart, contract we can easily +reconstruct the tree and calculate the merkle root again.
+ +Each file has a unique index. With using that index we can make sure that the position of the leaf +nodes in the Merkle tree is always the same. The same technique we used for calculating the +state hash.
+ + + +As an example we have implemented the ERC20 smart contract based on this idea. The implementation +can be found here
+ +One of the consequences of Storage as File is that testing smart contracts becomes easier. What we +need is only to mock the storage file.
+ +Bond transaction is used to bond stake to a validator. +If the validator does not exist, it will be created. +Once a bond transaction committed, the validator cannot participate in the +sortition algorithm for 1 hour. +This is called the “bond interval” and is defined in the +consensus parameter.
+ +The bond transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
96 bytes (optional) | +Public key | +
8 bytes | +Amount | +
Transaction fees in the Pactus blockchain are calculated using a percentage-based fee model. +The fee is a percentage of the transferred amount, within a minimum and maximum range. +The percentage, minimum fee, and maximum fee parameters are part of the blockchain +consensus parameters.
+ +The formula to calculate the transaction fee is as follows:
+ + + +\[\begin{align*} +fee = amount \times percentage \\ +\\ +fee = +\begin{cases} + & fee_{min} & \textbf{ if } \ fee < fee_{min} \\ + & \\ + & fee_{max} & \textbf{ if } \ fee > fee_{max} \\ + & \\ + & fee & \textbf{otherwise} + \end{cases} +\end{align*}\] + +Currently, the fee fraction or percentage is set to 0.01%, the minimum fee is set to 0.000,001 coin, +and the maximum fee is set to 0.001 coin.
+ +Transactions in Pactus consists the following fields:
+ +Size | +Field | +
---|---|
1 byte | +Version | +
4 bytes | +Lock Time | +
8 bytes | +Fee | +
Variant | +Memo | +
1 byte | +Payload Type | +
Variant | +Payload Data | +
48 bytes | +Signature | +
96 bytes | +Public Key | +
The payload type field determines the format of the payload data field in the transaction. +Different payload types have different formats for the payload data. +The following are the supported transactions in Pactus blockchain:
+ +The Transaction ID is a unique identifier for a transaction on the blockchain. +It is generated by taking the hash of the transaction data without including the public key and signature fields.
+ +Sortition transaction is used to enter a validator +in the committee. +By committing a sortition transaction, the validator will enter the committee. +Sortition transactions are valid for 7 blocks, which is defined as “sortition interval” in the +consensus parameters.
+ +The sortition transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Address | +
48 bytes | +Sortition Proof | +
Validators do not need to pay a fee for sortition transactions, and the fee should be set to zero.
+ +Transfer transaction is used to transfer coins between the accounts. +If the receiver account does not exist, it will be created.
+ +The transfer transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
8 bytes | +Amount | +
The reward transaction is the first transaction in each block. There is only one reward transaction +per block, and it has the same format as a transfer transaction, but with zero fees and no signature.
+ +The sender address is the Treasury address, +and the receiver address is defined by the block proposer. +The amount of the reward transaction should be equal to the +block reward plus transaction fees. +This amount will go to the proposer account as a block reward. +Therefore, in each block, one coin from the +Treasury account transfers to +the proposer account as a block reward.
+ +Unbond transaction is used to unbond a validator. +An unbonded validator cannot participate in the sortition algorithm anymore, and after 21 days, the stake can be withdrawn. +This is called the “unbond interval” and is defined in the consensus parameter.
+ +The unbond transaction has a payload consists the following field:
+ +Size | +Field | +
---|---|
21 bytes | +Validator address | +
Withdraw transaction is used to withdraw the staked coins from an unbonded +validator
+ +The withdraw transaction has a payload consists the following fields:
+ +Size | +Field | +
---|---|
21 bytes | +Sender address | +
21 bytes | +Receiver address | +
8 bytes | +Amount | +
在这里,您可以找到一些指南,帮助您使用和与帕克图斯区块链进行交互。
+ +Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). +This tutorial will guide you through the steps to run Pactus in CLI mode, suitable for advanced users.
+ +Before proceeding with the steps below, ensure that you have the following:
+ +To get started, download and extract the Pactus CLI file from +here.
+ +Now you need to create a wallet and setup a working directory for your node. +A working directory is a place where you save blockchain data and wallets. +Open the Terminal and run the following command:
+ + +./pactus-daemon init -w ~/pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus
.
./pactus-daemon init -w ~/pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus
.
pactus-daemon.exe init -w c:\pactus --testnet
+
This command creates your wallet and setup the working working directory at c:\pactus
.
Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future +in case your computer is lost, damaged, or stolen.
+ +The working directory contains:
+ +Feel free to take a look at these files.
+ +Now you can start the node and sync with the network. Run the following command in the Terminal:
+ + +./pactus-daemon start -w ~/pactus
+
./pactus-daemon start -w ~/pactus
+
pactus-daemon.exe start -w c:\pactus
+
When the Pactus node starts running, it begins syncing with the network. +This process may take some time, as your node needs to download and verify the entire blockchain history. +Please be patient while your node syncs.
+ +To become a validator and participate in the +consensus algorithm to earn rewards, you first need to +stake some coins. In the next +tutorial, +we will explain how to send a Bond transaction to become a validator.
+ +By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +Docker is a tool that simplifies the process of creating, deploying, and running applications using containers. +With containers, developers can bundle all the necessary parts of an application, including libraries and dependencies, +and deploy them as a single package.
+ +In this document, we will guide you on how to run Pactus using Docker, step by step.
+ +The only thing you need is installing docker in your machine. +If you are using Windows please make sure you have installed WSL.
+ +The Pactus docker images are available at Docker Hub. +You can pull the latest image with this command:
+ +docker pull pactus/pactus
+
Now you need to create a wallet and setup a working directory for your node. +A working directory is a place where you save blockchain data and wallets. +Open the Terminal and run the following command:
+ + +docker run -it --rm -v ~/pactus/testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus/testnet
.
docker run -it --rm -v ~/pactus/testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at ~/pactus/testnet
.
docker run -it --rm -v c:\pactus\testnet:/pactus pactus/pactus init -w /pactus --testnet
+
This command creates your wallet and setup the working working directory at c:\pactus\testnet
.
Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future +in case your computer is lost, damaged, or stolen.
+ +The working directory contains:
+ +Feel free to take a look at these files.
+ +Now you can start the node and sync with the network. Run the following command in the Terminal:
+ + +docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
docker run -it -v c:\pactus\testnet:/pactus -p 8080:8080 -p 21777:21777 --name pactus-testnet pactus/pactus start -w /pactus
+
To run pactus-testnet in background just add a -d flag in the command.
+ +Hint: Remember to pass in your wallet passphrase as well with -p flag after /pactus.
+ +docker run -it -v ~/pactus/testnet:/pactus -p 8080:8080 -p 21777:21777 -d --name pactus-testnet pactus/pactus start -w /pactus -p {YOUR_PASSPHRASE}
+
docker run -it -v c:\pactus\testnet:/pactus -p 8080:8080 -p 21777:21777 -d --name pactus-testnet pactus/pactus start -w /pactus -p {YOUR_PASSPHRASE}
+
You can stop/start docker:
+ +docker stop pactus-testnet
+docker start pactus-testnet
+
Or check the logs:
+ +docker logs pactus-testnet --tail 1000 -f
+
By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). +This tutorial will guide you through the steps to run Pactus in GUI mode, suitable for beginner to advanced users.
+ +Before proceeding with the steps below, ensure that you have the following:
+ +Download the Pactus GUI installer or archived file from +here.
+ +Windows and macOS users may encounter a warning message stating that Pactus is an untrusted application. +This is because Pactus does not have a +code signing certificate.
+ + + +A code certificate is a digital signature that verifies the identity and authenticity of the software publisher. +However, obtaining a code certificate is complex and expensive process, and requires registering a company and +passing Know Your Customer (KYC) checks.
+ +As Pactus is an open-source and community-based application, we don’t have a code certificate yet. +Therefore, you can safely ignore the warning message and proceed with installing Pactus.
+ +To install Pactus GUI, simply follow the on-screen instructions provided by the installer. +The process is straightforward and similar to installing any other application on your computer.
+ + + +When you run Pactus for the first time, a wizard dialog will appear to guide you through the wallet creation and +initialization process. This process consists of several steps:
+ +On the first page, you will ask you how you want to create your wallet. +Select the option to “Create a new wallet from scratch” and proceed to the next page.
+ + + +The next page will display your wallet seed phrase, which consists of 12 words. +It is essential to securely back up this seed phrase, as it is required for wallet recovery +in case your computer is lost, damaged, or stolen.
+ + + +Warning: Keep your wallet seed phrase private and secure. +If someone else gains access to your seed phrase, they can control your wallet and funds.
+ +In this step, you will be asked to confirm your seed phrase. +Input the 12 words you received in the previous step into the dialog. +If the seed phrase is entered correctly, you will be able to proceed to the next page.
+ + + +On this page, you will be asked to set a password for your wallet. +Enter a strong password in the first dialog box and confirm it in the second one. +This password will be used to encrypt your wallet and protect it from unauthorized access.
+ + + +Note: Choose a strong password and keep it safe. +If you forget or lose your password, you will need your seed phrase to regain access to your wallet.
+ +Each node in the Pactus blockchain can run up to 32 validators, and each validator can stake up to +1000 coins. Here, you can define how many validators you want to create for your node. +Select the number of validators based on the amount of coins you want to stake.
+ + + +If you want to stake more than 32,000 coins, you need to set up a new node.
+ +The last page of the initialization process shows the node information, such as the working directory, validator address, +and reward address. Review this information and click “Close” to complete the initialization process.
+ + + +Upon closing the wizard dialog, your Pactus node will start running. You are now ready to use Pactus in GUI mode.
+ +After completing the initialization process, you are ready to run the Pactus node. +Running a Pactus node allows you to synchronize with the network, enabling you to view and manage your wallet and +sending transactions.
+ +When the Pactus node starts running, it begins syncing with the network. This process may take some time, +as your node needs to download and verify the entire blockchain history. +Please be patient while your node syncs.
+ + + +You can check the “Default Wallet” tab to access your wallet information. Please note that the displayed +information may not be accurate until the syncing process is complete.
+ + + +In the “Default Wallet” tab, you can view your account details, including your balance and +address information such as the validator and reward addresses. +Your computer acts as a node and is recognized by the validator address in the Pactus network. +The reward address is the account address where you collect the +rewards earned by participating in +the consensus algorithm and proposing new blocks.
+ +To become a validator and participate in the +consensus algorithm to earn rewards, you first need to +stake some coins. In the next +tutorial, +we will explain how to send a Bond transaction to become a validator.
+ +By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. +Thank you for your participation!
+ + +The Pactus Blockchain offers a Graphical User Interface (GUI) that comes with a built-in wallet to create, +sign and broadcast transactions. +This tutorial aims to guide you step-by-step on how to use the GUI application to send transactions to the Pactus blockchain. +Whether you are a beginner or an advanced user, this tutorial is suitable for you.
+ +Before we begin, you’ll need to run the Pactus GUI application and ensure that it is synced with the network. +You can find detailed instructions on how to do this in the following tutorial.
+ +To send a transfer transaction, click on the “Transaction” menu and +select “Transfer.” +This will bring up a new window where you can select the +account address from which you wish to send the transfer, +as well as the recipient’s account address and the amount you wish to send.
+ +After reviewing the transaction details and ensuring that they are correct, +click on the “Send” button to sign and broadcast the transaction to the Pactus blockchain.
+ + + +It’s important to note that the transaction fee +will be calculated based on the amount you’re sending.
+ +To send a bond transaction, navigate to the “Transaction” menu +and select “Bond.” +A new window will appear where you can select the account address from which you wish to send the bond transaction, +as well as the validator address of the recipient and +the amount you wish to stake.
+ +If the validator address is not already registered on the Pactus blockchain, you will need to provide the +validator’s public key as the first staking transaction will create the validator on the Pactus blockchain. +To obtain the public key, you can right-click on the validator’s address in your wallet +and select “Details.”
+ + + +It’s important to note that the transaction fee +will be calculated based on the amount you’re sending.
+ + +The Pactus Blockchain provides a wallet application that allows users to interact with the Pactus blockchain +without the need to run a node. +This is ideal for users who do not wish to operate a node but still want to create a personal wallet to manage their funds. +This tutorial will guide you step-by-step on how to use the wallet application.
+ +To get started, download and extract the Pactus CLI file from +here.
+ +In this section, we will explore various wallet commands that help you create, manage, +and recover your Pactus wallet.
+ +First, you need to create a wallet. To create a new wallet, run the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 create
+
This command creates a new wallet and store it in the ~/pactus/wallets/wallet_1
.
./pactus-wallet ~/pactus/wallets/wallet_1 create
+
This command creates a new wallet and store it in the ~/pactus/wallets/wallet_1
.
pactus-wallet.exe c:\pactus\wallets\wallet_1 create --testnet
+
This command creates a new wallet and save it in the c:\pactus\wallets\wallet_1 directory.
+This command creates a new wallet and store it in the c:\pactus\wallets\wallet_1
.
Don’t forget to back up your wallet seed, as it allows you to recover your wallet if you lose it.
+ +You can change the wallet password by tunning this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 password
+
./pactus-wallet ~/pactus/wallets/wallet_1 password
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 password
+
If you forget your password, you can still recover your wallet using the wallet seed.
+ +You can obtain the wallet seed by running this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 seed
+
./pactus-wallet ~/pactus/wallets/wallet_1 seed
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 seed
+
The wallet seed is encrypted within your wallet, and +you’ll need to enter the wallet password to access it.
+ +If you lose your wallet, you can recover it by running this command:
+ + +./pactus-wallet ~/pactus/wallets/recovered_wallet recover
+
./pactus-wallet ~/pactus/wallets/recovered_wallet recover
+
pactus-wallet.exe c:\pactus\wallets\recovered_wallet recover
+
Please note that if you lose your seed, there is no way to recover your wallet.
+ +In this section, we’ll cover address commands that help you manage your wallet addresses.
+ +You can create a new address by running this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address new
+
./pactus-wallet ~/pactus/wallets/wallet_1 address new
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address new
+
You can also assign a label to your address to better organize your address book.
+ +To view the list of wallet addresses, use this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address all
+
./pactus-wallet ~/pactus/wallets/wallet_1 address all
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address all
+
To obtain the public key for a specific address, run this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address pub <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve its public key.
You can get the public key of your address by this command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
./pactus-wallet ~/pactus/wallets/wallet_1 address pub <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 address pub <ADDRESS>
+
Replace <ADDRESS>
with the address for which you want to retrieve its private key.
+Keep your private key secure. If someone gains access to your private key,
+they will have full control over that address.
In this section, we’ll cover transaction commands that help you create, sign, and +broadcast transactions on the Pactus Blockchain. +You’ll need to provide the password to sign the transaction. +Please note that once a transaction is broadcasted, it cannot be reversed.
+ +To create, sign, and broadcast a +Transfer transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx transfer <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx transfer <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx transfer <FROM> <TO> <AMOUNT>
+
In this command, <FROM>
should be one of the addresses in your wallet as the sender address,
+and <TO>
is the receiver address.
To create, sign, and broadcast a +Bond transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx bond <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx bond <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx bond <FROM> <TO> <AMOUNT>
+
In this command, <FROM>
should be one of the addresses in your wallet as the sender address,
+and <TO>
is the receiver validator address.
If the validator associated with this address does not exist yet, +you need to provide the public key to create it:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx bond --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 --pub <PUBLIC_KEY> <FROM> <TO> <AMOUNT>
+
Replace <PUBLIC_KEY>
with the validator’s public key,
+which is the public key of the <TO>
address.
To create, sign, and broadcast a +Unbond transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <ADDRESS>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <ADDRESS>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx unbond <ADDRESS>
+
In this command, <ADDRESS>
is the address of the validator that you want to unbond.
To create, sign, and broadcast a +Withdraw transaction, use the following command:
+ + +./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <FROM> <TO> <AMOUNT>
+
./pactus-wallet ~/pactus/wallets/wallet_1 tx unbond <FROM> <TO> <AMOUNT>
+
pactus-wallet.exe c:\pactus\wallets\wallet_1 tx withdraw <FROM> <TO> <AMOUNT>
+