# BTQ Documentation

Welcome to the documentation for the Bitcoin Quantum Resistant Ledger (BTQ)

This resource serves as a comprehensive guide for all aspects of BTQ, from basic usage to advanced development. Whether you're initiating a new project or simply learning the fundamentals, you'll find the necessary information here.

Our documentation is organized into three primary sections: 'Use,' 'Build,' and 'API.' These categories are designed to assist users, developers, and anyone interested in navigating through the BTQ project. Starting with basic functions and progressing to more complex topics like API integration and Extended XMSS HyperTree creation, our aim is to provide clear and useful guidance for all levels of engagement.

{% tabs %}
{% tab title="Use BTQ" %}

### Use BTQ

Start here to begin using the BTQ and all of the cool features available!

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><a href="/pages/0ZWNA9gETSfOCESKL1EL"><strong>BTQ Wallet</strong></a></td><td>Creating Addresses, Sending and Receiving BTQ</td><td></td></tr><tr><td><a href="/pages/o7PrvjjjegehCuAgbmvI"><strong>BTQ</strong> <strong>Mining</strong></a></td><td>Full Node Solo Mining and Pool Mining</td><td></td></tr><tr><td><a href="/pages/BJnWRkjtB5IiibJ9Bj99"><strong>BTQ Node</strong></a></td><td>BTQ Node installations, configuration and operation</td><td></td></tr><tr><td><strong>BTQ Tools</strong></td><td>BTQ Tools Usage and guides</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Build" %}

### Advanced Documentation

From API calls to address schemes, cli commands and Docker nodes. This is where all of the technical things are kept!

{% endtab %}

{% tab title="API" %}

### API

API documentation for advanced usage and programmatic connections.

{% endtab %}
{% endtabs %}


# What is BTQ ?

BTQ is a cutting-edge Bitcoin ledger designed to withstand quantum computing threats by incorporating Extended Merkle Signature Scheme (XMSS) technology.

## What is BTQ ?&#x20;

BTQ is a state-of-the-art cryptocurrency that combines Bitcoin's trusted economic framework with advanced quantum-resistant security measures. It maintains a total supply of 21 million units, mirroring Bitcoin's limited availability. BTQ distinguishes itself by utilizing a dual-mining approach: it supports CPU-friendly and extends to GPU mining with Cryptonight cn/0. This combination democratizes mining and minimizes the risk of hardware centralization. BTQ features a unique emission schedule spread over approximately 1000 years, with a 5% decrease in block rewards every 525,600 blocks, aiming for long-term sustainability and market stability.&#x20;

### Reasons to Use BTQ

1. **Quantum-Resistant Security**: BTQ employs the Extended Merkle Signature Scheme (XMSS), a hash-based signature method designed to withstand threats from quantum computing. This ensures that users' digital assets remain secure even as quantum computing technology advances.
2. **Fair Dual Mining Approach**: BTQ adopts a dual-mining approach, supporting both CPU and GPU (with Cryptonight cn/0) mining. This method democratizes mining and reduces the concentration of mining power in the hands of a few.
3. **Long-Term Emission Plan**: With an emission schedule extending over 1000 years and a 5% reduction in block rewards every 525,600 blocks, BTQ aims for long-term sustainability and market stability, encouraging investors and users to think long-term.
4. **Distinct Economic Model**: With a fixed total supply of 21 million units, BTQ offers an economic model similar to Bitcoin's but enhanced to meet new-age challenges, particularly the cybersecurity concerns posed by the development of quantum computing.

These distinctive features make BTQ a compelling cryptocurrency choice for anyone interested in security, sustainability, and long-term viability in the digital currency space.

### Quantum Computing Attack Vectors

As the field of cybersecurity progresses, the development of quantum computers presents both opportunities and challenges. Quantum computers can perform computations at significantly faster speeds than classical computers, potentially allowing them to break current cryptographic algorithms efficiently. Here are some potential attack vectors that quantum computers might employ:

1. **Shor's Algorithm Attack**: One of the earliest quantum algorithms developed, Shor's algorithm can break cryptographic algorithms based on the factorization of large integers and discrete logarithm problems. These are the foundations of RSA and ECC (Elliptic Curve Cryptography), the two most widely used encryption algorithms today.
2. **Grover's Algorithm Attack**: Grover's algorithm can optimize the search of a key space, allowing the discovery of a secret key from a public key much more efficiently than traditional brute-force methods. This means that the time required to break a cryptographic algorithm could be significantly reduced.
3. **Attack on Lattice-Based Cryptography**: Although considered secure against quantum computing attacks, ongoing research continues to explore potential vulnerabilities in this method. Advanced attack techniques could be developed to exploit yet undiscovered weaknesses in lattice-based algorithms.
4. **Attacks on Multivariate Equation Systems**: Cryptosystems based on multivariate equations could also be threatened by quantum computing. While they offer a higher level of security than ECC and RSA, future developments in quantum computing might find ways to efficiently solve complex systems of equations.
5. **Quantum Walks Attacks**: Quantum walk algorithms could be used to optimize solving particularly structured problems, potentially weakening cryptographic algorithms previously considered secure.

According to public information, quantum computers have not yet surpassed 25 qubits or factored numbers as small as 15 or 21. However, in August 2015, the NSA expressed concerns about elliptic curve cryptography methods based on quantum computing fears.

With these risks, the development of quantum-resistant cryptographic systems, like BTQ using XMSS in the cryptocurrency context, becomes critically important to ensure the security of information and digital assets as quantum computing becomes more widespread.

### Quantum-Resistant Signatures in BTQ

As the threat from quantum computing increases, BTQ (Bitcoin Quantum) has implemented quantum-resistant technology to ensure maximum security for its users. Specifically, BTQ utilizes the Extended Merkle Signature Scheme (XMSS), a hash-based signature method designed to withstand attacks from quantum computers. Here are the key features and benefits of the XMSS quantum-resistant signature system adopted by BTQ:

1. **Optimal Security**: XMSS offers optimal security based on one-way hash function computations, which are difficult to break even with the computational power of quantum computers.
2. **Sustainable Signatures**: Unlike other signature systems like RSA or ECDSA, XMSS does not rely on mathematical problems that quantum computers can solve efficiently. This ensures its sustainability in the era of quantum computing.
3. **Resistance to Signature Reuse**: XMSS is a stateful signature system, meaning each signature is intended for one-time use only, enhancing the security of each transaction.
4. **Blockchain Compatibility**: XMSS is well-suited for blockchain technology due to its ability to generate signatures of a fixed length without requiring complex state management, aligning with the operational mechanisms of most blockchains.
5. **No State Management Required**: Although XMSS is a stateful signature system, recent improvements have enabled its efficient deployment without the need for complex state management, reducing the burden on users and developers.

The adoption of quantum-resistant signatures in BTQ not only provides a robust layer of protection against advancements in quantum computing technology but also ensures that users' digital assets remain secure in the future, regardless of how the technological landscape may change.

## What is Extended Merkle Signature Scheme (XMSS)&#x20;

XMSS, short for "eXtended Merkle Signature Scheme," is an advanced signature system designed to withstand attacks from quantum computers. It is one of the most robust quantum-resistant signature algorithms currently available and is utilized by various organizations and cryptocurrency projects to protect their systems from the potential breach by advancements in quantum computing technology. Here are some key aspects of XMSS:

1. **Technology Foundation**: XMSS is based on the Merkle tree structure, using cryptographic hash functions to generate signatures. A Merkle tree is a data structure where each "leaf" represents a public key and each "node" in the tree is a hash value of its two child nodes. This creates a "root" that securely verifies the accuracy of the keys in the tree.
2. **Quantum Resistance**: Unlike relying on mathematical problems such as integer factorization or discrete logarithms, XMSS depends on the security of hash functions. This makes XMSS difficult to break by quantum algorithms like Shor's algorithm, which can compromise many other cryptographic systems.
3. **Stateful Nature**: XMSS is a stateful signature scheme, meaning its internal state (e.g., which keys have been used) needs to be updated after each signing. Each key is used only once to ensure security, thus preventing attacks through key reuse.
4. **Performance and Scalability**: While XMSS offers high security, it may require more resources than other signature systems due to its stateful nature and complex data structures. However, recent improvements have helped mitigate these requirements, making XMSS more practical for real-world applications.
5. **Standardization**: XMSS has been standardized and widely recognized within the cybersecurity community. It provides a robust and reliable digital signature solution for systems requiring protection against current and future threats.

XMSS is an optimal solution for those seeking a secure method in the era of developing quantum technology, particularly in the cryptocurrency and blockchain sectors that demand high security levels.

### The Breaking Potential of a 1600 Qubit Quantum Computer

A 1600 qubit quantum computer, with computational capabilities far exceeding those of classical computers, could achieve significant breakthroughs in solving complex problems that currently require the most advanced algorithms. One of the most significant applications of quantum computing is its ability to break current cryptographic systems, a major concern for global cybersecurity. Here are some potential capabilities of a 1600 qubit quantum computer:

1. **Breaking RSA and ECC**: These cryptographic systems rely on the difficulty of problems such as large integer factorization and discrete logarithms. Shor's algorithm, a quantum algorithm, can solve these problems in polynomial time, significantly undermining the security of today's prevalent encryption systems.
2. **Grover's Algorithm**: Quantum computers are capable of running Grover's algorithm, an optimal algorithm for searching key spaces. This algorithm allows for much faster key searches than the brute-force methods on classical computers. For RSA, ECC, and symmetric key encryption systems, this could drastically reduce the time needed to break the encryption.
3. **Attacks on Symmetric Cryptography**: While symmetric key encryption systems like AES are considered to be more secure against quantum attacks, Grover's algorithm can still significantly reduce their security levels. For example, a system using a 256-bit key would effectively have a security level reduced to 128 bits in a quantum environment.
4. **Applications Beyond Cryptography**: A 1600 qubit quantum computer is not limited to cryptanalysis. It can also be used to optimize problems in various other fields such as quantum chemistry, physics, and optimization in synthesis, providing deeper insights and improvements in these industries.

The capabilities of a 1600 qubit quantum computer bring vast potential for scientific development but also pose significant challenges for cybersecurity. It is crucial to develop and adopt quantum-resistant cryptographic algorithms to ensure the security of data and information systems against the advancements in quantum computing technology.

### **How XMSS Resists Quantum Attacks**

1. **Based on Hash Functions**: Unlike RSA and ECC, XMSS does not rely on the computational difficulty of integer factorization or discrete logarithms but on the security of hash functions. Current quantum computers do not have an efficient method to reverse hash functions, making XMSS difficult to break with quantum technology.
2. **Utilizes Merkle Trees**: XMSS generates a Merkle tree where each node is defined by the hash of its two child nodes. The root of the tree (Merkle root) acts as the public key and is used to verify signatures from the leaves of the tree, each leaf corresponding to a one-time-use signature.

**Processing Formulas in XMSS:**

1. **Key Generation and Signing**:
   * **Private Key (SK)**: Created from a list of randomly generated secret keys.
   * **Public Key (PK)**: The root of the Merkle tree, calculated from the secret keys through multiple layers of hashing.
2. **Signing and Verification**:
   * **Signing**: Each message is signed using a private key from a leaf of the Merkle tree. A signature in XMSS includes the signature from the leaf (secret key), the index of the leaf, and a Merkle authentication path from the leaf to the root.
   * **Verification**: To verify a signature, the recipient uses the public key (tree root) and the Merkle path to check the integrity of the leaf and the root of the tree, thereby confirming the validity of the signature.
3. **State Update**: Each time a leaf is used for signing, the state of the tree needs to be updated to ensure that the leaf is not reused, maintaining the security of the system.

### Introduction and Details of the Merkle Signature Scheme (MSS)

**Introduction**

The Merkle Signature Scheme (MSS), developed by Ralph Merkle in the 1970s, utilizes a Merkle tree data structure to generate and verify digital signatures. This cryptographic method leverages hash functions to efficiently manage a large volume of signatures with a single public key.

**Details of the Merkle Signature Scheme**

1. **Merkle Tree Structure**:
   * A Merkle tree is a binary tree where each leaf node contains the hash of data or a secret key. These leaf nodes are typically used to sign messages.
   * Non-leaf nodes are the hash of their two child nodes, with the root node, also known as the "Merkle root," representing the user's public key.
2. **Signature Generation Process**:
   * **Key Generation**: Users generate multiple secret keys (corresponding to the leaves). Each secret key is used to generate a signature.
   * **Tree Construction**: From these secret keys, users create leaf nodes by applying a hash function. Users then hash these leaf nodes to create higher-level nodes, eventually forming the root node.
   * **Public and Private Keys**: The root of the Merkle tree serves as the public key, while the secret keys at the leaves act as private keys.
3. **Signature Verification Process**:
   * When a user wants to verify a signature, the signer provides the signature, the message, and an authentication path from the corresponding leaf to the root node.
   * The recipient uses the message and the authentication path to reconstruct the root node from the leaf. If the reconstructed root matches the public key, the signature is deemed valid.
4. **Benefits and Limitations**:
   * **Benefits**: MSS allows users to sign multiple signatures with a single public key without revealing the private key, offering a high level of security and efficient key management.
   * **Limitations**: Managing the state of private keys and the need to store authentication paths can complicate deployment and usage.

The Merkle Signature Scheme is a powerful tool for securing digital transactions and has become foundational for many applications in security and blockchain technology.

## Introduction to One-Time Signature (OTS) Key Pairs

### **Concept of OTS**

One-Time Signature (OTS) is a digital signature method where each key pair is used to sign a single message only. Designed to ensure security and confidentiality, OTS key pairs are particularly useful in applications requiring high security and resistance against signature replay attacks.

### **Structure of OTS Key Pairs**

1. **Private Key**: In OTS, the private key comprises a set of random values, each of which is used to sign a specific part of the message. Each private key is used only once and then must be discarded or ignored to avoid security risks.
2. **Public Key**: The public key is generated from the private key by applying a cryptographic hash function. This public key is used to verify the signature generated from the corresponding private key.

### **Signing and Verification Process in OTS**

* **Signing**: When signing a message, the signer uses corresponding parts of the private key to create a signature for each part of the message. The signature for each message part is generated by hashing it together with the respective private key part.
* **Verification**: To verify a signature, the recipient uses the public key to check if the parts of the signature match the parts of the message when hashed. If all parts match, the signature is considered valid.

### **Applications and Limitations of OTS**

* **Applications**: OTS is suitable for high-security systems such as blockchain applications and decentralized systems, where signature reuse can lead to serious consequences.
* **Limitations**: The use of a one-time key can lead to complex key management issues and increased storage costs, as each transaction or message requires a new key pair.

OTS is a highly secure digital signature method but requires strict key management to ensure security and efficiency in practical applications.

### Enhancements to One-Time Signature (OTS) Key Pairs with Merkle Signature Scheme (MSS)

**Using MSS Securely**

To use the Merkle Signature Scheme (MSS) securely, One-Time Signature (OTS) keys must not be reused. Therefore, the scheme relies on maintaining the state of which signatures or transactions have been signed. In conventional systems, this could pose a challenge; however, a public immutable blockchain ledger serves as an ideal medium to store these cryptographic signature schemes along with their transaction histories.

**Introduction to SPHINCS**

In 2015, a new hash-based cryptographic signature scheme called SPHINCS was introduced, which offers stateless signatures with a security level of 2128 bits. Unlike traditional OTS systems that require strict management of key states to prevent reuse, SPHINCS provides a way to secure digital communications without needing to track the history of each signature.

**Key Benefits and Implementation of SPHINCS**

* **Stateless Operation**: SPHINCS eliminates the need for tracking which keys have been used, simplifying key management significantly and reducing the potential for human error in managing key states.
* **High Security**: Offering 2128-bit security, SPHINCS is designed to be resistant to both classical and quantum computing attacks, making it suitable for high-security needs in an evolving technological landscape.
* **Blockchain Compatibility**: Both SPHINCS and traditional MSS are compatible with blockchain technology, where the immutable nature of the ledger ensures that once a transaction is recorded, it cannot be altered, thus preserving the integrity of the signature and its associated keys.

#### Integration of MSS and SPHINCS in Blockchain

Implementing these advanced cryptographic methods in blockchain applications not only enhances security but also leverages the inherent properties of blockchain technology—such as decentralization and immutability—to manage digital signatures efficiently. This integration makes blockchain an even more robust platform for secure transactions and cryptographic operations, ensuring that digital assets and communications are protected against emerging threats.

## Conclusion

The integration of advanced cryptographic techniques like the Extended Merkle Signature Scheme (XMSS) and SPHINCS within blockchain technologies represents a significant step forward in enhancing digital security in an era increasingly dominated by quantum computing threats. BTQ, with its quantum-resistant features, serves as a pioneering example of how cryptocurrencies can adapt to emerging challenges, offering robust security measures that are well-suited to protecting against both current and future cryptographic threats.

