Skip to content

feat: add Floresta client support#697

Draft
4xvgal wants to merge 1 commit into
noncelab:mainfrom
4xvgal:feat/floresta-support
Draft

feat: add Floresta client support#697
4xvgal wants to merge 1 commit into
noncelab:mainfrom
4xvgal:feat/floresta-support

Conversation

@4xvgal

@4xvgal 4xvgal commented Jun 22, 2026

Copy link
Copy Markdown

feat: add Floresta client support

Summary

Add support for connecting to an external Floresta node via Electrum protocol and JSON-RPC. This allows coconut_wallet to use Floresta as a backend in regtest mode.

What's included

  • Floresta-compatible Electrum server connection
  • Runtime descriptor registration via Floresta JSON-RPC (loaddescriptor)
  • Blockchain rescan trigger via Floresta JSON-RPC (rescan)
  • RPC connection status check

Tested environment

  • bitcoind v30.2
  • utreexod v0.52.0
  • floresta v0.9.1

Tested features

  • TX pulling / balance sync
  • TX broadcast (not yet implemented in this PR)

Notes

  • RBF/transaction builder tests pass
  • Some pre-existing/flaky tests in socket_manager_test and electrum e2e tests may fail depending on environment
  • No new unit tests added for Floresta RPC client yet
  • 🚨 Warning: Floresta RPC currently has no authentication. Use only on a VPN or private network. 🚨

References

Future work

Built-in Floresta node support is tracked in #<epic_issue_number>.

@4xvgal 4xvgal changed the title feat: add Floresta node support feat: add Floresta client support Jun 23, 2026
@4xvgal

4xvgal commented Jun 23, 2026

Copy link
Copy Markdown
Author

Test Env setup

bitcoind (regtest)
    ↓  (RPC + P2P)
utreexod (bridge mode, regtest)   ← Utreexo proof 생성
    ↓  (P2P, utreexo protocol)
florestad (regtest)               ← 경량 검증 노드

index

  1. setup bitcoind with regtest network
  2. setup utreexod with regtest network in bridge mode for floresta
  3. setup floresta with regtest network

1. setup bitcoind with regtest network

# Ubuntu/Debian
sudo apt update
sudo apt install bitcoind

conf

mkdir -p ~/.bitcoin
cat > ~/.bitcoin/bitcoin.conf << 'EOF'
[regtest]
# RPC 설정
rpcuser=user
rpcpassword=password
rpcport=18443
rpcbind=127.0.0.1
rpcallowip=127.0.0.1

# P2P
listen=1
port=18444
bind=127.0.0.1

# utreexod가 붙을 수 있도록 zmq 또는 indexing 허용
txindex=1
server=1
EOF

execute

bitcoind -regtest -fallbackfee=0.0001 -daemon
# 지갑 생성 및 블록 마이닝 (잔액 확보)
bitcoin-cli -regtest createwallet "test"
bitcoin-cli -regtest -generate 101 

2단계 — utreexod (bridge mode, regtest)

git clone https://github.com/utreexo/utreexod.git
cd utreexod

make all

실행

./utreexod --regtest --connect=127.0.0.1:18444 --utreexoproofindex --listen=127.0.0.1:18448 --prune 0 --flatutreexoproofindex

3. Floresta

git clone https://github.com/getfloresta/Floresta.git
cd Floresta

cargo build --release

# 또는 PATH에 설치
cargo install --path ./bin/florestad --locked
cargo install --path ./bin/floresta-cli --locked

주의: macOS환경에서 iOS 시뮬레이터는 127.0.0.1 접근이 안되기 때문에 일렉트럼을 노출하는 floresta의 일렉트럼 포트와 RPC 서버는 localhost를 제외한 네트워크 환경에 바인딩 되어야함 ( 127.0.0.1 X -> 192...)

florestad -n regtest --connect 127.0.0.1:18448 --rpc-address 192.168.0.46:20002 --electrum-address 192.168.0.46:20001

주의: 만약 utreexod를 한번이라도 그냥 실행하거나 pruned 로 실행하면 full node 모드로 동작하지 않아 블록데이터를 전파하지 않음.
따라서 floresta-cli에서 bitcoind를 직접 노드 연결 추가해주면 해결됨.

floresta-cli -n regtest -H 192.168.0.46:20002 addnode 127.0.0.1:18444 add

시작 순서 요약

1. bitcoind 시작  →  블록 마이닝 (최소 101블록)
2. utreexod 시작  →  bitcoind 동기화 + proof 인덱싱 완료 확인
3. florestad 시작 →  utreexod에 연결

utreexoctl 로 블록체인 상태 보기

./utreexoctl --regtest getblockchaininfo

floresta-cli로 블록체인 상태보기

floresta-cli -n regtest -H 192.168.0.46:20002 getblockchaininfo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant