diff --git a/README.md b/README.md index 1e3d003ae1..d276d09cd1 100644 --- a/README.md +++ b/README.md @@ -1,209 +1,201 @@ - -
-

- - Logo - - -

Bitgesell (BGL)

- -

- Bitgesell (BGL) is a digital currency -
- Explore more about project » -
-
- English - · - Chinese -

-

- - - - -
- Table of Contents -
    -
  1. - About The Project - -
  2. -
  3. - Getting Started - -
  4. -
  5. Roadmap
  6. -
  7. Contributing
  8. -
  9. License
  10. -
  11. Contact
  12. -
  13. Translations
  14. -
-
- - - -## About The Project +### Bitgesell (BGL) + +Bitgesell (BGL) is a digital currency with built-in scarcity. + +[Explore more about the project](https://bitgesell.ca) + +English | [Chinese](README_zh.md) + +## Table of Contents +1. [About The Project](#about-the-project) +2. [Built With](#built-with) +3. [Building with Autotools](#building-with-autotools) +4. [Building with CMake](#building-with-cmake-experimental) +5. [Usage Examples](#usage-examples) +6. [Benchmark](#benchmark) +7. [Translations](#translations) +8. [Security](#security) +9. [Contributing](#contributing) -![Product Name Screen Shot](https://github.com/BitgesellOfficial/bitgesell/blob/master/share/pixmaps/BGL64.png) +## About The Project +![Bitgesell logo](https://github.com/BitgesellOfficial/bitgesell/blob/master/share/pixmaps/BGL64.png) +Bitgesell is a fork of Bitcoin with the following changes: -Features: -* secp256k1 ECDSA signing/verification and key generation. -* Additive and multiplicative tweaking of secret/public keys. -* Serialization/parsing of secret keys, public keys, signatures. -* Constant time, constant memory access signing and public key generation. -* Derandomized ECDSA (via RFC6979 or with a caller provided function.) -* Very efficient implementation. -* Suitable for embedded systems. -* Optional module for public key recovery. -* Optional module for ECDH key exchange. -* Optional module for Schnorr signatures according to [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki). +* Block reward: 90% of transaction fees are burned. -Bitgesell is a fork of Bitcoin with the following changes:
-* Block Reward [Burn rate is 90% of tx fees] ```sh - nFees*0.1 + GetBlockSubsidy() + nFees * 0.1 + GetBlockSubsidy() ``` -* Block Weight [10 times smaller than Bitcoin] + +* Block weight: 10 times smaller than Bitcoin. + ```sh <= 400,000 ``` -* 100% Segwit - ```sh - Eliminates problems with legacy type of transactions - ``` -* Halving Interval [Halving cycle of Bitgesell is 1 year while that of Bitcoin is 4 years] + +* 100% SegWit: eliminates problems with legacy transaction types. +* Halving interval: Bitgesell has a 1-year halving cycle, compared with Bitcoin's 4-year cycle. + ```sh - 210000 blocks/4 + 210000 blocks / 4 ``` -* Block Subsidy [Max coins = 21,000,000]
- `210000 blocks/4`

- `Hashing algorithm for blocks is Keccak (sha-3).`

