Skip to content

Latest commit

 

History

History
76 lines (48 loc) · 4.02 KB

cip-0022.md

File metadata and controls

76 lines (48 loc) · 4.02 KB
    CIP: 22
    Title: Update Federatednode stack to use addrindexrs
    Authors: John Villar (chiguireitor)
    Status: Draft
    Type: Standards Track
    Created: 2020-05-24
    Discussions-To: https://counterpartytalk.org/t/cip22-changed-indexd-to-addrindexrs/5870

Abstract

Changes the underlying address index implementation from the currently unmaintained indexd service to addrindexrs to simplify deployment and make software more responsive.

Motivation

  • Currently the indexd-server indexing service can take several days to synchronize on a fresh start.
  • Current implementation is unmaintained, the creator took another direction with the project and thus it became bloated and inefficient for counterparty usage.
  • indexd-server has a very big database footprint, with current (as of block 631583) mainnet footprint being 266Gb and (as of block 1746460) testnet footprint being 26Gb.
  • indexd-server query times for addresses with a lot of activity can be too slow for real life usage.
  • addrindexrs is an indexing service maintained by the teams from Samourai Wallet and ElectrumX.
  • addrindexrs synchronizes in hours on modest hardware.
  • addrindexrs testnet database is only 5.5Gb. A saving on space of almost 5 times. Similar savings with mainnet are expected from current users experience.

Related links

Rationale

Current state of operation of counterparty has been less than stellar lately, mainly due to the lack of usability counterwallet is having. This problem is generated by several aspects of the counterparty software stack, one being that the indexing software is slow to respond, causing unresponsiveness on the UI leading to a very poor UX.

Changing the indexing service being used by the software stack will solve one of many problems plaguing the software stack at the moment, leading to a better outlook on the future of the technology and reeling in more users as result.

Definitions

  • Scripthash: a payable-to script on the blockchain, can be a represented by an address that maps to a P2PKH, P2SH, P2WPKH or P2WSH (including wrapped versions of the witness programs on a compatible P2SH wrapper).
  • Indexing service: a service designed to index transactions on all scripthashes, for later querying (used on transaction building).

Overview

General functionality of indexd-server hasn't stopped working, however, it becomes linearly slower the more an address has activity, and the base counterparty design makes address reuse the norm and not the exception.

This slow time of response gets even worse when multiple users are hitting the service. As it wasn't designed with high-availability in mind, when multiple users are accessing it it becomes unstable and sometimes returns erroneous messages that break counterparty execution and brings the service down.

Backwards compatibility

This change is an infrastructure change, so the protocol is unaffected.

Parsing and some downtime is expected when deploying the new solution, as the addrindexrs index needs to be built.

Milestones

CIP0022 implementation will have the following development milestones with their corresponding percentage of the total bounty:

  • Milestone 1 (50%) implementation of the addrindexrs backend.
  • Milestone 2 (25%) implementation of the addrindexrs docker deployments on federatednode.
  • Milestone 3 (25%) migration of the main deployed federatednode stack using addrindexrs.

Bounty

A bounty custodian has been appointed for collection and awarding of the milestones completion. User Jeremy Johnson (@j-dog) provided the following address for bounty collection:

17GKi9QMyLkjEZdFexLuaQMinuhMyTVbhd

It is estimated that this implementation will take ~30 man hours to develop, with a suggested cost of 0.023 BTC/man hour, which would total of 0.46 BTC.

Each milestone should be accompanied by a git commit following CP's coding standards and requirements.

Copyright

This document is placed in the public domain.