By employing state-of-the-art signature schemes and leveraging the immutable and decentralized nature of blockchain, BTQ not only secures its transactions but also paves the way for sustainable digital currency systems. Its long-term emission plan and dual-mining approach further exemplify a commitment to fair and sustainable crypto-economics, addressing some of the key issues faced by traditional cryptocurrencies.

In conclusion, as quantum computing continues to evolve, the need for quantum-resistant cryptographic systems becomes increasingly crucial. Cryptocurrencies like BTQ that incorporate these advanced protections ensure that they remain viable and secure investment and transaction mechanisms in the face of rapidly advancing technological landscapes. This proactive approach in addressing quantum vulnerabilities highlights the importance of forward-thinking in cybersecurity strategies within the cryptocurrency industry.


# BTQ Whitepaper

Bitcoin Quantum Whitepaper

Bitcoin Quantum (BTQ) is a cryptocurrency designed to offer a secure, sustainable, and scalable currency platform, addressing the issues of security and mining centralization that Bitcoin currently faces. Utilizing quantum-resistant technologies and a long-term emission plan, BTQ aims to ensure safety and stability for the future of cryptocurrency.

{% file src="/files/Lb71pwbbXUehOJ3Tmnxh" %}


# BTQ Tokenomics

Tokenomics for Bitcoin Quantum (BTQ)

## BTQ Tokenomics

Bitcoin Quantum has a total supply of 21 million BTQ, allocated for the following purposes. This fixed supply is a strategic choice reflecting the project’s vision to position BTQ as a form of **digital gold,** which is particularly significant in the context of **quantum-resistant technologies**. The fixed and unchangeable supply of BTQ adds scarcity, enhancing its potential value retention over time, thereby making it an attractive asset in an era of rapidly evolving digital security concerns driven by the advances in computing power, artificial intelligence, machine learning, and big data.

Moreover, BTQ is pioneering in the cryptographic revolution, incorporating core technological advancements such as the **Extended Merkle Signature Scheme (XMSS).** Recognized by the **National Institute of Standards and Technology (NIST)** for its quantum resistance, XMSS is critical as computing power, alongside capabilities in AI and machine learning, continues to expand, leading to potentially disruptive innovations in data processing and analysis. By adopting this advanced cryptographic standard, BTQ ensures robust security and stability for its digital currency, positioning it to effectively navigate and lead in the transforming landscape of cryptography amidst these technological advancements.

| Allocation                             | Amount         | Percentage of Total Supply |
| -------------------------------------- | -------------- | -------------------------- |
| Mining                                 | 18.000.000     | 85.7%                      |
| Foundation Wallet 1 **(20-year lock)** | 1.000.000      | 4.8%                       |
| Foundation Wallet 2 **(20-year lock)** | 1.000.000      | 4.8%                       |
| Native Coin                            | 1.000.000      | 4.8%                       |
| **Total**                              | **21.000.000** | **100%**                   |

This allocation ensures network security, promotes project development, and broadens the project’s reach.

## Specific Wallet Addresses

