Skip to content

Commit

Permalink
Port doc
Browse files Browse the repository at this point in the history
  • Loading branch information
timemarkovqtum committed Jun 17, 2024
1 parent 2d1d436 commit e3a3dad
Show file tree
Hide file tree
Showing 17 changed files with 529 additions and 230 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ first. See CONTRIBUTING.md

<!--
Please provide clear motivation for your patch and explain how it improves
Bitcoin Core user experience or Bitcoin Core developer experience
Qtum Core user experience or Qtum Core developer experience
significantly:
* Any test improvements or new tests that improve coverage are always welcome.
Expand All @@ -24,7 +24,7 @@ significantly:
was fixed.
* Features are welcome, but might be rejected due to design or scope issues.
If a feature is based on a lot of dependencies, contributors should first
consider building the system outside of Bitcoin Core, if possible.
consider building the system outside of Qtum Core, if possible.
* Refactoring changes are only accepted if they are required for a feature or
bug fix or otherwise improve developer experience significantly. For example,
most "code style" refactoring changes require a thorough explanation why they
Expand All @@ -36,7 +36,7 @@ significantly:
-->

<!--
Bitcoin Core has a thorough review process and even the most trivial change
Qtum Core has a thorough review process and even the most trivial change
needs to pass a lot of eyes and requires non-zero or even substantial time
effort to review. There is a huge lack of active reviewers on the project, so
patches often sit for a long time.
Expand Down
273 changes: 251 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,268 @@
Bitcoin Core integration/staging tree
=====================================
What is Qtum?
-------------

https://bitcoincore.org
Qtum is a decentralized blockchain project built on Bitcoin's UTXO model, with support for Ethereum Virtual Machine based smart contracts, and secured by a proof of stake consensus model. It achieves this through the revolutionary Account Abstraction Layer which allows the EVM to communicate with Qtum's Bitcoin-like UTXO blockchain. For more general information about Qtum as well as links to join our community, go to https://qtum.org

For an immediately usable, binary version of the Bitcoin Core software, see
https://bitcoincore.org/en/download/.
Welcome to the Qtum Fastlane Main Network. This is the main network where the tokens hold value and should be guarded very carefully. If you are testing the network, or developing unstable software on Qtum, we highly recommend using either testnet or regtest mode.

What is Bitcoin Core?
---------------------
The major features of the Qtum network include:

Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully
validate blocks and transactions. It also includes a wallet and graphical user
interface, which can be optionally built.
1. Compatibility with the Ethereum Virtual Machine, which allows for compatibility with most existing Solidity based smart contracts. No special solidity compiler is required to deploy your smart contract to Qtum.
2. A Proof of Stake consensus system which is optimized for Qtum's contract model. Any user can stake and help to secure the network. There is no voting, master nodes, or minimum amount required. There have been transactions as small as 2 Qtum that have created blocks in the past. Staking from smart contracts is under development.
3. The Decentralized Governance Protocol is completely implemented and functional, which allows certain network parameters to be modified without a fork or other network disruption. This currently controls parameters like block size, gas prices, etc.
4. Uses the UTXO transaction model and is compatible with Bitcoin, allowing for existing tooling and workflows to be used with Qtum. This allows for the infamous SPV protocol to be used which is ideal for light wallets on mobile phones and IoT devices.

Further information about Bitcoin Core is available in the [doc folder](/doc).
Note: Qtum Core is considered beta software. We make no warranties or guarantees of its security or stability.

Qtum Documentation and Usage Resources
---------------

These are some resources that might be helpful in understanding Qtum.

Basic usage resources:

