eclair icon indicating copy to clipboard operation
eclair copied to clipboard

Add `onchainunspent` RPC call

Open rorp opened this issue 3 years ago • 3 comments

This PR add an RPC call to retrieve the list of UTXOs from the connected Bitcoin Core instance.

rorp avatar Jul 10 '22 20:07 rorp

What is the rationale for adding this to eclair's API ? Users could simply call bitcoin core's API instead ?

sstone avatar Jul 11 '22 09:07 sstone

What is the rationale for adding this to eclair's API ? Users could simply call bitcoin core's API instead ?

What is the rationale for onchaintransactions? Same for this one.

Personally, I need this call to enable a third party app to open a channel with selected UTXO(s). And I don't want to give access to bitcoind to the app. Also, I have a non bitcoin core wallet implementation which doesn't have its own RPC.

rorp avatar Jul 11 '22 15:07 rorp

Codecov Report

Merging #2344 (0b7e548) into master (e1dc358) will increase coverage by 0.05%. The diff coverage is 0.00%.

:exclamation: Current head 0b7e548 differs from pull request most recent head c2295e2. Consider uploading reports for the commit c2295e2 to get more accurate results

@@            Coverage Diff             @@
##           master    #2344      +/-   ##
==========================================
+ Coverage   84.68%   84.74%   +0.05%     
==========================================
  Files         194      194              
  Lines       14650    14653       +3     
  Branches      613      598      -15     
==========================================
+ Hits        12407    12417      +10     
+ Misses       2243     2236       -7     
Impacted Files Coverage Δ
...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala 50.53% <0.00%> (-0.83%) :arrow_down:
...n/scala/fr/acinq/eclair/balance/BalanceActor.scala 10.16% <0.00%> (ø)
...ir/blockchain/bitcoind/rpc/BitcoinCoreClient.scala 96.29% <ø> (ø)
...n/scala/fr/acinq/eclair/json/JsonSerializers.scala 95.12% <ø> (ø)
.../main/scala/fr/acinq/eclair/channel/Register.scala 88.23% <0.00%> (-2.95%) :arrow_down:
...scala/fr/acinq/eclair/router/BalanceEstimate.scala 98.91% <0.00%> (-1.09%) :arrow_down:
...main/scala/fr/acinq/eclair/io/PeerConnection.scala 86.34% <0.00%> (-0.37%) :arrow_down:
...main/scala/fr/acinq/eclair/router/Validation.scala 95.34% <0.00%> (+1.32%) :arrow_up:
...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala 97.56% <0.00%> (+1.62%) :arrow_up:
...q/eclair/channel/publish/ReplaceableTxFunder.scala 90.57% <0.00%> (+3.66%) :arrow_up:

codecov-commenter avatar Jul 11 '22 15:07 codecov-commenter

@rorp can you reply to the previous comments? Otherwise I'll close this PR as inactive.

t-bast avatar Dec 08 '22 09:12 t-bast

I agree that it should differentiate between locked and unlocked UTXO.

As @sstone pointed out, all this can be done using Bitcoin Core RPC directly, so the can of worm is already wide open.

The lock/unlock UTXO API would be beneficial, because it could perform additional checks. For example, like LND's leaseOutput/releaseOutput require an app id, so the app cannot unlock outputs locked by Eclair or other apps.

rorp avatar Dec 08 '22 20:12 rorp

For example, like LND's leaseOutput/releaseOutput require an app id, so the app cannot unlock outputs locked by Eclair or other apps.

That can only be done when implementing your own bitcoin wallet. Since eclair uses bitcoind instead of re-implementing a wallet, this is impossible for us. That's why I think we simply should not go down that road, because we can't provide the necessary guarantees to the caller.

This should be done by querying bitcoind directly, I don't think we should add even more APIs to eclair for that.

t-bast avatar Dec 09 '22 07:12 t-bast

Shall we close this PR? I'm not clear on what the status is here @rorp

t-bast avatar Dec 29 '22 08:12 t-bast