* **Address Foundation Wallet (20-year lock):** [Q010500d187c52fc382253f8149315cead7f3b358c956491f0a02acc3e61d08e9dbd4008e7d2c34](https://explorer.bitcoinq.xyz/address/Q010500d187c52fc382253f8149315cead7f3b358c956491f0a02acc3e61d08e9dbd4008e7d2c34)
* **Address Foundation Wallet (20-year lock):**\
  [Q01050087df76e438b6d7bae0b23650925f454b0aa18547d31ceeb936d12794b11a767628951782](https://explorer.bitcoinq.xyz/address/Q01050087df76e438b6d7bae0b23650925f454b0aa18547d31ceeb936d12794b11a767628951782)
* **Address Native Coin:** [Q0105002e75421e41abbf14b693774893e861e7b09943f5684351ed73ac5318ef924ddf2721043c](https://explorer.bitcoinq.xyz/address/Q0105002e75421e41abbf14b693774893e861e7b09943f5684351ed73ac5318ef924ddf2721043c)

## Allocation Details

In this section, we explain the details of each allocation and their purposes.

### **Mining**

The majority of BTQ supply is allocated to mining to ensure the safety and security of the network. These mining rewards encourage miners to contribute processing power, helping to maintain the decentralization and efficiency of the blockchain. We are committed to mining because it is the original vision of Bitcoin's Proof of Work (PoW) by Satoshi Nakamoto that has proven to be a viable method for establishing a digital asset as valuable digital gold. This PoW mechanism not only supports network security through widespread miner participation but also ensures a fair distribution of new coins, reflecting a trust system akin to the mining of precious metals in the physical world.

Additionally, Bitcoin Quantum adopts this approach with a long-term perspective, planning for coin emission over a thousand years. This extended emission schedule is designed to gradually introduce new coins into the system, mimicking the enduring value proposition of gold and other precious metals, which have historically served as long-term stores of value. This slow and steady approach helps to prevent inflation and market saturation, ensuring that BTQ remains a sought-after asset for future generations.

Moreover, the use of PoW in BTQ reflects a commitment to maintaining a decentralized and egalitarian network where anyone with the necessary hardware can contribute to the network's security and coin generation, promoting a level playing field. This method is contrasted with Proof of Stake (PoS) systems, where the rich potentially get richer, centralizing control.

We also see the PoW model as critically aligning with innovations in energy efficiency and the integration of renewable energy sources into mining operations. As the global emphasis on sustainability grows, BTQ's mining infrastructure is poised to adapt to environmentally friendly technologies, thus supporting a green economy while securing the network.

In summary, by aligning BTQ with the proven PoW concept, we are not only adhering to a tested and secure method but are also enhancing it with a vision for long-term emission and sustainability. This approach firmly establishes BTQ as a reliable digital gold of the future, designed to be valuable, secure, and accessible over the next millennium.

### **Foundation**

The BTQ Foundation supports the project's activities, including technology development, network maintenance, and other administrative costs. This funding also supports research initiatives and strategic partnerships.

### **Marketing**

This allocation is used to promote BTQ, including marketing campaigns, community events, and activities aimed at expanding global awareness and usage of BTQ.

### **Native Coin Sale**

BTQ is the native coin of the Bitcoin Quantum blockchain. It is NOT a token built on another chain.

The project does not provide liquidity, does not create trading pairs, and does not guarantee listing on any exchange.

All listing, trading pair creation, and liquidity provision activities are entirely managed by the community, third-party projects, and ecosystem partners working together to grow the BTQ ecosystem.

### Open Source & Community-Driven

Bitcoin Quantum is a fully open-source project that has been completely handed over to the community. The future of BTQ is shaped by its contributors and supporters.

## Transparency and Governance

### Use of Pre-Mined Funds

For the pre-mined funds, we commit to maintaining a high level of transparency in how these resources are used. Periodic reports will be published so the community can monitor and evaluate fund management.

### Community Participation

We encourage community involvement in significant decisions related to the project through a voting system and feedback. This ensures the project reflects the majority's will and maintains strong ties with our supporters and users.

## Conclusion

Bitcoin Quantum is a serious endeavor to create a secure, fair, and sustainable cryptocurrency. With a clear and transparent tokenomics strategy, we believe that BTQ will achieve widespread acceptance and become a new standard in the cryptocurrency world.


# Latest Research and Developments in BTQ Technology

This page offers a detailed overview of the latest academic and industrial research developments, upcoming trends, and scholarly discussions focused on BTQ cryptocurrency.

**XMSS: A Post-Quantum Secure Digital Signature Scheme Approved by NIST**

This guidance outlines two digital signature generation methods: the Leighton-Micali Signature (LMS) and the eXtended Merkle Signature Scheme (XMSS), including their hierarchical variants—Hierarchical Signature System (HSS) and multi-tree XMSS. These are stateful hash-based signature schemes recognized for their post-quantum security.

**Reference**: *Recommendation for Stateful Hash-Based Signature Schemes* by David Cooper, Daniel Apon, Quynh Dang, Michael Davidson, Morris Dworkin, Carl Miller (NIST). Full text available [here](https://csrc.nist.gov/pubs/sp/800/208/final).

**Internet Research Task Force (IRTF) - RFC 8391 Overview**

BTQ Cryptocurrency is now distinguished as the pioneering industrial application of the XMSS (eXtended Merkle Signature Scheme) as specified by the IETF in RFC 8391. You can read the full documentation [here](https://datatracker.ietf.org/doc/html/rfc8391).

This document outlines XMSS, a hash-based digital signature scheme derived from scientific literature. It details the operational specifics of Winternitz One-Time Signature Plus (WOTS+), XMSS, and its multi-tree variant, XMSS^MT. All these mechanisms integrate WOTS+ as their core component.

XMSS is recognized for providing robust digital signatures that do not depend on the presumed difficulty of mathematical problems. Instead, its security is grounded on the properties of cryptographic hash functions. This scheme offers strong security assurances, maintaining integrity even if the collision resistance of the underlying hash function is compromised. XMSS is advantageous for its compactness, straightforward implementation, and inherent resistance to side-channel attacks. Notably, unlike many traditional signature systems, hash-based signatures like XMSS remain secure against the potential threats posed by quantum computing.

**Reference**: A. Huelsing (TU Eindhoven), D. Butin (TU Darmstadt), S. Gazdag (genua GmbH), J. Rijneveld (Radboud University), A. Mohaisen (University of Central Florida)

<br>

<br>


# BTQ Wallet Overview

Explore the BTQ Wallet, your gateway to securely managing your Bitcoin Quantum assets.

The Bitcoin Quantum Resistant Ledger (BTQ) functions similarly to other cryptocurrencies by utilizing both public and private keys that correspond to a specific address. What sets BTQ apart is its innovative approach to post-quantum security, primarily through its signature scheme.

BTQ employs the Extended Merkle Signature Scheme (XMSS), a hash-based cryptography method that has been in existence since the 1970s and was recently approved by NIST for use in cryptographic systems. XMSS is celebrated for its robust quantum-resistant properties, making it one of the most secure algorithms available today.

However, there is a notable limitation associated with hash-based cryptography: each signature key index can only be used once. This unique characteristic ensures enhanced security but requires careful management of key indices to maintain the integrity of the cryptographic system.

## BTQ Address Options

This feature in the BTQ Wallet allows users to customize the tree height, which determines the number of One-Time Signatures (OTS) available for transactions on the blockchain. By default, a tree height of 10 provides 1,024 OTS key indexes, but users have the flexibility to create wallets with either more or fewer OTS keys according to their needs.

Increasing the tree height results in a greater number of OTS Key Indexes, which enhances the security of your transactions. However, a larger tree height also means longer times for key generation. Each time the wallet is accessed, these keys need to be calculated, thus extending the time it takes to open a wallet with a higher number of addresses.

It's important to note that these parameters must be set during the creation of the wallet. The chosen height of the tree is crucial as it influences the creation of the OTS key indexes and contributes to the uniqueness of each private key. This setup is designed to optimize both security and functionality in the BTQ Wallet.

| Tree Height | Available Keys | Notes                                                       |
| :---------: | :------------: | ----------------------------------------------------------- |
|      8      |       256      | Allows 256 transactions to be **sent** from the address     |
|      10     |      1,024     | Allows 1024 transactions to be **sent** from the address    |
|      12     |      4,096     | Allows 4,096 transactions to be **sent** from the address   |
|      14     |     16,384     | Allows 16,384 transactions to be **sent** from the address  |
|      16     |     65,536     | Allows 65,536 transactions to be **sent** from the address  |
|      18     |     262,144    | Allows 262,144 transactions to be **sent** from the address |

## BTQ Hash Function

BTQ can utilize multiple hash functions, depending on the setting used during the creation of the wallet.

By default the wallet will utilize the shake128 hash function if no configuration options are given.

| Hash Function | Hash Algorithm                               | Description                                              |
| ------------- | -------------------------------------------- | -------------------------------------------------------- |
| shake128      | [SHA-3](https://en.wikipedia.org/wiki/SHA-3) | Secure Hash Algorithm 3 - Default used in the web wallet |
| sha2\_256     | [SHA-2](https://en.wikipedia.org/wiki/SHA-2) | Secure Hash Algorithm 2                                  |
| shake256      | [SHA-3](https://en.wikipedia.org/wiki/SHA-3) | Secure Hash Algorithm 3                                  |

## BTQ Wallet Security

All BTQ wallets are constructed around a cryptographic key pair, consisting of public and private keys. From these keys, a Merkle tree is generated, which is composed of One-Time Signature (OTS) key indexes. These OTS key indexes are used individually for each transaction to sign outgoing transfers. This method ensures that the root secret, or the "private" key, is never exposed during transactions. Each signature provided by an OTS key index is unique to a specific transaction, enhancing security by preventing potential reuse and exposure

{% hint style="info" %}
CAUTION:

Before interacting with the BTQ network, it is crucial for users to accurately record and securely store their private recovery keys (either mnemonic or hexphrase). After recording, verifying that these recovery keys function correctly is essential. This step is vital to ensure that your funds are not sent to an address beyond your control. Proper management and verification of your recovery keys will safeguard your assets and provide peace of mind as you engage with the BTQ network.
{% endhint %}

### Public Key

At the core of the BTQ wallet is the BTQ address. Each public key starts with a "Q" and consists of 79 hexadecimal characters. This public address serves as the account identifier and is the information you would provide to receive funds.

Public keys are safe to share with trusted parties with whom you will be transacting. You can use your public address to request funds from another user or to deposit funds into your own wallet.

**Example BTQ Public Address:**&#x20;

```
Q020500ff7195e78daa5d8b35df71372739c2080b197f1832b54710d1167be4a2587f6546f2e6f9
```

### Private Key

Private keys in the BTQ ecosystem can be represented in three forms: a hexseed, a mnemonic phrase, or a wallet.json file that contains both. Any of these forms can be used to restore a wallet, and it is crucial to follow best practices to secure these keys.

**Key Points about Private Keys:**

* **Required for Transactions:** A private key is essential for interacting with the BTQ blockchain.
* **Unique Signatures:** Private keys are used to sign transactions, ensuring that no two transactions are the same.
* **Exclusivity:** Each private key is unique; no two private keys are identical.
* **Control Over Funds:** Anyone in possession of a private key can initiate transactions on behalf of the associated address.
* **Verification:** Always ensure that any recovery keys open the expected address before using it.
* **Security:** NEVER SHARE PRIVATE WALLET KEYS. Exposure of private keys can lead to unauthorized access and potential loss of funds.

**Security Best Practices:**

* **Storage:** It is the responsibility of the user to ensure that all secret keys and encryption phrases are stored securely. Any loss of funds due to misplaced, stolen, or improperly copied keys is the sole responsibility of the owner.
* **Backup Verification:** Before depositing funds, verify that your backup method re-opens the same address as expected.
* **Irrecoverable Keys:** Private keys cannot be regenerated if lost. Without them, the funds in the address are irrecoverable. Therefore, it is vital to backup your keys and store them in secure locations.

**Typical BTQ Private Key Format:** While private keys can be stored in various formats, they are typically utilized through a wallet application to facilitate ease of use and enhance security.

**Remember:** Maintaining the confidentiality and integrity of your private keys is the most effective way to secure your assets within the BTQ network.

### **Typical BTQ Private Key Format**[**​**](https://docs.theqrl.org/use/wallet/overview#typical-qrl-private-key-format)

Public and private keys can be stored in a multitude of ways and are typically utilized through a wallet application.

| Private Key Medium | Information                                                                                                                                                                                                                                                                                                           |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `wallet.json` file | <ul><li>Contains both Hexphrase and Mnemonic as well as the Public Key</li><li>May be encrypted <em>(recommended)</em> and passphrase will be required to open</li><li>Generated from the Desktop, Web and CLI wallet applications</li></ul>                                                                          |
| Mnemonic Phrase    | <ul><li>Wordlist consisting of 34 selected words from the master BTQ wordlist</li><li>Available using backup functions of the wallet applications</li><li>Provided during most address generation steps</li></ul>                                                                                                     |
| Hexphrase          | <ul><li>Available using backup functions of the wallet applications</li><li>Hexstring consisting of 102 mixed alpha numeric characters</li><li>Provided during most address generation processes, or found in a "Backup Wallet" function</li></ul>                                                                    |
| Ledger Hardware    | <ul><li>Ledger manages BTQ private keys on device, never exposing them to the end user</li><li>Master Ledger Recovery Seed is required to recover a BTQ address stored on a Ledger device</li></ul>                                                                                                                   |
| Slave Keys         | <ul><li>Advanced address functionality. CLI tools are required to generate slave Keys</li><li>Generated slaves files are typically named <code>slaves.json</code> or <code>payment\_slaves.json</code></li><li>Slave keys are additional secret key(s) that are allowed to spend for a given master address</li></ul> |

{% hint style="info" %}
**NEVER SHARE PRIVATE WALLET KEYS**

These keys should never be shared! Anyone can transfer funds using a secret key.
{% endhint %}

**Example BTQ Mnemonic**[**​**](https://docs.theqrl.org/use/wallet/overview#example-qrl-mnemonic)

This list of 34 works represents the same key as the hexseed, with each word corresponding to an index location in the BTQ wordlist. This list is converted into binary/hexadecimal representation of the private keys.

```
action filled polish crunch luther sermon heap afraid stifle palm oyster fruity joyous loose sweat plane mud alley gravel rest tank mortar sham rear clown intend clue pelvis wrap moat piggy feeble toward solar
```

**Example BTQ Hexseed**[**​**](https://docs.theqrl.org/use/wallet/overview#example-qrl-hexseed)

```
020500a7b344845c3a67003cd699e59d558975081edc3a56916063607b5edec8fdc4db222ca7152cca14fd48dda394e0e81cec
```


# BTQ Wallet Create

Welcome to the BTQ Create Wallet Tutorial

This guide will assist you in creating a secure digital wallet for managing your BTQ, a state-of-the-art cryptocurrency that blends Bitcoin's trusted framework with advanced quantum-resistant security measures. Whether you are a cryptocurrency novice or an experienced user, this tutorial is designed to provide you with a straightforward approach to securely manage your digital assets.

## Getting Started

Creating a new wallet in a cryptocurrency system is a critical step for securely managing your funds. The image you provided shows the interface for creating a wallet, likely for a cryptocurrency that uses XMSS (eXtended Merkle Signature Scheme) for its cryptographic security. Below is a step-by-step tutorial on how to create a wallet based on the interface you shared:

<figure><img src="/files/qej1tO0xw739ggr4vUVM" alt=""><figcaption><p>Create Wallet BitcoinQ</p></figcaption></figure>

1. [**Open the Wallet Creation Page**](https://wallet.bitcoinq.xyz)**:** Begin by navigating to the cryptocurrency wallet creation interface where you are prompted to enter a passphrase and confirm it.
2. **Enter a Secure Passphrase:**
   * **Passphrase Requirements:** Your passphrase should be robust, containing at least 8 characters, including at least one number and one letter. Consider using a mix of upper and lower case letters, numbers, and symbols to increase security.
   * **Inputting the Passphrase:** Type your chosen passphrase into the "Passphrase" field. Make sure to remember it or store it securely, as losing the passphrase could result in losing access to your funds.
3. **Confirm Your Passphrase:**
   * **Passphrase Confirmation:** Re-enter the same passphrase in the "Confirm Passphrase" field to ensure there are no typing errors.
4. [**Understand the XMSS Tree Configuration**](/btq-wallet/btq-wallet-overview#btq-address-options)**:**
   * **Tree Height:** By default, the tree height is set to 10, which provides 1,024 one-time signatures. You can select higher tree heights for added security, but generating the wallet will take more time.
   * **Hash Function:** The default hash function used is SHAKE\_128. This can typically be changed to other hash functions if available, depending on your security needs and preferences.
5. **Create the Wallet:**
   * **Finalize Settings:** Review all settings to ensure they are correct. The interface might have additional options or settings based on the specific cryptocurrency or wallet.
   * **Generate Wallet:** Click the “CREATE WALLET” button to generate your new wallet. This process might take some time, especially if a higher XMSS Tree height is selected.
6. **Secure Your Wallet Details:**
   * **Backup Information:** Make sure to securely back up your passphrase, wallet address, hexseed, and mnemonic phrase (if provided). These details are crucial for accessing and recovering your wallet.
   * **Store Safely:** Avoid storing your passphrase or other sensitive information in plaintext or online without encryption.
7. **Waiting and Confirmation:**
   * **Be Patient:** The creation of the wallet, especially with high security settings, may take a significant amount of time. Wait until the process completes without interrupting.
   * **Confirmation:** Once the wallet is created, you should receive a confirmation along with details about how to access and use your new wallet.

<figure><img src="/files/WNdb7rsryd0JbpLJ5t9F" alt=""><figcaption><p>Your new wallet details</p></figcaption></figure>

{% hint style="info" %}
You must save the details on this page or risk losing funds sent or allocated to this wallet address.
{% endhint %}

### Understanding Your Wallet Details

1. **BTQ Address:**
   * **Purpose:** This is your public wallet address, used to receive funds. Think of it as your account number in the world of cryptocurrency.
   * **Example:** `Q10050096ff9e16c83e2f146bff7223526875d0848b95ae0d8c0d7a444419403142b2ceef1f2a3`
   * **Security Tip:** You can share this address publicly to receive funds, but never your private keys or passphrase.
2. **Mnemonic Phrase:**
   * **Purpose:** This is a human-readable form of your wallet’s private key, usually composed of 12 or more words. It's used to recover your wallet if you lose access to your device.
   * **Example:** "absorb filled squat nape thorn manic clinch dogma vital grey twelve witch cyprus limit freed knit ballet bundle crude noisy string albeit induce sweet silk peril jail park irony tricky hebrew paddle incur choux"
   * **Security Tip:** Write this phrase down on paper and store it in a secure location. Never store it digitally or share it online.
3. **Hexseed:**
   * **Purpose:** This is another format of your wallet’s private key, represented in hexadecimal. It serves the same purpose as the mnemonic phrase for wallet recovery.
   * **Example:** `010500db3933e398662bc3e3f47614ecafbf73607f357178210c1fe341965d8c0556fd6c7c86a1f73492f72e4ae367a9db6f0299`
   * **Security Tip:** The hexseed should be kept secret and secure, similar to the mnemonic phrase. Consider storing it separately from your mnemonic phrase for added security.

#### Actions to Take

1. **Open Wallet:**
   * Click this if you want to access your wallet immediately to view balances, initiate transactions, or manage your funds.
2. **Save Unencrypted Wallet File:**
   * This option will save a copy of your wallet file without encryption. It's not recommended due to security risks unless you are storing it in a highly secure, offline environment.
3. **Save Secure Wallet File:**
   * Preferably, choose this option to save your wallet file with encryption. You will likely need your passphrase to access it later, adding an additional layer of security.

#### Final Tips

* **Backup and Security:** Ensure you have multiple backups of your mnemonic phrase and hexseed, stored in different physical, secure locations.
* **Avoid Digital Storage:** Do not store your sensitive wallet information in digital form on any device connected to the internet to protect against hacking.
* **Regular Checks:** Periodically verify that your backup information is accessible and legible to avoid problems in the future should you need to recover your wallet.

<figure><img src="/files/5pgBLVKgOQyMRlT23Cep" alt=""><figcaption><p>Open Wallet</p></figcaption></figure>

### How to Open Your Cryptocurrency Wallet

**Option 1: Wallet File**

1. **Choose the Wallet File:**
   * Click on “Choose File” and select the wallet file from your computer. This file was previously saved when you created or backed up your wallet.
   * If the file is encrypted, you'll need to enter the passphrase you set when creating or saving the wallet file.
2. **Enter the Passphrase (if required):**
   * If your wallet file is encrypted, type your passphrase in the provided field to decrypt it.
3. **Unlock the Wallet:**
   * Click on “UNLOCK WALLET” to access your wallet.

**Option 2: Mnemonic Phrase**

1. **Select Mnemonic Phrase:**
   * From the dropdown menu next to the wallet file button, select "Mnemonic Phrase."
2. **Enter Your Mnemonic Phrase:**
   * Type your mnemonic phrase into the text field that appears. This is the same phrase you noted down during the wallet creation process.
3. **Unlock the Wallet:**
   * Click “UNLOCK WALLET” to open your wallet.

**Option 3: Hexseed**

1. **Select Hexseed:**
   * Choose "Hexseed" from the dropdown menu.
2. **Enter Your Hexseed:**
   * Input the hexseed in the text field provided. This hexseed is a hexadecimal representation of your private key.
3. **Unlock the Wallet:**
   * Press “UNLOCK WALLET” to gain access to your wallet.

**Option 4: Ledger Nano**

1. **Select Ledger Nano:**
   * Select "Ledger Nano" from the dropdown options.
2. **Connect Your Ledger Nano:**
   * Connect your Ledger Nano device to your computer and enter its pin to unlock it.
3. **Access the Wallet:**
   * Ensure the appropriate cryptocurrency app is open on your Ledger Nano, and then click “UNLOCK WALLET” to synchronize it with the interface.

#### Security Tips

* **Keep Your Recovery Details Private:** Never enter your passphrase, mnemonic phrase, or hexseed on a computer that you suspect might be compromised.
* **Secure Connections Only:** Ensure that you are accessing your wallet in a secure environment, using a trusted network to avoid interception of sensitive data.
* **Regularly Update Software:** Keep your wallet software and hardware (like Ledger Nano) updated to protect against vulnerabilities.

By following these steps and maintaining good security practices, you can safely manage and access your cryptocurrency wallet.


# BTQ Check Wallet Balance

Checking the balance of a BTQ (Bitcoin Quantum)

Checking the balance of a BTQ (Bitcoin Quantum) wallet involves verifying the information directly from the BTQ blockchain, which is the definitive source for all balance details. Each transaction affecting a wallet, whether incoming or outgoing, is permanently recorded on the blockchain.

## How to Check a BTQ Wallet Balance

## **Public Address**

A BTQ public address typically starts with "Q". Here's an example of a BTQ public address: [Q010500f07a209bfa657e526118a9c5e40ecb5f69d3a8da991ddc1fe0269c7ec617f693f362a051](https://explorer.bitcoinq.xyz/a/Q010500f07a209bfa657e526118a9c5e40ecb5f69d3a8da991ddc1fe0269c7ec617f693f362a051). Remember, never use a private key for balance inquiries on explorers or websites, as it could compromise the security of the funds.

## **Balance Lookup Methods**

1. **BTQ Block Explorer**
   * This is the simplest and most straightforward method to check the balance of a BTQ wallet. Just enter the public address into the BTQ Block Explorer to view the current balance and all related transactions.
   * For detailed instructions, refer to the BTQ Block Explorer documentation.
2. **BTQ Wallet**
   * When you open a BTQ wallet and load the secret keys, the balance of the address will display across all available wallet interfaces.
   * It is not recommended to load secret keys merely to check a balance since it poses unnecessary risks. Instead, use the public address in the BTQ Block Explorer for a safer balance lookup.
3. **BTQ Command Line Tools**
   * For those preferring command-line tools, there are multiple methods to check a wallet balance using different commands based on the specific tool.
   * Always use the public key when possible for balance lookups to minimize the risk of exposing secret keys.

By adhering to these methods, you can safely check the balance of your BTQ wallet without compromising your private keys.


# BTQ Address Overview

The BTQ (Bitcoin Quantum) address

The BTQ (Bitcoin Quantum) address serves as a key element in the blockchain ecosystem, representing a user's wallet as a publicly shareable identity that safely holds funds.

## Public Address

The BTQ public address acts as a visible identifier that allows others to send funds to the wallet. It is cryptographically paired with a private key.

**Typical BTQ Public Address Format:** A BTQ public address, usually starting with the letter "Q," looks like this: Q000400202ea4dc2b83ded8cfcd4fc8c0447ca3391582430cec6b093291ab9773173af1bb5ed7e8. This 79-character hexadecimal string is unique to its corresponding private key.

Sharing the public key is generally safe as the funds are not accessible with the public address alone. However, because the balance is visible on the blockchain explorer, sharing it can pose a personal security risk, akin to disclosing your bank account balance. Caution is advised when sharing this information.

## Private Keys

The private key associated with a BTQ public address is crucial for on-chain interactions and accessing funds.

### **Key Points About Private Keys:**

* **Generation:** Private keys are generated using BTQ wallets. Once generated, the key pair cannot be changed.
* **Security:** The private key should never be shared. It provides full access to the wallet's funds and is considered highly sensitive.

## Mnemonic Phrase

A mnemonic phrase is a user-friendly series of words that represent the wallet's seed. It's less prone to errors than other seed forms and provides an accessible way to restore or transfer wallet information.

**Example Mnemonic Phrase:** aback drank swap fence strait donor script form imply eerie invade brave fan legend tape evil higher ride mortar tricky expect gentry scare retire remark gritty wolves repeal weary gray peak blew tsar pipe

## Hexseed

The hexseed is another representation of the wallet's seed, presented in a hexadecimal format. Like the mnemonic phrase, it can regenerate the full Merkle tree when entered into the wallet software.

**Example Hexseed:** 000400dbf4ead7e3eec1155b6ea44b7181c94cb7cadee49969eb798fdea34ad5c3c01b64b4661dfbeb51f76609a0c182eb7a47

## Wallet.Json File

The wallet.json file is a comprehensive digital wallet file that contains all essential wallet information, including the public address, private key (seed), hexseed, mnemonic phrase, and more.

**Important:**

* **Security:** This file should always be encrypted and never shared publicly, as it grants complete access to the wallet.
* **Storage:** Careful consideration should be given to how and where this file is stored to prevent unauthorized access.

Here's an example structure of what a wallet.json file might contain, showing the unencrypted format for clarity:

```json
[
  {
    "address":"Q0105002c84abbc4e364a0b9b98d748e06d11b1916fda745f7370c024ec015633608db39e21c4d6",
    "addressB32":"q1qyzsqtyy4w7yudj2pwde346gupk3rvv3dld8ghmnwrqzfmqp2cekprdn2kstr0",
    "pk":"010500aeaa4afa476b57235a0bb0204d4a689c997e7ef625d771545186ca2f162f41ecf6f9a3b285631b123f5a452dfcaeb12473171e01e0d1e52c6b36ba8948055028",
    "hexseed":"01050056f9aa2189bca075d93043e958d0c5434f34149b4bb8d44e243a8a4119f9427d02a65fcef820f504f7831eae906ba67d",
    "mnemonic":"absorb filled frank opaque byte ornate pause gleam corps dome full assert ear vigil behind remove rival effort card pore drool pass dusk sorrow plight worse wet axes air knock bubble trance horrid hedge",
    "height":8,
    "hashFunction":{},
    "signatureType":{},
    "index":0,
    "walletType":"seed",
    "encrypted":false
  }
]
```

This file can be uploaded to the wallet software encrypted or unsecured, and will allow the wallet software to regenerate the full Merkle tree for the given address, facilitating full interaction with the blockchain and access to all funds.


# BTQ Web Wallet

BTQ Web Wallet usage

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><a href="/pages/gP3D1mDw9r4ROR4f2iKL">Overview</a></td><td>BTQ web wallet overview.</td><td></td></tr><tr><td><a href="/pages/UHRi6zAZGyc4vOTiXChc">New</a></td><td>Create a new address using the online web wallet.</td><td></td></tr><tr><td><a href="/pages/Fjq4EcYvdC3vo0BH7xOx">Open</a></td><td>Open BTQ address using the web wallet.</td><td></td></tr><tr><td><a href="/pages/i5PhcoCVIfDzGpRh5T8B"><strong>Send</strong></a></td><td>Send Funds using the web wallet.</td><td></td></tr><tr><td><a href="/pages/fZbvlY1liKQ3xlCNhSRX">Backup</a></td><td>Backup BTQ address keys using the web wallet.</td><td></td></tr></tbody></table>


# Overview BTQ Web Wallet

The BTQ Web Wallet

The BTQ Web Wallet offers the most straightforward interface for interacting with your BTQ wallet. It can be accessed at <https://wallet.bitcoinq.xyz>, where users can create new addresses, transact on the network, and access a variety of on-chain tools.

## Note

All secure cryptographic operations in the BTQ Web Wallet are executed locally in your browser or desktop application through a WebAssembly-compiled version of the BTQ library. The private keys remain within the memory space of the wallet application and are automatically erased the moment the browser window is closed.

## General Info

BTQ, being a quantum-resistant blockchain, utilizes hash-based cryptography which necessitates a new signature for each transaction. The One-Time Signature (OTS) Keys must not be reused:

* **Once all OTS Key indexes are consumed, the address can no longer initiate outbound transactions.**

## Best Wallet Practices

* **Track OTS Key Usage:** Keep a record of all OTS Key indexes used in a digital spreadsheet or physical ledger.
* **Backup:** Securely backup your wallet data onto paper or other durable media.
* **Private Key Storage:** Store your private keys offline in a secure location to prevent unauthorized access.

## OTS Key Index

Creating a new wallet generates an XMSS tree filled with multiple OTS keys. Each transaction uses one OTS key index, and each key can only be used once:

* **Caution:** If you exhaust all OTS Key Indexes while funds remain in the wallet, those funds will become permanently inaccessible!

## BTQ Web Wallet Functionalities

* **New Web Wallet:** Create a new BTQ wallet using the web interface.
* **Open Web Wallet:** Access an existing BTQ wallet.
* **Send Web Wallet:** Execute transactions using the web interface.
* **Backup Web Wallet:** Securely backup your BTQ wallet.

## Checking a Wallet Balance

* With the wallet interface open, you can view your balance directly on the main screen.
* Alternatively, use the BTQ Explorer to check your balance without opening the wallet by entering your address in the search field. This will display all transactions associated with the address, along with the current balance of BTQ and any tokens.

## Finding Remaining OTS Keys

* To determine the number of remaining OTS keys, navigate to the OTS tab in the Block Explorer. Enter your address in the search bar and select the OTS tab to view which keys have been used and identify the next available key.

This comprehensive guide to using the BTQ Web Wallet ensures that users can manage their assets securely while adhering to the best practices of a quantum-resistant cryptocurrency.


# New BTQ Address

Creating a new BTQ (Bitcoin Quantum) address

Creating a new BTQ (Bitcoin Quantum) address is both simple and secure. Start by visiting the BTQ web wallet at <https://wallet.bitcoinq.xyz>.

## Backup and Verify the Address Recovery Media

Before transferring any funds to your new address, ensure that you can access the address using your backup media!

From the main menu of the BTQ web wallet, select the "New Wallet" tab to begin.

## Set a Strong Password

Enter a strong password in the provided field. The password should be at least 8 characters long and include at least one number and one letter.

## Optional Wallet Configuration

While the default settings are suitable for most users, you have options to customize your wallet further:

### **Tree Height**

This setting determines the size of the XMSS tree, which controls the number of One-Time Signatures (OTS) your wallet can use safely on the blockchain.

* **Tree Height 8:** Provides 256 OTS keys.
* **Tree Height 10:** Provides 1,024 OTS keys.
* **Tree Height 12:** Provides 4,096 OTS keys.
* **Tree Height 14:** Provides 16,384 OTS keys.
* **Tree Height 16:** Provides 65,536 OTS keys.
* **Tree Height 18:** Provides 262,144 OTS keys.

A higher tree height means more time required to generate the keys but allows more transactions before needing a new address.

### Hash Functions

You can choose from multiple secure hash functions for your wallet. By default, BTQ wallets use the SHA-3 based shake128 hash function, but other options are available:

* **shake128 (SHA-3):** Default hash function used in the web wallet.
* **sha2\_256 (SHA-2):** An alternative option.
* **shake256 (SHA-3):** Another SHA-3 variant.

All selected hash functions are secure, and the default is typically sufficient for most users.

## Create Wallet

After setting your password and adjusting the configuration settings, click the "Create Wallet" button. A new wallet will be generated, and a sensitive screen will display your:

* **Public BTQ Address:** Your wallet's public identifier.
* **Mnemonic Phrase:** A list of words that store all the information needed to recover your wallet.
* **Hexseed:** A hexadecimal string that also can recover your wallet.

## Important: Record Your Private Keys!

It is crucial to securely record your private keys. Consider saving a secure, encrypted wallet.json file, which will require your password to access. Do not forget this password!

Welcome to the realm of Quantum Resistance with BTQ!


# Open BTQ Wallet

Interact with a BTQ wallet

To interact with a BTQ wallet, it must be accessed using the private keys generated during the wallet creation process.

## Access the BTQ Web Wallet

Start by visiting the BTQ Web Wallet at <https://wallet.bitcoinq.xyz> to begin the process of opening your wallet.

## Private Keys

Your BTQ wallet can be opened using any of the following recovery methods:

### **Recovery Key Mediums**

* **Mnemonic Phrase:**
  * A wordlist of 34 selected words from the master BTQ wordlist.
  * Typically provided during the wallet creation process and available through backup functions in the wallet applications.
* **Hexseed:**
  * A hexseed consisting of 102 mixed alphanumeric characters.
  * Available through wallet creation or the "Backup Wallet" function in wallet applications.
* **wallet.json file:**
  * Contains the Hexseed and Mnemonic, as well as the Public Key.
  * Often encrypted; a passphrase will be required to access it.
  * Generated from desktop, web, and CLI wallet applications.

### Test Your Backups!

These keys provide full access to the wallet and all funds contained within. Ensure that you secure them properly to protect the security of your funds.

## Opening Your BTQ Wallet

Using one of the recovery methods mentioned, access your wallet to manage transactions:

* **Using Wallet.json File:**
  * Select the wallet.json file stored on your local computer and, if applicable, enter the encryption passphrase.
  * Click "Unlock Wallet" to open your BTQ wallet, allowing you to check balances and interact with the network.
* **Using Mnemonic Phrase:**
  * Open the wallet web page, select the "Open Wallet" tab, and choose "Mnemonic Phrase" from the dropdown.
  * Enter the Mnemonic phrase into the form and click "Unlock Wallet" to access your wallet.
* **Using Hexseed:**
  * Open the wallet web page, select the "Open Wallet" tab, and choose "Hexseed" from the dropdown.
  * Enter the Hexseed into the form and click "Unlock Wallet" to open your wallet.

These methods ensure secure access to your BTQ wallet, enabling effective management of your digital assets.


# Send BTQ

Sending BTQ (Bitcoin Quantum) using the BTQ Web Wallet

Sending BTQ (Bitcoin Quantum) using the BTQ Web Wallet is straightforward and secure. Ensure you have access to your wallet using your private recovery keys, that there are sufficient funds in your address, and that you know the public address of the recipient.

## Accessing Your Wallet

Refer to the guide on opening the web wallet with recovery keys to access your wallet.

### Send BTQ

Once your wallet is open, navigate to the "Send & Receive" tab, which is typically the default tab when you open your wallet.

**Required Fields to Send BTQ:**

* **Recipient Address:** Enter a valid BTQ address that will receive the funds.
* **Amount:** Specify the amount of BTQ to send.
* **Fee:** Enter the fee amount for broadcasting the transaction onto the network.
* **OTS Key Index:** Use an unused One Time Signature (OTS) Key to sign the transaction.

**Important:** Keep track of your OTS Key usage. Although the web wallet monitors your OTS key index from the blockchain, it is good practice to record this number after each transaction.

After entering all the necessary information, click the "Confirm" button at the bottom of the form. This will compile and sign the transaction for broadcast to the network.

## Broadcast Transaction

On the following page, verify all transaction details are correct, then click "Click To Send" to transmit the transaction to the BTQ network.

The transaction will spread across the BTQ network and be credited to the recipient's address. Your screen will display the confirmation details as the transaction processes.

### Confirm Transaction

To confirm that a transaction was successfully sent and acknowledged by the network, select the transaction in your wallet's list to view details.

You can also enter the transaction hash or ID into the "Verify Transaction" tab to obtain various data on the transaction, including the number of confirmations (blocks) it has received.

**Example Transaction Hash:** 60a3d4ee64291a0d8c56a3e2092e6f32e7234c943c10d633754c1dd850153365

For additional confirmation, you can visit the BTQ Block Explorer.

### Receiving BTQ

To receive BTQ, simply provide your public address to the sender. You do not need to have the wallet open to receive BTQ.

## **Locate Public Address**

Your public address can be accessed through the BTQ Web Wallet:

* Open your wallet, and the public address will be visible at the top of the "Send & Receive" tab.
* Click the receive tab in the wallet to view your wallet address and a QR code with additional wallet details.

Share this public key with whoever is sending you coins.

**Example Public Key:** Q000400202ea4dc2b83ded8cfcd4fc8c0447ca3391582430cec6b093291ab9773173af1bb5ed7e8

This comprehensive approach allows for secure management and transfer of BTQ assets within the network.


# Backup

Backing up your BTQ (Bitcoin Quantum) Web Wallet

Backing up your BTQ (Bitcoin Quantum) Web Wallet is an essential step to ensure the security of your digital assets. Here’s how you can securely back up your wallet address using the BTQ Web Wallet.

## General Information

The BTQ Web Wallet provides several methods for backing up your wallet during and after the address creation process. These methods will allow you to recover your wallet in the future.

## **Recovery Key Mediums**

* **Mnemonic Phrase:** A wordlist of 34 selected words from the master BTQ wordlist. Typically provided during the wallet creation process and available through the backup functions of the wallet applications.
* **Hexphrase:** A hexstring consisting of 102 mixed alphanumeric characters, also provided during most address generation processes or found in the "Backup Wallet" function.
* **wallet.json file:** Contains both Hexseed and Mnemonic as well as the Public Key. This file may be encrypted (recommended) and will require a passphrase to open. It is generated from the desktop, web, and CLI wallet applications.

### Strong, Long-lasting Backup Methods

It is crucial to store your backup data securely. Strong, durable methods like physical media or encrypted digital files are recommended for successful long-term backup.

### Test Your Backups!

It is vital to test your backups immediately after creation by trying to open the wallet using the backed-up data. This ensures the backup is correct and will function when needed.

## Backup Process

### **During Address Creation**

When you create a new address, the web wallet will prompt you to save the private details of your new address. You can choose to:

* Write down the mnemonic phrase or hexseed on paper and store it in a secure location.
* Save a copy of the wallet.json file in multiple locations. If encrypted, the file uses AES encryption with a passphrase you set during address creation.

### **Backup an Existing Wallet**

After creating an address, you can access the recovery seed at any time:

* In the BTQ Web Wallet, go to the "Receive" tab and select "View Recovery Seed."
* This will display the hexseed, mnemonic phrase, and a QR code containing this information.
* Securely copy this information onto another medium, such as a flash drive or external hard drive, and store it in a safe place.

### Recovering a Backup

To recover a BTQ wallet, you will need access to the secret keys associated with the address:

1. Open the web wallet software and choose to open an address.
2. Select the backup format (mnemonic phrase, hexseed, or wallet.json file) from the dropdown.
3. Enter the relevant data in the field and select "Unlock Wallet."
4. If using an encrypted wallet file, also enter the encryption passphrase.

The wallet will then load, showing all transactions related to this address.

## Troubleshooting Backup Wallets

If issues arise when opening the wallet:

* Verify the wallet.json file in a text editor to ensure it's in JSON format and check if the correct encryption passphrase is being used.
* Remember, without the correct encryption passphrase, the encrypted wallet file cannot be accessed.

By following these steps, you can effectively back up and secure your BTQ wallet, safeguarding your digital assets against potential threats or losses.


# BTQ Explorer Usage


# BTQ Explorer Overview

Here's the corrected and detailed guide for the BTQ Explorer

## BTQ Explorer Overview

The Block Explorer is a portal into the BTQ blockchain, allowing users to lookup information directly from the chain.

The explorer is connected through a BTQ node, and the information provided is sourced from the immutable data contained in the blockchain. All transactions, addresses that have seen transactions, tokens, mining payouts, etc., are stored and accessible through the explorer.

**NOTE:** An address that has been generated but has not transacted on-chain, either received or transmitted, will not be found with the explorer. A transaction is required prior to being discoverable by the explorer.

More information can be found in the Address Documentation.

The main explorer page can be accessed through any modern web browser and is located at <https://explorer.bitcoinq.xyz>.

From the main page, there are links along the sidebar for all of the various functions of the tool. These link to additional functionality that expands on the main page info.

* **Blocks**: Shows the latest blocks minted onto the chain.
* **Recent Transactions**: Shows a list of the latest transactions shown on the chain.
* **Unconfirmed Transactions**: Shows any transactions that are in the Mempool awaiting a block to mint.
* **Peers**: Gives a list of all peers the explorer node is aware of.
* **Richlist**: Full list of all public addresses ranked in total value.
* **Wallet**: This is a link to the BTQ Web Wallet.

## Network Status

This section gives overall information on the network and is pulled directly from the BTQ node that the explorer is using. This helps to verify that the node is synced and up to date, ensuring correct blockchain information is provided.

* **Connected Status**: This gives confirmation that the node is connected to other peers and is working to secure and further the chain.
  * Example status: `Connected: SYNCED`
* **Uptime**: This gives the connected explorer node's uptime, or how long the node has been connected and functioning on the chain.
  * Example status: `Uptime: 30d 1h 44min`
* **Network Code Name**: This section gives information on the chain connected to using the chain's code name. For MainNet, this will be "Mainnet," the code name given to the chain at the time of genesis, or the launch of the chain.
  * Example status: `Mainnet`
  * **INFO**: TestNet will have a different code name, and this will change each time the test network is restarted. Ensure you are looking at the correct chain information!
* **Active Peers**: This section prints the number of active peers that are connected to the explorer node. This is not necessarily the total number of peers connected on the entire chain due to how Peer-To-Peer networks function.
  * Example status: `Explorer node active peers: 63`
* **Version**: This information refers to the version of core code that the node is running. This can be found in the core code repository located in BTQ's GitHub.
  * Example status: `Version: 4.0.0 python`
  * **INFO**: At the time of writing, the latest version is 4.0.0

## Blocks

The blocks section covers information on the connected node related to blocks found in the chain. These blocks contain all transactions minted in that block, as well as the mining reward that is paid to the miner who minted the block.

* **Max Index**: The max index section shows the current block height as seen by the connected node. If the Connected status is SYNCED, this will be the agreed and coordinated block height of all connected nodes, and the latest block of the chain.
  * Example status: `Max Index: 2579678`
  * **INFO**: If you are syncing a local node, this number should match once your node is fully synced.
* **Block Time**: This gives the last time between minting new blocks, or the time taken to mine and agree on consensus of the chain by all nodes. This time may fluctuate a little depending on network traffic and the amount of mining hashrate seen on the network.
  * Example status: `Block Time: 58`
* **Block Time Std Dev**: This shows the standard variation of block time between blocks.
  * Example status: `Block Time Std Dev: 64`
* **Coin Supply**: This section shows general information on the emissions of the block rewards and total amount of coins mined and to be mined.
  * **Emission**: This is the percentage of total coin supply that has been distributed, and the total number of BTQ in circulation.
    * Example status: `Emission: 32% (3,200,307.48)`
  * **Unmined**: This shows the total supply that is yet to be mined and distributed in block rewards. These BTQ will be distributed over the exponential decay curve over the next estimated 1000 years, a 5% reduction in block rewards every 525,600 blocks.
    * Example status: `Unmined: 17,799,692.52`
  * **Block Reward**: This is the current block reward that is distributed to the miner who mints the next block. This number will continue to diminish according to the emission algorithm.
    * Example status: `Block Reward: 1.733252118`

## Hash Graph

The graph shows various information on the mining status and difficulty of the chain. This information changes depending on a few different conditions such as the network hashrate, connected miners, and recent changes to the hashrate that affect the difficulty of mining operations.

## Latest Blocks

This section shows the latest blocks that have been mined. You can select a block by clicking on it to delve into the details for that block.

**INFO**: See the Block Lookup documentation for more information.

## Latest Transactions

The latest transactions section shows any transactions that have shown up in the mempool since the last block was mined, as well as some of the most

This guide ensures you can effectively use the BTQ Block Explorer to interact with and monitor the BTQ blockchain.


# BTQ Explorer Address Lookup

Here's the adapted guide for the BTQ Explorer Address Lookup

## Explorer Address Lookup

The address lookup tool is provided in the BTQ Explorer and is accessible using any modern browser.

Looking up an address is as simple as entering the valid BTQ address into the explorer search bar. This will browse to a screen that will print all relevant information on the address given, if found.

**CAUTION:** A BTQ address starts with a `Q` and is 79 characters in length. Ensure that you don't post your private keys! For more information on BTQ addresses and private keys, see the BTQ Address documentation.

**INFO:** An address that has been created in a wallet but has not interacted on the blockchain will not be shown in the explorer. Once there is a valid transaction with this address, information will be shown.

## Address Page

Once an address is entered, and if it is found on-chain, the resulting screen will print all information for the address as found on the blockchain. The balance, number of transactions, tree height, remaining signatures, and all transactions will be shown for the given address.

### **Balance**

At the top is the current balance of the address shown in `Quanta`, the denominator for BTQ.

Additionally, the balance is shown in the approximate value of USD based on recent trades on the exchanges.

This includes all validated transactions that are found. If there are pending transactions, you will need to wait for them to be validated and minted into a block to be shown here.

### **Address Information**

The information directly below the balance gives general information about the wallet address.

This includes:

* **Transactions**: Count of all transactions, incoming and outgoing, found for this address.
* **Nonce**: The last used nonce for the address.
* **Signature Scheme**: The signature scheme that was used to create the address.
* **Tree Height**: The tree height of the address.
* **Total Signatures**: Total available OTS keys, or signatures for the address.
* **Signatures Remaining**: Remaining signatures or OTS Keys.
* **Hash Function**: The hash function that was used to create the address.

### Address Page Tabs

Below the general address information is a list of tabs that hold information about various features of the address.

### **Quanta**

This is the list of transactions that have modified the `quanta` balance of the address or transfer\_tx types of transactions on chain. This includes any sent or received `quanta` related to the address.

This list is paginated. Browse through each page to see all historical transactions from the address.

### **OTS**

This tab shows all OTS keys that have been used and the remaining OTS keys available based on chain information.

Keys may have been sent to the mempool without being accepted in a block, so this list should be referred to only as a reference. Managing a personal list of OTS keys used should be done as good practice to avoid any key reuse.

**INFO:** See the One Time Signature Key documentation for more information on the OTS key system and the importance of not re-using OTS keys.

### **Slaves**

The last tab shows all slave addresses that may be associated with an address.

These are extensible addresses that have been created through advanced tooling to extend the available number of transactions that an address can send. Most addresses will not have anything here for typical users.

**INFO:** See the Slave Keys documentation for more on the extensible addresses available on the BTQ network, and how we solved the issue of OTS key use in large transaction systems, such as exchanges and mining pools.

This guide ensures you can effectively use the BTQ Block Explorer to lookup and understand the details of BTQ addresses.


# BTQ Explorer Transaction Lookup

Here's the adapted guide for the BTQ Explorer Transaction Lookup

## BTQ Explorer Transaction Lookup

A transaction can be looked up by providing the transaction hash to the BTQ Explorer search bar or by clicking on the txhash in a block or address lookup.

This lookup provides detailed information on the transaction and will vary depending on the type of transaction.

**INFO:** A transaction hash is a hexadecimal string that is unique to that transaction. Example txhash - `269f1f53a87dcaa87aa27ca6abf945109abf5d11cf28a6e3f9dae6bc73a2e606`.

For a detailed list of transaction types and their usage, see the developer documentation.

### Transaction Details

At the top of the transaction search screen is a list of general information related to the transaction that was queried.

* **Confirmations**: Example - `2579730 confirmations` - Number of blocks that have been confirmed since the transaction was minted.
* **Block**: Example - `15` - Block number from the transaction.
* **Nonce**: Example - `16` - Nonce the transaction used.
* **OTS Key**: Example - `12` - The One Time Signature Key used from the sending address.
* **Fee**: Example - `0.0005 Quanta` - Amount of BTQ that was used to submit the transaction.
* **Size**: Example - `19 Bytes` - Size of the transaction in the block.
* **Status**: Example - `OK` - Status of the sent transaction.
* **Time**: Example - `6:16 26 Jun 2018` - Time the transaction was sent and minted onto the chain.

### Transaction Information

Detailed transaction information is shown below for the transaction that was queried. This includes the type of transaction, sending BTQ address, receiving BTQ address, and amount sent for a typical transfer.

The large amount sent will also show a value in USD underneath; this is the current estimated value of the amount of BTQ transferred, not the historical value at the time of transfer.

Additional information is shown in the meta tab. This is the detailed information that has been simplified and presented on the page above. Most of the time, there is no need to view this data; however, there is no sensitive information contained within.

This guide ensures you can effectively use the BTQ Block Explorer to look up and understand the details of BTQ transactions.


# BTQ Explorer Block Lookup

Here's the adapted guide for the BTQ Explorer Block Lookup

## BTQ Explorer Block Lookup

To lookup a block on the chain, simply enter the block number into the search bar at the top of the BTQ Explorer site.

This will return all relevant information from that block as found in the immutable blockchain. This information will be the same no matter which node is queried as the chain came to consensus when the block was minted.

### Block Information

At the top of the page will be general information about the block, when it was minted, and how many transactions are contained in the block. At least one transaction will be found for every block called a coinbase transaction, which is the payout to the miner that minted the block.

| Information  | Example Data      | Notes                                                       |
| ------------ | ----------------- | ----------------------------------------------------------- |
| Transactions | 2                 | The number of transactions contained in the block           |
| Timestamp    | 06:16 26 Jun 2018 | When the block was minted on the chain                      |
| Epoch        | 0                 | The epoch the block was made in, increases every 100 blocks |
| Size         | 2.976 KB          | The total size of the block                                 |
| Reward       | 6.656333953 BTQ   | Amount of BTQ given as a block reward to the miner          |
| Mining Nonce | 2781151944        | Nonce that was used for mining the block                    |

### Transactions

Below the block information will be a list of all transactions contained in the block queried. This information table is broken into multiple columns.

* **Type**: The type of transaction sent
* **Amount**: Amount of BTQ
* **Fee (Shor)**: Fee paid for the transaction
* **From**: From BTQ address
* **To**: To BTQ address
* **Txhash**: Transaction hash for the given transaction

### Meta Information

Below the table will be a dropdown that provides additional meta information related to the block and all of the transactions contained within.

This data is what the node returns and is used to provide the user-friendly information printed above.

This guide ensures you can effectively use the BTQ Block Explorer to look up and understand the details of BTQ blocks.


# BTQ Message Overview

Here's the adapted guide for the BTQ Message Overview

## BTQ Message Overview

The BTQ network supports on-chain messages providing a variety of functionality to the project. These messages are sent onto the BTQ network, writing data into the immutable quantum-resistant blockchain ledger.

Anyone is able to write data to the chain and can do so in multiple ways:

* **Transfer\_TX**: This message data is written during a transfer of funds. Most wallet software supports the addition of message data during a transfer of funds.
* **Message\_TX**: A dedicated message transaction where only the message data is transferred. Check the tools section of the BTQ Wallet software.

Messages can be retrieved by any user by simply searching for the block number that the message was added to or by searching the transaction hash using the BTQ block explorer.

**INFO:** Messages are limited to 80 bytes or 80 text characters that may be sent onto the BTQ blockchain. This limitation ensures blocks stay small in size.

### Transfer Transaction Message

During a typical transaction, where a user sends funds to another address, there is an additional and optional field that allows some message data to be inserted.

The use of this field is entirely up to the end user. For instance, it can be a simple text sentence that gives reference to the transaction for later, such as "Alice's weekly pay".

It may also be used to reference a transaction ID for some automated system to verify a user has sent funds, say in a point of sale payment system. The merchant could use this field to enter a unique transaction ID, then verify the funds were transferred into the merchant's address with a matching tx\_id prior to releasing a product to the customer.

The only limitation is the length of text (80 bytes or characters), and the user's imagination. Message data can be seen in the BTQ Explorer by referencing the transaction hash from the outgoing funds transfer.

### Message Transaction

This functionality has many uses and is the basis of a few other tools implemented on the BTQ chain, like the on-chain notarization functions.

At its core, the message is simply a string of text, established by the user sending the transaction. This string is limited to 80 bytes or text characters and will fail if anything larger than that is used.

**INFO:** To differentiate between established message types that have been implemented, the BTQ developers have established a standard message transaction encoding that allows a system to tell that the message is intended for processing. These systems then watch for this encoding and react accordingly.

The established message transaction encoding standard can be found at the BTQ GitHub repository and is hosted open source.

If you would like to add a new encoding to support a project you are working on, submit a PR to that repo following the standard set there.

This guide ensures you can effectively use the message functionality within the BTQ network for various purposes.


# BTQ Mining Overview

Explore the essentials of BTQ mining on our comprehensive overview page.

Mining BTQ is fundamental to the operation and security of the blockchain network. It rewards those who contribute their computing power to perform cryptographic hashes, which in turn supports the network’s security and utility.

{% hint style="info" %}
**BLOCK REWARDS**

Refer to the BTQ Emission documentation for details on block rewards.
{% endhint %}

## **Consensus Algorithm**

BTQ utilizes the Proof of Work (PoW) consensus algorithm called RandomX, which is optimized for traditional CPU hardware. This design makes the algorithm more efficient on CPUs, reducing the profitability of other mining devices such as ASICs and GPUs.

### **Mining Process**

Miners operate custom mining software and can use most modern computers to earn rewards for block validation. All mining PCs compete to find new blocks in a race for rewards. When a miner discovers a new block, the entire network moves on to the next block.

**Mining Options:** Modern processors can mine BTQ using either a full BTQ node or pool mining software like XMR-Stak. The more hashing power a miner contributes, the higher their chances of winning a block. While pool mining generally offers a better chance at finding blocks, solo mining strengthens the BTQ network by running a synced node and verifying transactions.

## **Solo Mining**

Solo mining involves using a BTQ node for mining, where the node’s CPU handles hashing independently. Any block discovered is verified through the locally synced node, enhancing network decentralization. The reward for finding a block solo is significant, although less frequent compared to pool mining.

{% hint style="info" %}
**Learn More:** Check our solo-mining guide and start syncing with the full BTQ Node Documentation.
{% endhint %}

## **Pool Mining**

Unlike solo mining, a mining pool distributes the workload and rewards among multiple CPUs. Each participant uses mining software that pools efforts to discover new blocks. Rewards are distributed based on the hash rate contributed by each miner to the pool.

**Mining Setup:** Miners typically configure each PC to direct all rewards to a common mining address, consolidating earnings from multiple devices into one account.

{% hint style="info" %}
**Tip:** Explore more about pool mining in our guide and check the pool list for opportunities to contribute your hashing power!
{% endhint %}

Mining BTQ not only provides an opportunity to earn rewards but also plays a crucial role in maintaining the security and integrity of the blockchain.


# BTO Solo Mining

Setting up solo mining for BTQ (Bitcoin Quantum)

Setting up solo mining for BTQ (Bitcoin Quantum) involves establishing a BTQ mining node on your PC or server. This setup allows you to mine BTQ while operating a full node on the BTQ network. To start mining, you will need to enable this feature in the node's configuration file.

## Requirements

* BTQ software installed and fully synced with the network.
* A BTQ wallet address to receive mining rewards.
* Some time to complete the setup.
* Local or remote shell access (e.g., SSH).

## Preliminary Checks

Ensure you have a fully functioning BTQ node that is synced with the blockchain. If you're just starting, refer to the BTQ Node overview for setup instructions.

You can check the status of your node by entering `btq state` into the command line, which will display the Blockheight of your node and other relevant information. Make sure this matches the height shown on the BTQ explorer.

### Configuration

Navigate to the default BTQ directory and edit the configuration file located at `~/$USER/.btq/config.yml`. If it doesn’t already exist, you’ll need to create it:

```bash
nano ~/.btq/config.yml
```

Below are the default settings for mining, which are not enabled initially:

```yaml
# --------------------------------------
#    Mining Configuration
# --------------------------------------
# mining_enabled: False
# mining_address: ''
# mining_thread_count: 0  # 0 auto-detect thread count based on the number of processors
#
```

To begin mining, change the settings by removing the `#` (comment) marks, setting `mining_enabled` to `True`, entering your BTQ wallet address, and configuring the `mining_thread_count` (0 for auto-detect based on your processor count):

```yaml
# --------------------------------------
#    Mining Configuration
# --------------------------------------
mining_enabled: True
mining_address: 'YOUR_BTQ_WALLET_ADDRESS'
mining_thread_count: 0  # 0 to auto detect thread count based on CPU/GPU number of processors
#
```

### Restart BTQ Node

After configuring, restart the BTQ node to apply the new settings. You must stop the node if it's still running, to ensure it picks up the new configuration:

```bash
start_btq
```

Once your node re-syncs with the network, it will begin mining the current blocks. You will see the mined rewards in the wallet address specified in your configuration file.

You can check the status of your node anytime by running:

```bash
btq state
```

This setup will integrate your machine into the BTQ network, enabling you to contribute to network security while earning mining rewards.


# BTQ Pool Mining

Pool mining with BTQ (Bitcoin Quantum)

Pool mining with BTQ (Bitcoin Quantum) is the collaborative effort of multiple users who combine their computing resources to achieve greater processing power. Participants share the rewards earned by the pool, proportionate to each miner's contribution.

To engage in BTQ pool mining without syncing the entire blockchain, you can connect to a BTQ mining pool and contribute your hashing power. This method allows you to use virtually any hardware, even without operating a full node.

## RANDOMX

BTQ employs the RandomX algorithm for validating work on the network. More detailed information about RandomX can be found on its [official GitHub repository](https://github.com/tevador/RandomX).

## Mining Pool Information

Important aspects to consider about mining pools:

* There is no official BTQ pool. The development team might only operate a TestNet pool for testing purposes.
* Most pools impose a fee for their services, which typically covers server maintenance and power costs; this fee is determined by the pool.
* Pools may vary in their minimum payout amounts. Always read the terms carefully to ensure you understand the pool's rules.
* It's advisable not to store your BTQ in the pool's wallet. If possible, transfer your earnings to your personal wallet as soon as you reach the minimum payout amount.
* To connect to a pool, you'll need a BTQ wallet address for receiving mining rewards. This address is used as your username for the pool. Additionally, you can track your miner's statistics by entering your wallet address on most mining pool websites.

### Requirements

* A computer for mining
* Mining software compatible with the pool
* A BTQ wallet address for receiving rewards

Mining with both CPUs and GPUs is possible, and the effectiveness of each depends on various factors that are beyond the scope of this guide.

### Mining Software

Download the appropriate mining software for your operating system and follow the setup instructions. Ensure you replace any placeholder with your actual BTQ wallet address.

#### **Example of Mining Software:**

* **XMRig**: Primarily a CLI tool, supports CPU and GPU (NVIDIA & AMD) mining, available for Windows, Linux, and OSX. Features include a guided start, open-source code, TLS support, an HTML statistics page, and a JSON API. Find it on [GitHub](https://github.com/xmrig/xmrig).

*Note: This list is not comprehensive and does not endorse any project. Most RandomX-compatible mining software should work; however, your experience may vary (YMMV).*

Most mining pools provide a "Getting Started" section on their website to assist with the setup. For further support, consider joining the BTQ community chat or forums.

This guide serves as a basic introduction to pool mining for BTQ, tailored for those who prefer not to manage a full node but still wish to participate in mining.

## BTQ Mining Pools

Below are the links to the Bitcoin Quantum (BTQ) mining pools:

* Silicon Valley, USA: [us.silicon-valley.pool.bitcoinq.xyz](http://us.silicon-valley.pool.bitcoinq.xyz)
* Phoenix, USA: [us.phoenix.pool.bitcoinq.xyz](http://us.phoenix.pool.bitcoinq.xyz)
* Dubai, UAE: [uae.dubai.pool.bitcoinq.xyz](http://uae.dubai.pool.bitcoinq.xyz)
* Singapore: [sg.singapore.pool.bitcoinq.xyz](http://sg.singapore.pool.bitcoinq.xyz)
* Hong Kong: [qq.hongkong.pool.bitcoinq.xyz](http://qq.hongkong.pool.bitcoinq.xyz)
* Jakarta, Indonesia: [in.jakarta.pool.bitcoinq.xyz](http://in.jakarta.pool.bitcoinq.xyz)
* Hong Kong, China: [cn.hongkong.pool.bitcoinq.xyz](http://cn.hongkong.pool.bitcoinq.xyz)

You can join any of these pools to combine computational power and share BTQ rewards efficiently.

{% hint style="info" %}
Please note that the mining pool in Shanghai, China: [~~qq.shanghai.pool.bitcoinq.xyz~~](http://qq.shanghai.pool.bitcoinq.xyz) has been removed.
{% endhint %}


# BTQ Node Overview

Discover the core functionalities and operations of BTQ nodes on our detailed overview page.

A BTQ node is a specialized computer that runs software developed by the BTQ team. These nodes are fundamental to the network's infrastructure, acting as the building blocks that strengthen the blockchain. Each node collaborates with others to achieve consensus on the blockchain's state, determining the next valid block in the chain.

Nodes play a crucial role in processing and incorporating transactions into the blockchain's history from the transaction mempool. This collective operation by various nodes across the network ensures a robust, decentralized agreement on each block, reinforcing the integrity and continuity of the distributed ledger. This is the essence of the BTQ blockchain, where each participating node helps to maintain the ledger's accuracy and security.

## BTQ Network

The Peer-To-Peer network formed by BTQ nodes provides the fundamental security that underpins the blockchain. Through sophisticated mathematical algorithms and an ultra-secure address scheme using post-quantum cryptography, BTQ has established one of the most secure and trusted blockchains in existence today.

Running a BTQ node is straightforward. To get started, refer to the installation documentation which will guide you through the setup process, ensuring you can contribute to the network's strength and participate actively in the BTQ ecosystem.

### Basic Functions of a BTQ Node

A BTQ node performs several critical functions that are essential for the maintenance and operation of the blockchain network:

1. **Validate Transactions**: Nodes ensure that all transactions meet the network's protocols and rules. This includes checking the validity of signatures and ensuring transactions do not double-spend.
2. **Mint New Blocks**: Nodes are responsible for creating new blocks. This involves selecting valid transactions from the mempool, forming them into a block, and solving the cryptographic puzzle necessary to add the block to the blockchain.
3. **Consensus on History**: Nodes work collaboratively to achieve consensus on a unified and immutable history of transactions. This process ensures that all copies of the distributed ledger are the same across the network.
4. **Provide Blockchain History**: Nodes make the blockchain's history accessible to anyone who wishes to validate past transactions or audit the ledger.
5. **API for Transactions**: Nodes provide an API that allows applications to interact with the blockchain. This includes sending transactions to the network and accessing information about the ledger.
   * **Sending Transactions**: Nodes receive transactions from users or applications and broadcast them to the network for validation and inclusion in the blockchain.
   * **Validating Funds in Wallets**: Nodes check the balance of addresses to confirm that they have sufficient funds to cover the transactions they are attempting to make.

These functionalities ensure that the BTQ blockchain remains secure, transparent, and accessible, allowing it to function effectively as a decentralized ledger.

### Broadcasting Transactions with a BTQ Node

When a transaction is sent to the BTQ network, it always interacts with a node, regardless of the source.

**How Transactions are Processed:**

1. **Transaction Initiation**: Users or applications, such as wallet software, initiate a transaction. The wallet uses a private key to sign the transaction, which is then forwarded to the network through a BTQ node managed by the foundation.
2. **Receiving Transactions**: The node listens for incoming transactions from users' wallet applications and takes the initial steps to process them.
3. **Verification Checks**: Before a transaction can enter the mempool (the collection of all transactions waiting to be confirmed and included in a block), the node performs several verification checks. These checks include:
   * **OTS Key Usage**: The node checks if the One-Time Signature (OTS) key used for signing the transaction has been previously used. If it has, the transaction is rejected to prevent the reuse of OTS keys, enhancing security against potential fraud.
   * **Fund Sufficiency**: The node verifies if the originating address has enough funds to cover the transaction fee and the amount being transferred. If not, the transaction is rejected.
4. **Broadcasting to Peers**: Once a transaction passes all checks, the node broadcasts it to other nodes in the network. This dissemination ensures that the transaction is added to the next available block, pending consensus from other nodes.

**Additional Information:**

* **OTS Key Documentation**: To understand more about how OTS keys work and why they must not be reused, users can refer to the OTS Key Documentation. This resource provides detailed insights into the security mechanisms embedded in the BTQ network through its use of post-quantum cryptographic methods.

In summary, every transaction broadcast through the BTQ network is carefully scrutinized by nodes to ensure it adheres to network rules and protocols. This process not only secures the network but also maintains the integrity and reliability of the blockchain.

### Chain Data Lookup in BTQ Network

**Overview** Chain data lookup is a critical process in the BTQ network that involves querying and verifying the history of addresses and transactions. This function ensures transparency and trust within the network by allowing any participant to access and verify transaction details.

**Process Details**

1. **Historical Data Access**: When an address balance is queried or a transaction is verified, the network looks up the historical data stored on the blockchain. This includes all past transactions linked to the specific address or the transaction details in question.
2. **Data Storage**: Transaction data and address histories are stored in the node's chain state files, which constitute a leveled database structure. This organization facilitates efficient data retrieval and management.
3. **Network Consensus**: All data on the blockchain, including transaction histories and address balances, has been validated and agreed upon by a majority of nodes in the network through the consensus process. This ensures that the data is accurate and reliable.
4. **Verification through P2P Syncing**: The peer-to-peer (P2P) syncing process is fundamental for maintaining the integrity of the blockchain. During this process, nodes continuously exchange data to keep their local copies of the blockchain updated and synchronized with the latest state of the ledger.
5. **Cryptographic Hash Verification**: To further validate transactions, nodes check cryptographic hashes provided by other peers in the network. These hashes serve as proofs of the transaction’s validity and integrity, ensuring that the data has not been altered.

**Importance of Chain Data Lookup**

* **Transparency**: Provides clear visibility into the transaction history and balances, crucial for trust and accountability in the network.
* **Security**: The use of cryptographic hashes and the consensus mechanism among nodes helps prevent fraud and unauthorized alterations of the blockchain.
* **Accessibility**: Enables participants to independently verify the legitimacy of transactions and the status of funds, which is essential for operational security and user confidence.

Through these mechanisms, the BTQ network maintains a secure, accurate, and transparent record of all transactions, ensuring that the blockchain remains a reliable and robust platform for digital transactions.


# BTQ Node Requirements

To operate a BTQ (Bitcoin Quantum) node, your system must meet specific requirements.

To operate a BTQ (Bitcoin Quantum) node, your system must meet specific requirements. This guide provides the minimum hardware and software requirements necessary to run a BTQ node effectively.

## Hardware Requirements

### **AES-NI and AVX2**

A processor with AES-NI support is crucial for the cryptographic functions of BTQ. AES enhances security, while AVX2, utilized by the Keccak hashing library, boosts hashing performance.

### **Compatibility Check**

To verify if your processor supports AES-NI and AVX2, use the following commands in a UNIX shell:

```bash
grep -m1 -o -E 'avx|aes' /proc/cpuinfo
```

Alternatively, you can use `lscpu`:

```bash
lscpu | grep -E 'aes|avx'
```

These commands will indicate if your system is compatible by showing supported features.

## **HDD Storage**

Sufficient storage is necessary to accommodate the blockchain's current and future growth. The BTQ node software syncs every block from its genesis, ensuring your node remains aligned with the network consensus.

## **Reliable Network Connection**

An uninterrupted network connection is essential as the node frequently exchanges data with others in the network, maintaining synchronization with the blockchain's current state.

## **Externally Reachable Node**

For a node to validate and relay blocks effectively, it must be externally accessible. This typically requires advanced configuration, including opening specific ports and ideally using a static IP address.

### **Modern 64-bit Processor**

A modern processor is recommended to support AES-NI and to ensure efficient node operations.

### Software Requirements

* **Python 3.6 or later**: The node software for BTQ is developed using Python, emphasizing the need for a recent version to support all functionalities.

These guidelines will help you set up and run a BTQ node, contributing to the network while ensuring robust performance and security.


# BTQ Node Uses

Running a valid and updated BTQ (Bitcoin Quantum)

Running a valid and updated BTQ (Bitcoin Quantum) node significantly contributes to the security and efficiency of the blockchain network. Here, we will explore the various functions and uses of a BTQ Node, expanding beyond the basics covered in previous documents.

## Security

At the heart of the BTQ blockchain lies a decentralized peer-to-peer network. This network achieves consensus on key aspects of the blockchain, such as block height, previous block header hash, transactions included in each block, and the mining rewards payout address. The overall security of the blockchain increases with the number of peers participating in this consensus process.

The threat of majority control by malicious actors, known as a 51% attack, can manipulate chain data and cause various blockchain exploits. The most effective defense against this threat is to increase the number of nodes, diluting the potential influence of any single malicious entity.

Additionally, running a node enhances the security of transactions made through it, ensuring they remain unaltered and are broadcast correctly to the legitimate network.

### Transaction Security

Transactions processed through a local, secure node are protected from tampering and are reliably broadcast to the active network, ensuring they are added to the correct version of the blockchain.

## Wallet Functions

A BTQ node plays a crucial role in broadcasting signed transactions to the network, ensuring they are added to a block that is validated and agreed upon by the network consensus. Transactions requiring a one-time signature (OTS) key for actions like sending BTQ, messaging, notarizing data, or creating tokens must be processed through a node. All BTQ wallet tools have the functionality to interact with a local node.

## Chain Analytics Functions

For accurate and uninterrupted data access, running a local node is advisable. This allows developers and users to access historical data and integrate new chain data seamlessly into their applications.

## Mining Functions

A full BTQ node can directly participate in mining using the computer's CPU, or facilitate pooled mining activities by coordinating multiple computers within a mining pool.

### Broadcasting Transactions

Every transaction sent to the network interacts with a node. For example, the wallet software signs a transaction with a private key, which is then transmitted via a BTQ node. The node checks the transaction for issues such as OTS key reuse—if the OTS key has already been used, the node rejects the transaction to prevent security risks.

### Chain Data Lookup

When querying an address balance or verifying a transaction, a BTQ node accesses the historical data stored in the blockchain. This data is maintained in the node’s state files, which are validated through a peer-to-peer syncing process and cryptographic verifications by network peers.

These functions highlight the critical role of BTQ nodes in maintaining the integrity, security, and functionality of the BTQ blockchain network.


# BTQ Node Config

BTQ Node Configuration

## BTQ Node Configuration

The BTQ node configuration allows users to customize settings via a configuration file located at `~/.btq/config.yml` in the local root BTQ directory.

**Important:** The node must be restarted to apply any modifications to the configuration if it is already running.

### **BTQ Mining Config**

Configure mining to utilize the local machine's processor.

| Directive             | Default | Description                                            |
| --------------------- | ------- | ------------------------------------------------------ |
| `mining_enabled`      | False   | Enable mining on the local node                        |
| `mining_address`      | None    | Wallet address to receive mining rewards               |
| `mining_thread_count` | 0       | Auto-detect thread count based on CPU/GPU capabilities |

**Example Mining Config:**

```yaml
##======================================
##   Mining Configuration
##======================================
mining_enabled: False
mining_address: 'Q010500f07a209bfa657e526118a9c5e40ecb5f69d3a8da991ddc1fe0269c7ec617f693f362a051'
mining_thread_count: 0
```

### **Ephemeral Config**

This function is still under development and may change in the future.

| Directive                 | Default | Description                      |
| ------------------------- | ------- | -------------------------------- |
| `accept_ephemeral`        | True    | Enable ephemeral traffic on node |
| `outgoing_message_expiry` | 90      | Message expires after 90 seconds |

**Example Ephemeral Config:**

```yaml
##======================================
##   Ephemeral Configuration
##======================================
accept_ephemeral: True
outgoing_message_expiry: 90
```

### **P2P Config**

Configure the Peer-to-Peer settings for the node.

| Directive                          | Default                             | Description                                                          |
| ---------------------------------- | ----------------------------------- | -------------------------------------------------------------------- |
| `max_redundant_connections`        | 5                                   | Max connections allowed from nodes with the same IP                  |
| `enable_peer_discovery`            | True                                | Allow discovery of new peers                                         |
| `peer_list`                        | \[IP addresses]                     | List of peers for P2P connections                                    |
| `p2p_local_port`                   | 19000                               | Locally bound port for connections                                   |
| `p2p_public_port`                  | 19000                               | Public port for forwarding connections                               |
| `p2p_q_size`                       | 10000                               | Size of the P2P queue                                                |
| `peer_rate_limit`                  | 500                                 | Max number of messages per minute per peer                           |
| `ban_minutes`                      | 20                                  | Minutes to ban offending peer IPs                                    |
| `monitor_connections_interval`     | 30                                  | Interval to monitor connections (seconds)                            |
| `max_peers_limit`                  | 100                                 | Max number of peers allowed to connect                               |
| `ntp_refresh`                      | 12                                  | Hours to refresh NTP sync                                            |
| `ntp_request_timeout`              | 10                                  | Seconds before NTP timeout                                           |
| `ntp_servers`                      | \['pool.ntp.org', 'ntp.ubuntu.com'] | NTP servers                                                          |
| `chain_state_timeout`              | 180                                 | Timeout for chain state (seconds)                                    |
| `chain_state_broadcast_period`     | 180                                 | Period for broadcasting chain state (must be less than ping timeout) |
| `transaction_pool_size`            | 25000                               | Transaction pool size                                                |
| `transaction_minimum_fee`          | 1000000000                          | Minimum transaction fee (in smallest unit)                           |
| `pending_transaction_pool_size`    | 75000                               | Size of the pending transaction pool                                 |
| `pending_transaction_pool_reserve` | 75                                  | Reserve for moving stale transactions                                |
| `stale_transaction_threshold`      | 15                                  | Blocks threshold before considering a transaction stale              |

**Example P2P Config:**

```yaml
##======================================
##   PEER Configuration
##======================================
max_redundant_connections: 5
enable_peer_discovery: True
peer_list:
 - 47.91.120.22
 - 47.242.207.111
 - 139.224.117.106
 - 8.219.202.7
p2p_local_port: 19000
p2p_public_port: 19000
p2p_q_size: 10000
peer_rate_limit: 500
ban_minutes: 20
monitor_connections_interval: 30
max_peers_limit: 100
ntp_refresh: 12
ntp_request_timeout: 10
ntp_servers:
  - 'pool.ntp.org'
  - 'ntp.ubuntu.com'
chain_state

_timeout: 180
chain_state_broadcast_period: 180
transaction_pool_size: 25000
transaction_minimum_fee: 1000000000
pending_transaction_pool_size: 75000
pending_transaction_pool_reserve: 75
stale_transaction_threshold: 15
```

### **Admin API Config**

Configure the administrative API of the BTQ node.

| Directive                      | Default     | Description                      |
| ------------------------------ | ----------- | -------------------------------- |
| `admin_api_enabled`            | False       | Enable the admin API             |
| `admin_api_host`               | "127.0.0.1" | Host for the admin API           |
| `admin_api_port`               | 19008       | Port for the admin API           |
| `admin_api_threads`            | 1           | Number of threads for admin API  |
| `admin_api_max_concurrent_rpc` | 100         | Max concurrent RPC for admin API |

**Example Admin API Config:**

```yaml
##======================================
##       ADMIN API CONFIGURATION
##======================================
admin_api_enabled: False
admin_api_host: "127.0.0.1"
admin_api_port: 19008
admin_api_threads: 1
admin_api_max_concurrent_rpc: 100
```

### **Public API Config**

Configuration settings for the public-facing API of the BTQ node.

| Directive                       | Default   | Description                       |
| ------------------------------- | --------- | --------------------------------- |
| `public_api_enabled`            | True      | Enable the public API             |
| `public_api_host`               | "0.0.0.0" | Host for the public API           |
| `public_api_port`               | 19009     | Port for the public API           |
| `public_api_threads`            | 1         | Number of threads for public API  |
| `public_api_max_concurrent_rpc` | 100       | Max concurrent RPC for public API |

**Example Public API Config:**

```yaml
##======================================
##       PUBLIC API CONFIGURATION
##======================================
public_api_enabled: True
public_api_host: "0.0.0.0"
public_api_port: 19009
public_api_threads: 1
public_api_max_concurrent_rpc: 100
```

### **Mining API Config**

Configuration settings for the mining-specific API of the BTQ node.

| Directive                       | Default     | Description                       |
| ------------------------------- | ----------- | --------------------------------- |
| `mining_api_enabled`            | False       | Enable the mining API             |
| `mining_api_host`               | "127.0.0.1" | Host for the mining API           |
| `mining_api_port`               | 19007       | Port for the mining API           |
| `mining_api_threads`            | 1           | Number of threads for mining API  |
| `mining_api_max_concurrent_rpc` | 100         | Max concurrent RPC for mining API |

**Example Mining API Config:**

```yaml
##======================================
##   Mining API Configuration
##======================================
mining_api_enabled: False
mining_api_host: "127.0.0.1"
mining_api_port: 19007
mining_api_threads: 1
mining_api_max_concurrent_rpc: 100
```

### **Debug API Config**

Configuration settings for the debug API, useful for troubleshooting and development.

| Directive                      | Default     | Description                      |
| ------------------------------ | ----------- | -------------------------------- |
| `debug_api_enabled`            | False       | Enable the debug API             |
| `debug_api_host`               | "127.0.0.1" | Host for the debug API           |
| `debug_api_port`               | 52134       | Port for the debug API           |
| `debug_api_threads`            | 1           | Number of threads for debug API  |
| `debug_api_max_concurrent_rpc` | 100         | Max concurrent RPC for debug API |

**Example Debug API Config:**

```yaml
##======================================
##        DEBUG API CONFIGURATION
##======================================
debug_api_enabled: False
debug_api_host: "127.0.0.1"
debug_api_port: 52134
debug_api_threads: 1
debug_api_max_concurrent_rpc: 100
```

### **GRPC Proxy Config**

Settings for the GRPC proxy, facilitating GRPC connections.

| Directive         | Default     | Description             |
| ----------------- | ----------- | ----------------------- |
| `grpc_proxy_host` | "127.0.0.1" | Host for the GRPC proxy |
| `grpc_proxy_port` | 18090       | Port for the GRPC proxy |

**Example GRPC Proxy Config:**

```yaml
##======================================
##       GRPC PROXY CONFIGURATION
##======================================
grpc_proxy_host: "127.0.0.1"
grpc_proxy_port: 18090
```

### **Wallet Daemon Config**

Configuration settings for the wallet daemon which handles wallet interactions via API.

| Directive            | Default           | Description                                     |
| -------------------- | ----------------- | ----------------------------------------------- |
| `public_api_server`  | "127.0.0.1:19009" | Server where the public API is available        |
| `wallet_daemon_host` | "127.0.0.1"       | Host for the wallet daemon                      |
| `wallet_daemon_port` | 18091             | Port for the wallet daemon                      |
| `number_of_slaves`   | 3                 | Number of slave processes for handling requests |

**Example Wallet Daemon Config:**

```yaml
##======================================
##      WALLET DAEMON CONFIGURATION
##======================================
public_api_server: "127.0.0.1:19009"
wallet_daemon_host: "127.0.0.1"
wallet_daemon_port: 18091
number_of_slaves: 3
```

### **Wallet API Config**

Settings for the API that allows wallet operations.

| Directive                       | Default     | Description                       |
| ------------------------------- | ----------- | --------------------------------- |
| `wallet_api_host`               | "127.0.0.1" | Host for the wallet API           |
| `wallet_api_port`               | 19010       | Port for the wallet API           |
| `wallet_api_threads`            | 1           | Number of threads for wallet API  |
| `wallet_api_max_concurrent_rpc` | 100         | Max concurrent RPC for wallet API |

**Example Wallet API Config:**

```yaml
##======================================
##        WALLET API CONFIGURATION
##======================================
wallet_api_host: "127.0.0.1"
wallet_api_port: 19010
wallet_api_threads: 1
wallet_api_max_concurrent_rpc: 100
```


# BTQ Node Installation

Installing a BTQ node

## BTQ Node Installation

Installing a BTQ node is straightforward and can be done on most modern operating systems. The installation depends on Python 3.6 or newer and the `pip3` Python package manager.

### **Minimum Node Hardware Requirements**

Basic requirements must be met to run a BTQ node efficiently. For detailed requirements, refer to the BTQ Node Requirements documentation.

## **Node Installation Instructions**

### **For Ubuntu and RedHat**

#### **BTQ RedHat Installation**

Follow these instructions to install a BTQ Node on a RedHat-based system:

1. **Update packages**

   ```bash
   sudo dnf update
   ```
2. **Enable Codeready Linux Builder repo for developer tools**

   ```bash
   subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
   ```
3. **Install requirements**

   ```bash
   sudo dnf install swig make gcc gcc-c++ redhat-rpm-config python36-devel python2-devel dnf-plugins-core boost-devel openssl-devel hwloc-devel
   ```
4. **Install latest CMAKE-3.21 from sources**
   * Remove old cmake if exists:

     ```bash
     sudo dnf remove cmake
     ```
   * Get and install the latest cmake:

     ```bash
     wget https://github.com/Kitware/CMake/releases/download/v3.21.3/cmake-3.21.3.tar.gz
     tar -xvf cmake-3.21.3.tar.gz
     cd cmake-3.21.3 && ./bootstrap && make && sudo make install
     ```
5. **Upgrade pip to latest version**

   ```bash
   pip3 install --user --upgrade pip
   ```
6. **Install latest Python packages**

   ```bash
   pip3 install --user service-identity==21.1.0 wheel -U setuptools
   ```
7. **Install BTQ**

   ```bash
   pip3 install --user -U bitcoinq
   ```

Here's the adapted installation guide for the BTQ node on Ubuntu:

#### BTQ Ubuntu Installation

Installation instructions for the BTQ Node on Ubuntu.

Tested on the latest LTS version, Ubuntu 20.04.

1. **Update and Upgrade Software Packages**

   ```bash
   sudo apt update && sudo apt upgrade -y
   ```
2. **Install the required packages for BTQ**

   ```bash
   sudo apt-get -y install swig3.0 python3-dev python3-pip build-essential pkg-config libssl-dev libffi-dev libhwloc-dev libboost-dev cmake libleveldb-dev
   ```
3. **Install the latest setuptools**

   ```bash
   pip3 install -U setuptools
   ```
4. **Install the latest service identity package**

   ```bash
   pip3 install service-identity==21.1.0
   ```
5. **Install BTQ**

   ```bash
   pip3 install -U bitcoinq
   ```

This guide should help you set up a BTQ node on Ubuntu efficiently.

### **Running BTQ**

After successful installation, BTQ command line tools are available for interaction with the node.

* **Start BTQ** To begin the syncing process, run:

  ```bash
  start_btq
  ```

  Expected output:

  ```
  2021-09-25 18:22:28,045|2.1.2 python|unsynced|MainThread | INFO : grpc public service - started !
  2021-09-25 18:22:29,049|2.1.2 python|synced  |MainThread | INFO : Status changed to ESyncState.synced
  ```
* **Help for `start_btq` command**

  ```bash
  start_btq -h
  ```

  This will display all available command options for running the BTQ node, similar to the `start_btq` command, adapted for BTQ specifics.

### **Systemd Service for BTQ Node**

Set up BTQ node to start at boot and restart automatically using systemd:

1. **Create systemd service file**

   ```bash
   sudo touch /etc/systemd/system/btq.service
   ```
2. **Edit the `btq.service` file** Use your preferred editor to add configurations that match your setup.
3. **Enable and start the service**

   ```bash
   sudo systemctl enable btq.service
   sudo systemctl start btq.service
   ```
4. **Check service status**

   ```bash
   sudo systemctl status btq.service
   ```

### **Crontab Script**

To ensure the BTQ node starts upon reboot, use a crontab entry:

1. **Create and edit start-node script**

   ```bash
   nano ~/start-node.sh
   ```

   Add the following:

   ```bash
   #!/bin/bash
   screen -dmS BTQ /home/user/.local/bin/start_btq
   ```
2. **Make the script executable**

   ```bash
   chmod +x ~/start-node.sh
   ```
3. **Edit crontab to run the script at reboot**

   ```bash
   crontab -e
   @reboot /home/$USER/start-node.sh
   ```


# BTQ Node Maintenance

Maintaining a BTQ (Bitcoin Quantum) node

Maintaining a BTQ (Bitcoin Quantum) node requires minimal effort, but there are several considerations to ensure its smooth operation over time.

## State File Growth

Like any blockchain, the BTQ chain grows with each new block added. This growth is crucial for achieving immutability, as it preserves the entire history of transactions for verification.

On average, the BTQ blockchain grows by about 2.95KB per block, with an average block time of around 60 seconds. As of the latest update, the blockchain requires approximately 10GB of space.

**Note:** It's important to plan for future growth; if the disk becomes full, the node will stop syncing new blocks. Currently, the blockchain occupies about 10GB of space at blockheight 1889766.

## BTQ Log

Node operations are logged in a file, typically located at `~/.btq/btq.log`. This log file rolls over into a backup once it reaches 100MB. These log files can accumulate, potentially using significant disk space, so monitoring them is advisable.

## Periodic Updates

Throughout the life of BTQ, the node software will require updates and upgrades:

### **Soft Fork**

A soft fork is an update that introduces new features or bug fixes while maintaining backward compatibility with older versions of the software. This means nodes running both old and new software can coexist on the same network. Soft forks do not require all node operators to update, and they generally affect only a subset of users.

### **Hard Fork**

A hard fork introduces significant changes that require all nodes to update to the latest software version. Failure to update by the specified blockheight results in the creation of two separate networks: one running the outdated software and another running the latest version. Nodes on the old software will not be recognized by the main network post-fork.

**Info:** Hard fork updates are announced well in advance of the fork height. It's recommended to join the BTQ mailing list or the support chat on platforms like Discord to stay informed about updates.

These maintenance tips will help ensure that your BTQ node operates efficiently and remains in sync with the network's latest standards and practices.


# BTQ Node CLI Wallet

BTQ Node CLI Wallet

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td>CLI</td><td>BTQ Node CLI Overview</td><td></td></tr><tr><td>Backup</td><td>Backup a BTQ Node CLI wallet address using the node CLI tools</td><td></td></tr><tr><td>Slaves Address</td><td>Generating slave xmss keys to extend the OTS count on an address.</td><td></td></tr></tbody></table>


# BTQ Node Command Line Interface

Here's the adapted guide for interacting with the BTQ network using the Command Line Interface (CLI)

## BTQ Node Command Line Interface

Interacting with the BTQ network can be done utilizing the CLI interface. This allows you to complete advanced tasks on the network. Using the CLI is straightforward, and there is a helpful `--help` section to guide you.

It is recommended that you have a local working installation of BTQ to use the CLI. Refer to the Node installation instructions to get started. Follow the guide to set up a BTQ node if you haven't already.

## **Remote Node Connection**

You can connect to a remote node that allows external connections. Use the `--host {REMOTE_IP_ADDRESS}` flag on the CLI to connect.

### **Overview**

Running commands using the BTQ node CLI requires the BTQ node software to be installed. Refer to the documentation for installation instructions and the full Node CLI documentation.

### **CLI Help**

All command line options have a help file available to assist in their usage. Simply add the `--help` option to the end of any command to see the help.

```bash
btq --help
```

### **Usage**

```bash
Usage: btq [OPTIONS] COMMAND [ARGS]...

  BTQ Command Line Interface

Options:
  -v, --verbose       verbose output whenever possible
  --host TEXT         remote host address             [127.0.0.1]
  --port_pub INTEGER  remote port number (public api) [19009]
  --wallet_dir TEXT   local wallet dir
  --json              output in json
  --version           Show the version and exit.
  --help              Show this message and exit.

Commands:
  slave_tx_generate    Generates Slave Transaction for the wallet
  state                Shows Information about a Node's State
  token_list           Fetch the list of tokens owned by an address.
  tx_inspect           Inspects a transaction blob
  tx_message           Message Transaction
  tx_multi_sig_create  Creates Multi Sig Create Transaction, that...
  tx_multi_sig_spend   Transfer coins from src to dsts
  tx_push              Sends a signed transaction blob to a node
  tx_token             Create Token Transaction, that results into...
  tx_transfer          Transfer coins from src to dsts
  tx_transfertoken     Create Transfer Token Transaction, which...
  wallet_add           Adds an address or generates a new wallet...
  wallet_decrypt
  wallet_encrypt
  wallet_gen           Generates a new wallet with one address
  wallet_ls            Lists available wallets
  wallet_recover       Recovers a wallet from a hexseed or mnemonic...
  wallet_rm            Removes an address from the wallet using the...
  wallet_secret        Provides the mnemonic/hexseed of the given...
```

**Example: `btq tx_transfer --help`**

```bash
Usage: btq tx_transfer [OPTIONS]

  Transfer coins from src to dsts

Options:
  --src TEXT               signer BTQ address
  --master TEXT            master BTQ address
  --dsts TEXT              List of destination addresses
  --amounts TEXT           List of amounts to transfer (Quanta)
  --message_data TEXT      Message (Optional)
  --fee DECIMAL            fee in Quanta
  --ots_key_index INTEGER  OTS key Index (1..XMSS num signatures)
  --help                   Show this message and exit.
```

### **Options**

These options allow advanced functionality like remote node connections.

```bash
  -v, --verbose       verbose output whenever possible
  --host TEXT         remote host address             [127.0.0.1]
  --port_pub INTEGER  remote port number (public api) [19009]
  --wallet_dir TEXT   local wallet dir
  --json              output in json
  --version           Show the version and exit.
  --help              Show this message and exit.
```

**Note:** These options must be entered directly after the `btq` command, before any sub-commands are given.

```bash
btq [OPTIONS] [COMMAND]
```

| Command Option | Comments                                                                                                                           |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `--host`       | \[default: 127.0.0.1] Host to connect to for network functions and chain data retrieval                                            |
| `--port_pub`   | \[default: 19009] Port to use to connect to node services for network functions and chain data retrieval using the node public API |
| `--wallet_dir` | Full path to the location of the `wallet.json` file to use for the function if not included in the local directory                 |
| `--json`       | Print command output as JSON data for scripting functions                                                                          |
| `--version`    | Print the version of the BTQ software and exit                                                                                     |
| `--help`       | Print the help file and exit                                                                                                       |

This guide should assist you in using the BTQ CLI for various tasks and advanced operations.


# BTQ Node CLI Wallet - Backup

Here's the adapted guide for managing and backing up a BTQ CLI wallet

## BTQ Node CLI Wallet - Backup

Backing up a BTQ CLI wallet is similar to the GUI wallets offered. Print the secret keys and store them somewhere safe.

Additionally, the `wallet.json` file can be encrypted using AES encryption and stored digitally until needed.

**TIP:** It's recommended that you store a copy of your private keys in at least 2 physical locations in case of catastrophe.

### **`wallet.json` Secrets**

Secret keys are stored in a `wallet.json` file when an address is created using the BTQ CLI. This wallet file is the same as what is generated in the web wallet and can be loaded there as well.

If the `wallet.json` is stored in plain text, unencrypted, the secret keys are simply contained in a JSON array inside of the file. Open or print the contents of the `wallet.json` file to get the secret keys:

```bash
cat wallet.json
```

Example content:

```json
{
  "addresses": [
    {
      "pk": null,
      "hexseed": "010400bc6ab22293abaa631fac6872cd1514aa7961e3de56766518158925ba97bebd50ca7855a5047eca0da6a9042171337ae4",
      "mnemonic": "absorb drank rust prone caller depict primal cowboy pulsar mare smoky five prime noble threat tile kedge flak berlin mutiny rose leap safer assume know gallop agony twelve audio hit agenda birch crisis quest",
      "height": 8,
      "hashFunction": "shake128",
      "signatureType": 0,
      "index": 0,
      "address": "Q01040094e6916e412d5b9e8db40d12c8f8fd224a5a33a31c191850ca6a55b102fdbdcbdcc59819"
    }
  ],
  "encrypted": false,
  "version": 1
}
```

### **Encrypted Wallet Keys**

In the same directory as your BTQ `wallet.json` file, enter the following command to print your private key information:

```bash
btq wallet_secret
```

This will prompt for an address from the wallet to print the secrets for:

```bash
wallet idx [0]:
```

If you only have one address, simply leave the default and hit enter. If the wallet file is encrypted, you will then be prompted for the passphrase used to set up the wallet.

**INFO:** This requires a BTQ wallet to have already been generated and to be in the local directory. To specify an additional directory location for the `wallet.json` file, use the `--wallet_dir {PATH}` flag.

After successful decryption, the private key information will be printed.

Example output:

```plaintext
Wallet Address  : Q000600f1afe2a5d8247779795f0eb0d5225e5fe7b91bcb38c614b5a62fa3df0f5cfe92e6355ace

Mnemonic        : aback grape latest ace ferry bucket creak safety hour russia parade site donor yeast tunnel dusty odd dirt mutual you brine might two mercy shady print smite wrap swan common coat modify leave tort

Hexseed         : 0006007a70174ec1ec32abd66c2bc59ecc9a3eefe7ec14299903d2928ff01da8c0ecf8a6c46aa9ccffd4dbe2ee2d38e57c3e7a
```

This information is needed to recover your wallet file. Store it in safe locations and ensure the recovery media is correct and opens the expected address.

{% hint style="info" %}
**WARNING:** Anyone with private key information can unlock the wallet and steal funds!
{% endhint %}

## **Recover Wallet**

To recover a wallet or load one onto a new computer, you will need one of three things:

1. The `wallet.json` file
2. If encrypted, the passphrase to decrypt
3. The mnemonic phrase in the correct order
4. The hexseed.

Without one of these, it is impossible to recover the wallet.

Additionally, you will need a wallet application. Any of the BTQ wallet applications can be used to recover an address. Load the `wallet.json` file to the application or enter the secret keys to recover the address.

### **CLI `wallet.json` Recovery**

If you have the `wallet.json` file, simply copy it over to the new machine and use the BTQ functions as needed. The CLI will recognize that a `wallet.json` file is found and load the secret keys from the file.

### **CLI Hexseed**

To recover using the Mnemonic phrase, use the `wallet_recover` command. By default, the command will expect a hexseed:

```bash
btq wallet_recover
```

You will be prompted for the hexseed you have saved. Ensure you enter it correctly. The wallet address will be printed, and you will have a chance to save it. Enter `yes` and your wallet will be recovered and saved into the directory you are currently in.

{% hint style="info" %}
**DANGER:** This will save your file as an unencrypted `wallet.json` file. Make sure you encrypt this file with a secure passphrase you will not lose.
{% endhint %}

### **Mnemonic Phrase**

To recover using the mnemonic phrase, use the `wallet_recover --seed-type mnemonic` command:

```bash
btq wallet_recover --seed-type mnemonic
```

You will be prompted for the mnemonic you have saved. Ensure you enter it correctly. The wallet address will be printed, and you will have a chance to save it. Enter `yes` and your wallet will be recovered and saved into the directory you are currently in.

{% hint style="info" %}
**DANGER:** This will save your file as an unencrypted `wallet.json` file. Make sure you encrypt this file with a secure passphrase you will not lose.
{% endhint %}

This guide ensures you can manage, back up, and recover your BTQ CLI wallet effectively.


# BTQ Node CLI Wallet - Slave Keys

Here's the adapted guide for managing BTQ CLI wallets with Slave keys

## BTQ Node CLI Wallet - Slave Keys

The BTQ wallet is an XMSS Merkle tree constructed using the private key to generate leaves. Each "leaf" can also generate a tree of OTS Slave keys that can be used to sign transactions. This allows further expansion of a BTQ wallet, extending the number of transactions you can process before needing to regenerate a new wallet.

To create a `slaves.json` file, you will need a BTQ `wallet.json` file and a working installation of BTQ. See the guide for creating a BTQ CLI Wallet.

Currently, the only way to generate a `slaves.json` file is by using the command line utility `btq`. This can be installed by following the BTQ Node Guide. You will need shell access and be logged into the computer running `btq`.

### **Create a `slaves.json`**

To generate a `slaves.json` file, you need to be connected to an active and synced node. This can be a local node or any of the peers shown in your node's peer list. You also need a wallet to use for the slaves file.

Assuming you have a synced node running on the local computer and a `wallet.json` file in the local directory, you can simply enter:

```bash
btq slave_tx_generate
```

You will be asked a few questions. You can generate a maximum of 100 slaves with a single master OTS key, which is used to sign the `slaves.json` file onto the network, validating the keys.

Example prompts:

```plaintext
Src []: 0              # Which address to use in the wallet file. 0 is the first address.
Master []:             # Master Address
Number of slaves [0]:  # Number of slaves * OTS_key_height (e.g., for tree height 10, this * 1024)
Access type [0]:       # Enter 0 to allow transactions, 1 for secure mining only
Fee [0.0]:             # Fee to pay to broadcast this across the network.
```

### **Number of Slaves**

| **Tree Height** | **Available Keys** | **With `slaves.json`** |
| --------------- | ------------------ | ---------------------- |
| 8               | 256                | 6,553,600              |
| 10              | 1,024              | 104,857,600            |
| 12              | 4,096              | 1,677,721,600          |
| 14              | 16,384             | 26,843,545,600         |
| 16              | 65,536             | 429,496,729,600        |
| 18              | 262,144            | 6.871947674×10¹²       |

This guide ensures you can effectively manage and expand your BTQ CLI wallet using Slave keys.


# Swap Token

Swapping tokens is an essential function in the crypto ecosystem, allowing users to exchange one cryptocurrency for another seamlessly.

This guide will provide an overview of how to swap tokens on different decentralized exchanges (DEXs) such as Serum DEX on Solana, PancakeSwap on Binance Smart Chain, and Uniswap on Ethereum.

## Overview

Swapping tokens involves the following general steps across various platforms:

1. **Access the DEX**: Open the DEX platform on your browser or app.
2. **Connect Your Wallet**: Link your cryptocurrency wallet to the DEX.
3. **Select Tokens**: Choose the token you want to swap and the token you want to receive.
4. **Enter Amount**: Specify the amount of tokens you wish to swap.
5. **Review Transaction**: Check the transaction details including exchange rates and fees.
6. **Approve and Swap**: Confirm the transaction and execute the swap.
7. **Verify Swap**: Verify the receipt of tokens in your wallet.

To get started, select one of the detailed tutorials below based on the DEX platform you wish to use:

## Tutorials

1. [How to Swap Tokens on Solana Using Serum DEX](/basic-tutorial/swap-token/how-to-swap-tokens-on-solana-using-serum-dex)
2. [How to Swap Tokens on PancakeSwap](/basic-tutorial/swap-token/how-to-swap-tokens-on-pancakeswap)
3. [How to Swap Tokens on Uniswap](/basic-tutorial/swap-token/how-to-swap-tokens-on-uniswap)

Each tutorial will guide you through the specific steps required to swap tokens on the chosen DEX platform.


# How to Swap Tokens on Solana Using Serum DEX

Here's a step-by-step tutorial on how to swap tokens on the Solana blockchain using the Serum decentralized exchange (DEX) via the Phantom wallet.

### **Prerequisites:**

1. **A Wallet:** You need a cryptocurrency wallet that supports Solana. Phantom is a popular choice.
2. **SOL for Gas Fees:** Ensure you have some SOL in your wallet to cover the transaction fees.
3. **Access to Serum DEX:** Access to Serum DEX through an interface like [Sollet](https://www.sollet.io/) or [Project Serum](https://projectserum.com/).

### **Step-by-Step Guide:**

1. **Install and Set Up Phantom Wallet:**
   * Download the Phantom wallet extension from the [official website](https://phantom.app/).
   * Follow the prompts to create a new wallet and securely store your recovery phrase.
   * Fund your wallet with SOL to cover transaction fees.
2. **Connect Your Wallet to Serum DEX:**
   * Go to the Serum DEX interface, such as [Sollet](https://www.sollet.io/) or [Project Serum](https://projectserum.com/).
   * Click on "Connect Wallet" and select Phantom from the options.
   * Follow the prompts to connect your Phantom wallet.
3. **Select Tokens to Swap:**
   * On the Serum DEX interface, select the "Swap" tab.
   * Choose the token you want to swap from the dropdown menu in the "From" section.
   * Choose the token you want to receive in the "To" section.
4. **Enter the Swap Amount:**
   * Enter the amount of the token you want to swap in the "From" field.
   * The corresponding amount of the token you will receive will be automatically calculated and displayed in the "To" field.
5. **Review Transaction Details:**
   * Check the details of the swap, including the exchange rate and any fees.
   * Pay attention to the "Price Impact" and "Minimum received" fields to understand the transaction's impact and ensure you're getting the expected amount.
6. **Adjust Slippage Tolerance:**
   * Slippage refers to the difference between the expected price of a trade and the actual price at which the trade is executed.
   * Click on the settings icon and adjust the slippage tolerance if necessary. The default is usually 0.5%, but you might need to increase it for more volatile tokens.
7. **Approve Token (if required):**
   * If you are swapping a token for the first time, you might need to approve it for trading.
   * Click "Approve \[Token]" and confirm the transaction in your wallet. This step authorizes Serum DEX to use your tokens.
8. **Swap Tokens:**
   * After approval, click the "Swap" button.
   * Review the transaction details in the popup and confirm the swap.
   * Confirm the transaction in your wallet to execute the swap.
9. **Transaction Confirmation:**
   * Wait for the transaction to be confirmed on the Solana blockchain. This may take a few seconds to minutes depending on network congestion.
   * You can check the status of your transaction in your wallet or by using a Solana blockchain explorer like [Solscan](https://solscan.io/).
10. **Check Your Wallet:**
    * Once the transaction is confirmed, the new tokens will be available in your wallet.
    * If the new tokens do not appear immediately, you may need to add the token contract address to your wallet manually.

***

### Tips and Warnings:

* **Gas Fees:** Solana transaction fees are generally very low, but it’s still good practice to check the current fees to choose an optimal time for your transaction.
* **Security:** Ensure you are using the official Serum DEX interface and be cautious of phishing sites.
* **Slippage:** High slippage tolerance can lead to unexpected losses, especially with low liquidity tokens.

By following these steps, you can easily swap tokens on the Solana blockchain using Serum DEX. Happy trading!


# How to Swap Tokens on PancakeSwap

Here's a step-by-step tutorial on how to swap tokens on PancakeSwap

### **Prerequisites:**

1. **A Wallet:** You need a cryptocurrency wallet that supports Binance Smart Chain (BSC). MetaMask is a popular choice.
2. **BNB for Gas Fees:** Ensure you have some BNB in your wallet to cover the transaction fees.
3. **PancakeSwap Interface:** Access to the PancakeSwap interface at [pancakeswap.finance](https://pancakeswap.finance/).

### **Step-by-Step Guide:**

1. **Connect Your Wallet:**
   * Go to the [PancakeSwap interface](https://pancakeswap.finance/swap).
   * Click on "Connect Wallet" at the top right corner.
   * Choose your wallet provider (e.g., MetaMask) and follow the prompts to connect your wallet.
2. **Select Tokens to Swap:**
   * In the "Swap" interface, select the token you want to swap from the dropdown menu in the "From" section.
   * In the "To" section, select the token you want to receive.
3. **Enter the Swap Amount:**
   * Enter the amount of the token you want to swap in the "From" field.
   * The corresponding amount of the token you will receive will be automatically calculated and displayed in the "To" field.
4. **Review Transaction Details:**
   * Check the details of the swap, including the exchange rate and any fees.
   * Pay attention to the "Price Impact" and "Minimum received" fields to understand the transaction's impact and ensure you're getting the expected amount.
5. **Adjust Slippage Tolerance:**
   * Slippage refers to the difference between the expected price of a trade and the actual price at which the trade is executed.
   * Click on the settings icon and adjust the slippage tolerance if necessary. The default is usually 0.5%, but you might need to increase it for more volatile tokens.
6. **Approve Token (if required):**
   * If you are swapping an ERC-20 token for the first time, you will need to approve it for trading.
   * Click "Approve \[Token]" and confirm the transaction in your wallet. This step authorizes PancakeSwap to use your tokens.
7. **Swap Tokens:**
   * After approval, click the "Swap" button.
   * Review the transaction details in the popup and confirm the swap.
   * Confirm the transaction in your wallet to execute the swap.
8. **Transaction Confirmation:**
   * Wait for the transaction to be confirmed on the Binance Smart Chain. This may take a few seconds to minutes depending on network congestion.
   * You can check the status of your transaction in your wallet or by using a BSC blockchain explorer like [BscScan](https://bscscan.com/).
9. **Check Your Wallet:**
   * Once the transaction is confirmed, the new tokens will be available in your wallet.
   * If the new tokens do not appear immediately, you may need to add the token contract address to your wallet manually.

***

### Tips and Warnings:

* **Gas Fees:** Binance Smart Chain fees are generally lower than Ethereum, but it’s still good practice to check the current gas prices to choose an optimal time for your transaction.
* **Security:** Ensure you are using the official PancakeSwap interface and be cautious of phishing sites.
* **Slippage:** High slippage tolerance can lead to unexpected losses, especially with low liquidity tokens.

By following these steps, you can easily swap tokens on PancakeSwap. Happy trading! '


# How to Swap Tokens on Uniswap

Here's a step-by-step tutorial on how to swap tokens on Uniswap

### **Prerequisites:**

1. **A Wallet:** You need a cryptocurrency wallet that supports Ethereum and ERC-20 tokens. MetaMask is a popular choice.
2. **ETH for Gas Fees:** Ensure you have some ETH in your wallet to cover the transaction fees.
3. **Uniswap Interface:** Access to the Uniswap interface at [uniswap.org](https://uniswap.org/).

### **Step-by-Step Guide:**

1. **Connect Your Wallet:**
   * Go to the [Uniswap interface](https://app.uniswap.org/#/swap).
   * Click on "Connect Wallet" at the top right corner.
   * Choose your wallet provider (e.g., MetaMask) and follow the prompts to connect your wallet.
2. **Select Tokens to Swap:**
   * In the "Swap" interface, select the token you want to swap from the dropdown menu in the "From" section.
   * In the "To" section, select the token you want to receive.
3. **Enter the Swap Amount:**
   * Enter the amount of the token you want to swap in the "From" field.
   * The corresponding amount of the token you will receive will be automatically calculated and displayed in the "To" field.
4. **Review Transaction Details:**
   * Check the details of the swap, including the exchange rate and any fees.
   * Pay attention to the "Price Impact" and "Minimum received" fields to understand the transaction's impact and ensure you're getting the expected amount.
5. **Adjust Slippage Tolerance:**
   * Slippage refers to the difference between the expected price of a trade and the actual price at which the trade is executed.
   * Click on the settings icon and adjust the slippage tolerance if necessary. The default is usually 0.5%, but you might need to increase it for more volatile tokens.
6. **Approve Token (if required):**
   * If you are swapping an ERC-20 token for the first time, you will need to approve it for trading.
   * Click "Approve \[Token]" and confirm the transaction in your wallet. This step authorizes Uniswap to use your tokens.
7. **Swap Tokens:**
   * After approval, click the "Swap" button.
   * Review the transaction details in the popup and confirm the swap.
   * Confirm the transaction in your wallet to execute the swap.
8. **Transaction Confirmation:**
   * Wait for the transaction to be confirmed on the Ethereum blockchain. This may take a few seconds to minutes depending on network congestion.
   * You can check the status of your transaction in your wallet or by using an Ethereum blockchain explorer like [Etherscan](https://etherscan.io/).
9. **Check Your Wallet:**
   * Once the transaction is confirmed, the new tokens will be available in your wallet.
   * If the new tokens do not appear immediately, you may need to add the token contract address to your wallet manually.

***

### Tips and Warnings:

* **Gas Fees:** Ethereum network fees can vary. Check the current gas prices to choose an optimal time for your transaction.
* **Security:** Ensure you are using the official Uniswap interface and be cautious of phishing sites.
* **Slippage:** High slippage tolerance can lead to unexpected losses, especially with low liquidity tokens.

By following these steps, you can easily swap tokens on Uniswap. Happy trading!


# Guide to Mine BTQ with XMRig

This guide will walk you through the process of setting up and running XMRig to mine BTQ on Windows, macOS, and Ubuntu.

## **Step 1: Download and Install XMRig**

**Windows**

1. Visit the official XMRig website: <https://xmrig.com/>.
2. Download the Windows version of XMRig.
3. Extract the downloaded file into a convenient folder.

**macOS**

1. Visit the official XMRig website: <https://xmrig.com/>.
2. Download the macOS version of XMRig.
3. Extract the downloaded file into a convenient folder.

**Ubuntu**

1. Open Terminal and run the following commands to update and install necessary packages:

   ```sh
   sudo apt update
   sudo apt install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
   ```
2. Clone the XMRig repository from GitHub and build the project:

   ```sh
   git clone https://github.com/xmrig/xmrig.git
   cd xmrig
   mkdir build
   cd build
   cmake ..
   make
   ```

## **Step 2: Configure XMRig**

**Windows**

1. Open the folder where XMRig was extracted.
2. Create a new file named `start_mining.bat`.
3. Open the file with Notepad and paste the following configuration:

   ```sh
   xmrig --donate-level 5 -o ip:port -u Address -p SiliconValleyUM --coin BTQ -a cn/1
   ```
4. Save the file and close Notepad.

**macOS and Ubuntu**

1. Open a Text Editor and create a new file named `start_mining.sh`.
2. Paste the following configuration into the file:

   ```sh
   ./xmrig --donate-level 5 -o ip:port -u Address -p SiliconValleyUM --coin BTQ -a cn/1
   ```
3. Save the file and close the Text Editor.
4. Open Terminal and navigate to the folder containing `start_mining.sh`.
5. Run the following command to make the script executable:

   ```sh
   chmod +x start_mining.sh
   ```

### BTQ Mining Pools

Below are the links to the Bitcoin Quantum (BTQ) mining pools:

* United Kingdom: uk.mining.pool.bitcoinq.xyz
* Czech Republic: cz.mining.pool.bitcoinq.xyz
* Finland: fi.mining.pool.bitcoinq.xyz
* Denmark: de.mining.pool.bitcoinq.xyz
* Germany: ge.mining.pool.bitcoinq.xyz

You can join any of these pools to combine computational power and share BTQ rewards efficiently.

## **Step 3: Run XMRig**

**Windows**

1. Double-click on the `start_mining.bat` file to start mining.

**macOS and Ubuntu**

1. Open Terminal.
2. Navigate to the folder containing `start_mining.sh` using the command:

   ```sh
   cd /path/to/your/folder
   ```
3. Run the script using the command:

   ```sh
   ./start_mining.sh
   ```

#### Parameters Explained

* `--donate-level 5`: Donation level to the developer (5%).
* `-o ip:port`: The address and port of the mining pool.
* `-u Address`: Your BTQ wallet address to receive mined coins.
* `-p SiliconValleyUM`: Worker name or pool password (depending on pool configuration).
* `--coin BTQ`: The coin you want to mine (BTQ - Bitcoin Quantum).
* `-a cn/1`: The algorithm used for mining (cn/1 - CryptoNight variant 1).

#### Notes

* Ensure you have all necessary drivers installed for your CPU/GPU.
* Check your internet connection to ensure you can connect to the mining pool.

With these steps, you are ready to start mining BTQ with XMRig on Windows, macOS, and Ubuntu. Good luck!


