ElementsProject / ElementsProject/rust-elements

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

Aberta
#268 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Rust
Estrelas
57
Forks
40
Merge médio
11h 58min
PRs com merge (30d)
1

Descrição

## Background

The `rust-bitcoin` ecosystem has converged on [`corepc`](https://github.com/rust-bitcoin/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`](https://github.com/Blockstream/liquid-functionary/blob/master/functionary/src/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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Comece comparando a interface corepc com os métodos específicos de Elements listados na proposta e, em seguida, leia o rpc.rs de liquid-functionary como exemplo do trabalho duplicado do cliente. Decida se um fork ou uma crate de extensão lida melhor com tipos compartilhados e versionamento. Considera-se concluído quando um cliente RPC compatível com elementsd cobre os métodos diferentes necessários e os métodos Elements-only com uma abordagem de versionamento sustentável.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
rust
Domínio
api, backend
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Pouca atividade
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.