An `elementsd`-compatible fork of `corepc` for unified RPC client support

Aperta
#268 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
api, backend

Direzione di ricerca

Inizia confrontando l'interfaccia corepc con i metodi specifici di Elements elencati nella proposta, quindi leggi rpc.rs di liquid-functionary come esempio del lavoro duplicato del client. Decidi se un fork o una crate di estensione gestisce meglio i tipi condivisi e il versionamento. Il lavoro è completato quando un client RPC compatibile con elementsd copre i metodi differenti richiesti e i metodi Elements-only con un approccio al versionamento manutenibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Background

The rust-bitcoin ecosystem has converged on corepc as a unified library for managing RPC communication with bitcoind. It provides versioned, type-safe client bindings for Bitcoin Core's JSON-RPC interface and is actively maintained alongside rust-bitcoin itself.

rust-elements currently has no equivalent. Downstream projects that need to talk to elementsd end up writing their own ad-hoc RPC clients on top of jsonrpc. For example, liquid-functionary maintains its own rpc.rs. This is duplicated effort, and the resulting clients tend to lag behind upstream changes, cover only the methods each project happens to need, and have inconsistent type definitions.

Proposal

Create an elementsd-compatible fork (or sibling crate) of corepc that:

  1. Keeps all the common parts of corepc unchanged. The elementsd RPC surface is largely a superset of bitcoind's — the majority of methods are either identical or close enough that corepc's existing types can be reused directly.
  2. Overrides the subset of methods that differ. Some Bitcoin Core methods return different or extended data on elementsd (e.g. anything involving amounts/assets, blinded outputs, or pegged-in coins). These need Elements-specific response types.
  3. Adds the Elements-only methods. Things like getsidechaininfo, getpeginaddress, claimpegin, rawblindrawtransaction, issueasset, listissuances, asset/token RPCs etc. would need to be added.

Structurally, this could be done either as

  1. A fork of corepc
  2. A separate crate that depends on corepc and re-exports/extends its types

Open questions

  • Fork vs. extension crate: I am not sure which is easier to maintain?
  • Versioning is a little tricky as in corepc there are versions of the interface that track the Bitcoin releases and Elements also tracks the Bitcoin releases but also has its own versions.
Lingua principale
Rust
Stelle
57
Fork
40
Merge medio
11h 58m
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ElementsProject/rust-elements

Tutte le issue di ElementsProject/rust-elements

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.