Backend indexer for Riften Labs BCH DeFi contracts (Cauldron, Moria). Mirror of gitlab.com/riftenlabs/riftenlabs-indexer (AGPL-3.0). Author: Riften Labs.
Find a file
Hossein Zoda 4677cc955e ido: port "CldIdo00" signature + announcement permanentLiquidityMinFee
Sync the IDO indexer to libriften 48aa1f7 (+ follow-ups):

- IDO_SIGNATURE 20->10 bytes: [0x08 "CldIdo00" 0x75] (was OP_PUSH18
  "CauldronIdo-2026Q2"). The separate "CauldronIdo0" announcement
  signature is folded into the same 8 raw bytes, so
  IDO_PREINIT_ANNOUNCEMENT_SIGNATURE = 6a 4c b9 + "CldIdo00";
  is_preinit_broadcast is now length-agnostic. Electrum mempool
  filters track automatically (they reference the constants).
- Recompile the 3 affected contracts from templates: IDO initiator
  233->231, IDO preinit 1469->1465, offering launcher 630->628.
  IDO_POSTLAUNCH_CONTRACT and the other offering contracts are
  byte-identical and left as-is.
- Announcement OP_RETURN carries permanentLiquidityMinFee as a 2-byte
  field at data[166..168]; mainData is now 185 bytes. Read minFee from
  the announcement rather than the (unreadable) postlaunch copy.

Fix the source of the two "free" postlaunch params:

- Output #7 (ido initiator bytecode storage) is P2SH32, so the partial
  bytecode cannot be read back from it. Drop the impossible extraction
  (extract_params_from_partial_ido_initiator_bytecode +
  PartialPostlaunchExtractedParams). extract_data_from_storage_script_
  with_data_and_size is kept for its valid callers (revealed redeem
  scripts, bare bcmr storages).
- orbPoolParamsCategory now comes from the ORB IdoParams NFT commitment
  (output #10). The commitment parse is moved above the params
  construction so the value is available; the now-tautological
  orbPoolParamsCategory vs NFT check is removed.
- Verification is the existing output #7 rebuild: build the expected
  bytecode from the announcement values plus the NFT-sourced
  orbPoolParamsCategory, hash to P2SH32, and compare. Since minFee is a
  2-byte announcement field it always fits the postlaunch's 2-byte push,
  so build_partial_postlaunch_bytecode stays infallible.

- Tests: preinit_detect -> legacy_preinit_announcement_not_detected
  (legacy fixture must no longer be detected under the new signature);
  replace the extraction round-trip test with a structural check of the
  partial postlaunch bytecode layout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 19:32:20 +00:00
.vscode Convert hash columns from TEXT to BLOB storage 2026-01-22 08:30:17 +01:00
contrib Delphi v2 support 2026-05-04 15:03:40 +02:00
internal Expose authchain head + optional local IPFS gateway for BCMR downloads 2026-06-24 11:07:31 +00:00
linters Fix potential API hangs from write lock contention 2026-02-02 21:01:50 +01:00
src ido: port "CldIdo00" signature + announcement permanentLiquidityMinFee 2026-07-14 19:32:20 +00:00
.gitignore Add Chipnet support 2026-01-09 13:46:58 +01:00
.gitlab-ci.yml ci: Use lockfile as cache key 2026-02-02 11:52:09 +01:00
build.rs missing build file 2024-10-25 15:28:40 +02:00
Cargo.lock ido: replace num-bigint with malachite 2026-06-22 10:41:39 +00:00
Cargo.toml ido: replace num-bigint with malachite 2026-06-22 10:41:39 +00:00
LICENSE use AGPL 2024-02-05 16:32:27 +01:00
README.md README: contributors license 2024-03-14 10:54:44 +01:00

Riftenlabs Indexer

RiftenLabs indexer is for indexing DeFi contracts by Riften Labs. It allows for querying historical on-chain data on Bitcoin Cash.

Contributing

All contributors are required to sign a Contributor License Agreement (CLA) before their contributions can be merged into the project.

Contributions are generally welcome. If you intend to make larger changes please discuss them in an issue before MRing them to avoid duplicate work and architectural mismatches.

Installing Rust

Rust can be installed using your package manager of choice or rustup.rs. The former way is considered more secure since it typically doesn't involve trust in the CA system. But you should be aware that the version of Rust shipped by your distribution might be out of date.

Building

The library can be built and tested using cargo:

git clone https://gitlab.com/riftenlabs/riftenlabs-indexer.git
cd riftenlabs-indexer
cargo build

You can run tests with:

cargo test