chainwayxyz / clementine

Citrea's BitVM Based Trust-Minimized Two-Way Peg Program
https://www.blog.citrea.xyz/unveiling-clementine
55 stars 12 forks source link

Explorer: Proof of Reserves #317

Open orkunkilic opened 1 month ago

orkunkilic commented 1 month ago

Proposal Description

Traditionally, all kind of bridges provide some easy to use interface to check proof of reserves. We should have a similar interface.

Ideally, user should be able to see truncated list of individual UTXO's that locks bridge funds (10 BTC), and a button to check UTXO balances with cBTC on Citrea on client side.

We can use bridge-backend's, any operator/verifier's DB, or brand new explorer for Clementine UTXOs. I prefer using existing infra. Client side checking the balances is easy with electrs/mempool. Client side checking cBTC on Citrea (- bridge contract) should be engineered somehow.

Let's keep this issue as meta and open smaller issues as we decide on details.

River.com WBTC

ekrembal commented 1 month ago

A simple client side ui that will asks bridge events from the given citrea rpc

for deposits we know the utxo, it will ask mempool space about it.

for withdrawal, we can know which operator paid it, how much amount it was paid, and what was the tx paid the withdrawal.

All can be done with a simple citrea rpc and api access for smth like mempool.space

orkunkilic commented 1 month ago

for deposits we know the utxo, it will ask mempool space about it.

How do we know, through bridge-backend? Is this verifiable? can you look to UTXO and determine that belongs to Clementine? It doesn't have to be verifiable - just wondering the details.

ekrembal commented 1 month ago

it is musig2, we can also verify that the scriptPubKey belongs to a musig2 that is an aggregated key of every public keys

ekrembal commented 1 month ago

utxo is written in the deposit event, to make a deposit you show an SPV proof

ekrembal commented 4 weeks ago

Started some here: https://github.com/chainwayxyz/clementine-explorer

Preview: https://clementine-explorer.netlify.app/

orkunkilic commented 4 weeks ago

Started some here: https://github.com/chainwayxyz/clementine-explorer

Preview: https://clementine-explorer.netlify.app/

Cool! Though don't spend much time on frontend UI part - I think the correct way to implement an explorer is to do smth similar to batch-explorer and embed to citrea.xyz. For the PoR - we can use this app's scripts in frontend to handle everything on client-side.