- `The master branch is regularly built (see` [doc/build-*.md](https://github.com/BitgesellOfficial/bitgesell/tree/master/doc) `for instructions) and tested, but is not guaranteed to be completely stable.`

- [tags](https://github.com/BitgesellOfficial/bitgesell/tags) `are created regularly to indicate new official, stable release versions of BGL Core.`
- - -### Built With - -* General - * No runtime heap allocation. - * Extensive testing infrastructure. - * Structured to facilitate review and analysis. - * Intended to be portable to any system with a C89 compiler and uint64_t support. - * No use of floating types. - * Expose only higher level interfaces to minimize the API surface and improve application security. ("Be difficult to use insecurely.") -* Field operations - * Optimized implementation of arithmetic modulo the curve's field size (2^256 - 0x1000003D1). - * Using 5 52-bit limbs - * Using 10 26-bit limbs (including hand-optimized assembly for 32-bit ARM, by Wladimir J. van der Laan). - * This is an experimental feature that has not received enough scrutiny to satisfy the standard of quality of this library but is made available for testing and review by the community. -* Scalar operations - * Optimized implementation without data-dependent branches of arithmetic modulo the curve's order. - * Using 4 64-bit limbs (relying on __int128 support in the compiler). - * Using 8 32-bit limbs. -* Modular inverses (both field elements and scalars) based on [safegcd](https://gcd.cr.yp.to/index.html) with some modifications, and a variable-time variant (by Peter Dettman). -* Group operations - * Point addition formula specifically simplified for the curve equation (y^2 = x^3 + 7). - * Use addition between points in Jacobian and affine coordinates where possible. - * Use a unified addition/doubling formula where necessary to avoid data-dependent branches. - * Point/x comparison without a field inversion by comparison in the Jacobian coordinate space. -* Point multiplication for verification (a*P + b*G). - * Use wNAF notation for point multiplicands. - * Use a much larger window for multiples of G, using precomputed multiples. - * Use Shamir's trick to do the multiplication with the public key and the generator simultaneously. - * Use secp256k1's efficiently-computable endomorphism to split the P multiplicand into 2 half-sized ones. -* Point multiplication for signing - * Use a precomputed table of multiples of powers of 16 multiplied with the generator, so general multiplication becomes a series of additions. - * Intended to be completely free of timing sidechannels for secret-key operations (on reasonable hardware/toolchains) - * Access the table with branch-free conditional moves so memory access is uniform. - * No data-dependent branches - * Optional runtime blinding which attempts to frustrate differential power analysis. - * The precomputed tables add and eventually subtract points for which no known scalar (secret key) is known, preventing even an attacker with control over the secret key used to control the data internally. - -Building with Autotools ------------------------ - - $ ./autogen.sh - $ ./configure - $ make - $ make check # run the test suite - $ sudo make install # optional - -To compile optional modules (such as Schnorr signatures), you need to run `./configure` with additional flags (such as `--enable-module-schnorrsig`). Run `./configure --help` to see the full list of available flags. - -Building with CMake (experimental) ----------------------------------- - -To maintain a pristine source tree, CMake encourages to perform an out-of-source build by using a separate dedicated build tree. + +* Block subsidy: maximum supply is 21,000,000 coins. + +Bitgesell uses Keccak (SHA-3) as the block hashing algorithm. + +The `master` branch is regularly built and tested. See [doc/build-*.md](https://github.com/BitgesellOfficial/bitgesell/tree/master/doc) for build instructions. The branch is not guaranteed to be completely stable. + +[Tags](https://github.com/BitgesellOfficial/bitgesell/tags) are created regularly to indicate official stable release versions of BGL Core. + +## Built With + +Bitgesell includes libsecp256k1 cryptography code with the following properties: + +* secp256k1 ECDSA signing, verification, and key generation. +* Additive and multiplicative tweaking of secret and public keys. +* Serialization and parsing of secret keys, public keys, and signatures. +* Constant-time, constant-memory-access signing and public key generation. +* Derandomized ECDSA through RFC6979 or a caller-provided function. +* Optional modules for public key recovery, ECDH key exchange, and Schnorr signatures according to [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki). + +General implementation properties: + +* No runtime heap allocation. +* Extensive testing infrastructure. +* Structured to facilitate review and analysis. +* Intended to be portable to any system with a C89 compiler and `uint64_t` support. +* No use of floating types. +* Higher-level interfaces are exposed to minimize the API surface and improve application security. + +Field operations: + +* Optimized arithmetic modulo the curve's field size, `2^256 - 0x1000003D1`. +* 5 52-bit limbs. +* 10 26-bit limbs, including hand-optimized assembly for 32-bit ARM by Wladimir J. van der Laan. + +Scalar operations: + +* Optimized arithmetic modulo the curve's order without data-dependent branches. +* 4 64-bit limbs, relying on `__int128` support in the compiler. +* 8 32-bit limbs. +* Modular inverses for field elements and scalars based on [safegcd](https://gcd.cr.yp.to/index.html), with modifications and a variable-time variant by Peter Dettman. + +Group operations: + +* Point addition formula simplified for the curve equation, `y^2 = x^3 + 7`. +* Addition between points in Jacobian and affine coordinates where possible. +* Unified addition and doubling formula where necessary to avoid data-dependent branches. +* Point/x comparison without a field inversion by comparing in the Jacobian coordinate space. +* Point multiplication for verification, `a*P + b*G`. +* wNAF notation for point multiplicands. +* Larger window for multiples of `G`, using precomputed multiples. +* Shamir's trick to multiply with the public key and generator simultaneously. +* secp256k1's efficiently computable endomorphism to split the `P` multiplicand into two half-sized values. + +Point multiplication for signing: + +* Precomputed table of multiples of powers of 16 multiplied with the generator, so general multiplication becomes a series of additions. +* Designed to be free of timing side channels for secret-key operations on reasonable hardware and toolchains. +* Branch-free conditional moves for uniform table access. +* No data-dependent branches. +* Optional runtime blinding that attempts to frustrate differential power analysis. + +## Building with Autotools + +```sh +./autogen.sh +./configure +make +make check +sudo make install +``` + +To compile optional modules, such as Schnorr signatures, run `./configure` with the corresponding flags, such as `--enable-module-schnorrsig`. + +Run the following command to see the full list of available flags: + +```sh +./configure --help +``` + +## Building with CMake (experimental) + +To maintain a pristine source tree, CMake encourages an out-of-source build with a separate build tree. ### Building on POSIX systems - $ mkdir build && cd build - $ cmake .. - $ make - $ make check # run the test suite - $ sudo make install # optional +```sh +mkdir build && cd build +cmake .. +make +make check +sudo make install +``` + +To compile optional modules, such as Schnorr signatures, run `cmake` with the corresponding flags, such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON`. -To compile optional modules (such as Schnorr signatures), you need to run `cmake` with additional flags (such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON`). Run `cmake .. -LH` to see the full list of available flags. +Run the following command to see the full list of available flags: + +```sh +cmake .. -LH +``` ### Cross compiling -To alleviate issues with cross compiling, preconfigured toolchain files are available in the `cmake` directory. -For example, to cross compile for Windows: +Preconfigured toolchain files are available in the `cmake` directory. For example, to cross compile for Windows: - $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-w64-mingw32.toolchain.cmake +```sh +cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-w64-mingw32.toolchain.cmake +``` -To cross compile for Android with [NDK](https://developer.android.com/ndk/guides/cmake) (using NDK's toolchain file, and assuming the `ANDROID_NDK_ROOT` environment variable has been set): +To cross compile for Android with the [NDK](https://developer.android.com/ndk/guides/cmake), assuming the `ANDROID_NDK_ROOT` environment variable has been set: - $ cmake .. -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28 +```sh +cmake .. \ + -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" \ + -DANDROID_ABI=arm64-v8a \ + -DANDROID_PLATFORM=28 +``` ### Building on Windows -To build on Windows with Visual Studio, a proper [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) must be specified for a new build tree. +To build on Windows with Visual Studio, specify a proper [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) for a new build tree. -The following example assumes using of Visual Studio 2022 and CMake v3.21+. +The following example assumes Visual Studio 2022 and CMake v3.21+ in "Developer Command Prompt for VS 2022": -In "Developer Command Prompt for VS 2022": +```bat +cmake -G "Visual Studio 17 2022" -A x64 -S . -B build +cmake --build build --config RelWithDebInfo +``` - >cmake -G "Visual Studio 17 2022" -A x64 -S . -B build - >cmake --build build --config RelWithDebInfo +## Usage Examples -Usage examples ------------ -Usage examples can be found in the [examples](examples) directory. To compile them you need to configure with `--enable-examples`. - * [ECDSA example](examples/ecdsa.c) - * [Schnorr signatures example](examples/schnorr.c) - * [Deriving a shared secret (ECDH) example](examples/ecdh.c) +Usage examples can be found in the [examples](examples) directory. To compile them, configure with `--enable-examples`. -To compile the Schnorr signature and ECDH examples, you also need to configure with `--enable-module-schnorrsig` and `--enable-module-ecdh`. +* [ECDSA example](examples/ecdsa.c) +* [Schnorr signatures example](examples/schnorr.c) +* [Deriving a shared secret (ECDH) example](examples/ecdh.c) -Benchmark ------------- -If configured with `--enable-benchmark` (which is the default), binaries for benchmarking the libsecp256k1 functions will be present in the root directory after the build. +To compile the Schnorr signature and ECDH examples, configure with `--enable-module-schnorrsig` and `--enable-module-ecdh`. -Facebook: [Bitgesell](https://www.facebook.com/Bitgesell) +## Benchmark +If configured with `--enable-benchmark`, which is the default, benchmarking binaries for libsecp256k1 functions will be available in the root directory after the build. - ## Translations -Changes to translations as well as new translations can be submitted to -[BGL Core's Transifex page](https://www.transifex.com/bitcoin/bitcoin/). +Changes to translations, as well as new translations, can be submitted to [BGL Core's Transifex page](https://www.transifex.com/bitcoin/bitcoin/). + +Translations are periodically pulled from Transifex and merged into the git repository. See the [translation process](doc/translation_process.md) for details. -Translations are periodically pulled from Transifex and merged into the git repository. See the -[translation process](doc/translation_process.md) for details on how this works. +## Security -See [SECURITY.md](SECURITY.md) +See [SECURITY.md](SECURITY.md). -Contributing to libsecp256k1 ------------- +## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) +See [CONTRIBUTING.md](CONTRIBUTING.md).