* [User guide](https://docs.qtum.site/en/)
* [Qtum-Qt Wallet Tutorial](https://github.com/qtumproject/documents/tree/master/en/Qtum-Wallet-Tutorial#qtum-qt-wallet-tutorial)
* [Qtum staking tutorial](https://github.com/qtumproject/documents/tree/master/en/How-to-Stake-with-Qtum)
* [Qtum tutorial on Raspberry Pi](https://github.com/qtumproject/documents/tree/master/en/Qtum-on-Raspberry-Pi)
* [Running Qtum on Amazon AWS using Qtum AMI](https://github.com/qtumproject/documents/tree/master/en/Qtum-AWS)
* [Encrypting and unlocking wallet](https://github.com/qtumproject/documents/tree/master/en/Encrypt-and-Unlock-Qtum-Wallet)
* [Testnet guide](https://github.com/qtumproject/documents/blob/master/en/Testnet-User-Guide.md)
* [Block explorer](https://qtum.info), [Older explorer](https://explorer.qtum.org)


Development resources:

* [Qtum Book - A Developer's Guide To QTUM](http://book.qtum.site/en/)
* [Qtum contract usage](https://docs.qtum.site/en/QRC20-Token-Introduce.html)
* [Deploying a custom token to Qtum](https://blog.qtum.org/qtum-custom-token-walkthrough-467d725fa27d)
* [QtumJS document](https://qtumproject.github.io/qtumjs-doc/)
* [Smart contract ICO example](http://book.qtum.site/en/part3/ico.htm)
* [Early example faucet contract](http://earlz.net/view/2017/06/30/2144/the-qtum-sparknet-faucet)

General Info about Qtum:

* [CIRCLERESEARCH Qtum Primer](https://www.circle.com/marketing/pdfs/research/circle-research-qtum.pdf)
* [Qtum's PoS vs CASPER](https://www.reddit.com/r/Qtum/comments/788oa5/qtums_pos_vs_casper_and_the_nothingatstake_problem/)
* [Technical article explaining Qtum's PoS model in depth](http://earlz.net/view/2017/07/27/1904/the-missing-explanation-of-proof-of-stake-version)


Developer's Tools
-----------------

* Smart contract deployment tool
* https://github.com/qtumproject/solar
* DApp JavaScript Library
* https://github.com/qtumproject/qtumjs
* A toolkit for building qtum light wallets
* https://github.com/qtumproject/qtumjs-wallet
* CORS qtumd RPC proxy for DApp
* https://github.com/qtumproject/qtumportal
* Docker images for running qtum services
* https://github.com/qtumproject/qtum-docker
* qtum.info API that powers the block explorer and the QTUM Web wallet
* https://github.com/qtumproject/qtuminfo-api#qtuminfo-api-documentation


What is Qtum Core?
------------------

Qtum Core is our primary mainnet wallet. It implements a full node and is capable of storing, validating, and distributing all history of the Qtum network. Qtum Core is considered the reference implementation for the Qtum network.

Qtum Core currently implements the following:

* Sending/Receiving QTUM coins
* Sending/Receiving QRC20 tokens on the Qtum network
* Staking and creating blocks for the Qtum network
* Creating and interacting with smart contracts
* Running a full node for distributing the blockchain to other users
* "Prune" mode, which minimizes disk usage
* Regtest mode, which enables developers to very quickly build their own private Qtum network for Dapp testing
* Testnet mode, using the public Qtum Testnet, with faucet available
* Compatibility with the Bitcoin Core set of RPC commands and APIs
* Full SegWit capability with p2sh-segwit (legacy) and bech32 (native) addresses

Alternative Wallets
-------------------

Qtum Core uses a full node model, and thus requires downloading the entire blockchain. If you do not need the entire blockchain, and do not intend on developing smart contracts, it may be more ideal to use an alternative wallet such as one of our light wallets that can be synchronized in a matter of seconds.

### Qtum Web Wallet

A browser wallet that supports the Ledger hardware wallet, offline cold wallet, restoration from mobile wallets, creation of QRC20 tokens and QRC1155 NFTs.

Web site https://qtumwallet.org

User documentation https://github.com/qtumproject/documents/tree/master/en/QTUM-WebWallet-usage

### Qtum Electrum

A light wallet that supports the Ledger and Trezor hardware wallets and is based on the well-known Electrum wallet software.

Download: https://github.com/qtumproject/qtum-electrum/releases

### iOS and Android Wallets

These wallets run on mobile devices and synchronize quickly.

Android Download: https://play.google.com/store/apps/details?id=org.qtum.newwallet

iOS Download: https://github.com/qtumproject/qtum-ios (open source, deprecated)

### Qnekt Chrome Wallet

This light wallet runs in your Chrome browser as a browser extension, based on the popular MetaMask wallet.


### Community Resources

Make sure to check out these resources as well for more information and to keep up to date with all the latest news about Qtum. At least 1 developer is always around, so if you're developing on Qtum and need help, we'd love to welcome you to our community.

* @Qtum on Twitter https://twitter.com/qtum
* Qtum blog https://blog.qtum.org/
* Qtum Telegram Group https://t.me/qtumofficial, other languages available
* Qtum Discord https://discord.com/invite/DCPGvUCms5
* /r/Qtum on Reddit https://www.reddit.com/r/Qtum/
* Qtum.org https://qtum.org
* Qtum on Facebook https://www.facebook.com/QtumOfficial/

### Qtum Smart Contract Limitations

* EVM smart contracts cannot receive coins from or send coins to any address type other than pay-to-pubkeyhash (starts with Q) addresses. This is due to a limitation in the EVM
* Contracts are not allowed to create contracts with an initial endowment of coins. The contract must first be created, and then be sent coins in a separate transaction. Humans are also not allowed to create contracts with an initial endowment of coins.
* Although all of the infrastructure is present, Qtum Core does not currently parse Solidity event data. You must parse this yourself using either searchlogs or -record-log-opcodes features.
* It is not possible to send a contract coins without also executing the contract. This is also the case of Ethereum. This was promised in earlier discussions and technically does work, but due to lack of time for testing this feature was disabled.
* In Qtum there can be multiple addresses used to create a proof-of-stake block. However, the EVM can only see the first output using the coinbase operation in Solidity (this address is also the one registered for the continuous staker rewards after 2000 blocks).

----------

# Building Qtum Core

### Validate and Reproduce Binaries

Qtum uses a tool called Gitian to make reproducible builds that can be verified by anyone. Instructions on setting up a Gitian VM and building Qtum are provided in [Gitan Building](https://github.com/qtumproject/qtum/blob/master/doc/gitian-building.md)

### Build on Ubuntu

This is a quick start script for compiling Qtum on Ubuntu

```bash
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev libgmp3-dev bison libtool-bin
sudo apt-get install software-properties-common

# If you want to build the Qt GUI:
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode

git clone https://github.com/qtumproject/qtum
cd qtum
git submodule update --init --recursive

./contrib/install_db4.sh `pwd`
export BDB_PREFIX='/path/to/qtum/db4'

cd depends
make

# replace x86_64-pc-linux-gnu with the appropriate folder name for your system
libtool --finish depends/x86_64-pc-linux-gnu/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/x86_64-pc-linux-gnu/lib

# Note: autogen will prompt to install some more dependencies if needed
./contrib/install_db4.sh `pwd`
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
make -j$(nproc)
```

### Build on CentOS

Here is a brief description for compiling Qtum on CentOS, for more details please refer to [the specific document](https://github.com/qtumproject/qtum/blob/master/doc/build-unix.md)

# Compiling boost manually
sudo yum install python-devel bzip2-devel
git clone https://github.com/boostorg/boost.git
cd boost
git checkout boost-1.66.0
git submodule update --init --recursive
./bootstrap.sh --prefix=/usr --libdir=/usr/lib64
./b2 headers
sudo ./b2 -j4 install

# Installing Dependencies for Qtum
sudo yum install epel-release
sudo yum install libtool libdb4-cxx-devel openssl-devel libevent-devel gmp-devel

# If you want to build the Qt GUI:
sudo yum install qt5-qttools-devel protobuf-devel qrencode-devel

# Building Qtum
git clone --recursive https://github.com/qtumproject/qtum.git
cd qtum
./autogen.sh
./configure
make -j4

### Build on Mac OS

The commands in this guide should be executed in a Terminal application.
The built-in one is located in `/Applications/Utilities/Terminal.app`.

#### Preparation

Install the Mac OS command line tools:

`xcode-select --install`

When the popup appears, click `Install`.

Then install [Homebrew](https://brew.sh).

#### Dependencies

brew install cmake automake berkeley-db@4 libtool boost miniupnpc openssl pkg-config protobuf qt@5 libevent imagemagick librsvg qrencode gmp

NOTE: This will work for building on Intel Macs and Apple Silicon Macs

NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.

#### Build Qtum Core

1. Clone the qtum source code and cd into `qtum`

git clone --recursive https://github.com/qtumproject/qtum.git
cd qtum

2. Build qtum-core:

Configure and build the headless qtum binaries as well as the GUI (if Qt is found).

You can disable the GUI build by passing `--without-gui` to configure.

./autogen.sh
./configure
make

3. It is recommended to build and run the unit tests:

make check

### Run

Then you can either run the command-line daemon using `src/qtumd` and `src/qtum-cli`, or you can run the Qt GUI using `src/qt/qtum-qt`

License
-------

Bitcoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more
information or see https://opensource.org/licenses/MIT.
Qtum is GPLv3 licensed.

Development Process
-------------------

The `master` branch is regularly built (see `doc/build-*.md` for instructions) and tested, but it is not guaranteed to be
completely stable. [Tags](https://github.com/bitcoin/bitcoin/tags) are created
regularly from release branches to indicate new official, stable release versions of Bitcoin Core.

The https://github.com/bitcoin-core/gui repository is used exclusively for the
development of the GUI. Its master branch is identical in all monotree
repositories. Release branches and tags do not exist, so please do not fork
that repository unless it is for development reasons.
The `master` branch is regularly built and tested, but is not guaranteed to be
completely stable. [Tags](https://github.com/qtumproject/qtum/tags) are created
regularly to indicate new official, stable release versions of Qtum.

The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md)
The contribution workflow is described in [CONTRIBUTING.md](https://github.com/qtumproject/qtum/blob/master/CONTRIBUTING.md)
and useful hints for developers can be found in [doc/developer-notes.md](doc/developer-notes.md).

Testing
Expand Down
Loading

0 comments on commit e3a3dad

Please sign in to comment.