Skip to content

v0.1.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@alexeiZamyatin alexeiZamyatin released this 08 May 19:29
· 3444 commits to master since this release
Component Status Release notes
all crates - Bumped to substrate v2.0.0-alpha.5 and implemented necessary changes
crates/bitcoin updated
  • Changes since Milestone 2
    • Added formatter for Bitcoin transactions. Necessary for correct txid/tx-hash generation post-SegWit.
    • Minor additions to types.rs and parser.rs
  • Functionality:
    • formatter.rs (new): formatter for Bitcoin transactions. Necessary for correct txid/tx-hash generation post-SegWit
    • types.rs: BTC-Relay / Bitcoin data model
    • parser.rs: Parsing Bitcoin block headers and transactions
    • merkle.rs: Verification of Merkle Proofs
    • utils.rs: Bitcoin-specific util functions
  • LOC: 1336
crates/bitcoin-spv deleted Removed dependency on summa/bitcoin-spv library since not used and proved to be unstable during development (panicked code).
crates/btc-relay updated
  • Changes since Milestone 2
    • Integration of security module
    • Single function call for verifying and validating transactions (for external use)
  • Functionality:
    • Storage and verification of block headers
    • Handling of forks
    • Verification of transaction inclusion proofs
    • Validation of transactions according to accepted format in XCLAIM (see
  • LOC: 2173
crates/collateral new
  • Functionality
    • Handles locking, releasing and slashing of collateral (e.g. DOT).
  • LOC: 360
crates/exchange-rate-oracle new
  • Functionality
    • Mock for external exchange rate oracle (to be integrated in full implementation). Exposes internal API for checking exchange rates and DOT/PolkaBTC conversion.
  • LOC: 320
crates/issue new
  • Functionality
    • Handles issuing of PolkaBTC
  • LOC: 673
crates/redeem new
  • Functionality:
    • Handles redeeming of PolkaBTC for BTC on Bitcoin.
    • Handles liquidation redeem when the system becomes under-collateralized
  • LOC: 1044
crates/replace new
  • Functionality:
    • Handles replacing vaults in regular cases where a vault whishes to exit the protocol
    • Handles an “auction replace” where a vault can be forced to leave when it becomes under-collateralized
  • LOC: 1409
crates/security new
  • Note: The security module according to the specification as of Milestone 1 was split into two modules:
    • security
    • staked-relayers
  • Functionality:
    • Security module, handling BTC Parachain status changes (error handling).
    • Provides internal API for other modules to check Parachain status
  • LOC: 368
crates/staked-relayers new
  • Functionality
    • Handles registration and stake of Staked Relayers, as well as voting on Parachain status changes.
    • Separated from security module
  • LOC: 1742
crates/treasury new
  • Functionality:
    • Exposes functions related to handling of the PolkaBTC currency (mint, transfer, lock, burn)
  • LOC: 353
crates/vault-registry new
  • Functionality:
    • Handles registration, collateral and liquidation of Vaults.
    • Exposes internal API for Issue, Redeem and Replace to keep track of Vault’s collateral and issued/redeemed PolkaBTC tokens
  • LOC: 1431
crates/x-core new
  • Previously “btc-core”.
  • Functionality:
    • Unified error handling across all components (and other shared types)
  • LOC: 192
parachain/runtime updated Changes since Milestone 2:
  • Integrated all crates into parachain

Total LOC: 11.421

Additional information

  • Mocking:
    • Using Mocktopus to mock function returns.
    • External crate dependencies with state defined in ext.rs files that allow to mock cross-pallet behavior.
  • Pallet isolation:
    • External crates defined in the ext.rs to allow consistent cross-pallet APIs even if changes are made to the underlying implementations.
  • Type isolation:
    • In pallets containing a lot of logic implemented on custom data types, a types.rs file is used to store these types and their methods.