LNP-BP / nodes

Complete LNP/BP protocol daemons suite
MIT License
18 stars 9 forks source link

Docs improvements #11

Closed cryptoquick closed 2 years ago

cryptoquick commented 2 years ago

In addition to the changes in #10, I wanted to add some clarifying information to the demo script for newcomers.

Also, I made use of the code in this branch, which combines that in https://github.com/RGB-WG/rgb-node/pull/194 and https://github.com/RGB-WG/rgb-node/pull/193 https://github.com/cryptoquick/rgb-node/tree/latest

It seems to work fine, and it produced this tx on testnet: https://mempool.space/testnet/tx/d2e977d29ea1b97b65071fb034d00869863873eee1c319198173f3f8cc2477e2

Not sure if that's optimal or suboptimal in some way. I'd actually appreciate if @zoedberg or @crisdut could double-check.

I also made copies of the PSBTs and contracts in order to better analyze how they evolve over the process. Screenshot from 2022-08-23 04-02-34 See zip here: demo.zip All sats in that wallet are unspendable now since I forgot to provide a change address maybe, so no harm in providing the wallet password. It's asdfasdf.

crisdut commented 2 years ago

Hi @cryptoquick ,

I will try to reproduce your steps later today.

I found a wrong typo in line 36. Can you remove your home path, please?

Great work!

zoedberg commented 2 years ago

Hi!

Currently I'm using opret instead of tapret, so not sure I can help you on this right now.

All sats in that wallet are unspendable now since I forgot to provide a change address maybe

The output being unspendable IMO indicates that something went wrong. Could be a bug on some RGB library. Currently I'm busy debugging other stuff, but I'll update you when I'll give a look to tapret commitments.

cryptoquick commented 2 years ago

I found a wrong typo in line 36. Can you remove your home path, please?

Good catch, thanks @crisdut !

Also, I'm not sure what value should be provided to the send argument of rgb-cli transfer finalize --send, it gives me the following:

error: The argument '--send <SEND>' requires a value but none was supplied

I've found it can be omitted, but I'm not sure why it's there in the first place, what its purpose is.

cryptoquick commented 2 years ago

The output being unspendable IMO indicates that something went wrong. Could be a bug on some RGB library. Currently I'm busy debugging other stuff, but I'll update you when I'll give a look to tapret commitments.

Thanks for the insight, thank you @zoedberg!

cryptoquick commented 2 years ago

Another thing I just noticed, after running through this, here's the output rgb consignment validate immediately after finalizing the transfer:

19:54:02 ❯ rgb consignment validate ${CONSIGNMENT}
---
unresolved_txids: []
unmined_endpoint_txids:
  - d2e977d29ea1b97b65071fb034d00869863873eee1c319198173f3f8cc2477e2
failures:
  - TransitionNotInAnchor:
      - b77a89852e04c82eae7aba98ef5b6b8d1643ea08a4039052612f67dc086819d1
      - d2e977d29ea1b97b65071fb034d00869863873eee1c319198173f3f8cc2477e2
warnings:
  - EndpointTransactionMissed: d2e977d29ea1b97b65071fb034d00869863873eee1c319198173f3f8cc2477e2
info: []

But after publishing and waiting for it to be mined, I got this:

19:55:26 ❯ rgb consignment validate ${CONSIGNMENT}
---
unresolved_txids: []
unmined_endpoint_txids: []
failures:
  - TransitionNotInAnchor:
      - b77a89852e04c82eae7aba98ef5b6b8d1643ea08a4039052612f67dc086819d1
      - d2e977d29ea1b97b65071fb034d00869863873eee1c319198173f3f8cc2477e2
warnings: []
info: []

The empty array for unmined_endpoint_txids is as expected, but there shouldn't be any failures, right?

crisdut commented 2 years ago

Also, I'm not sure what value should be provided to the send argument of rgb-cli transfer finalize --send, it gives me the following:

The "--send" send the consignment file to a beneficiary by bifrost. The value is a node address (nodeid@ip:addr). This command is optional, and I never tested it.

crisdut commented 2 years ago

The empty array for unmined_endpoint_txids is as expected, but there shouldn't be any failures, right?

Hi @cryptoquick, please use version v0.8.3 of the descriptor-wallet.

I reproduced the steps in both versions, and only the v0.8.2 version occurs TransitionNotInAnchor error.

cryptoquick commented 2 years ago

@crisdut I've updated the instructions to use the latest descriptor-wallet. After updating the descriptor wallet and running through the demo procedure, I got this tx: https://mempool.space/testnet/tx/94dd3f7eb24d63306917796b363f0bb6addc3647a4e5838560020508ea3c1e4f I was sure to use descriptor-wallet 0.8.3. I also combined yours and @zoedberg's rgb-node latest PRs in the following branch: https://github.com/cryptoquick/rgb-node/tree/zoedberg-crisdut It's not scientific, but it would serve as a bit of QA if @dr-orlovsky merged all 3 of your open PRs into rgb-node.

cryptoquick commented 2 years ago

I forgot to provide the output of rgb consignment validate:

17:34:16 ❯ rgb consignment validate ${CONSIGNMENT}
---
unresolved_txids: []
unmined_endpoint_txids: []
failures:
  - TransitionNotInAnchor:
      - 0abb3465e82652da5252ef8fcce6a1c44a7ecac14af70cd66ca38fb520386c33
      - 94dd3f7eb24d63306917796b363f0bb6addc3647a4e5838560020508ea3c1e4f
warnings: []
info: []

I'm unsure if this is nominal / as expected.

crisdut commented 2 years ago

@crisdut I've updated the instructions to use the latest descriptor-wallet. After updating the descriptor wallet and running through the demo procedure, I got this tx:

I changed descriptor-wallet to avoid the "burn bitcoin" problem (PROVABLY_UNSPENDABLE).

Now, the transaction spent only the fee. Before opening a PR, I will make more tests on both networks (regtest and testnet).

The image below shows an example transaction:

image

crisdut commented 2 years ago

I'm unsure if this is nominal / as expected.

@cryptoquick You are correct; this is unexpected.

After investigating, I got it to reproduce this issue.

The TransitionNotInAnchor occurs when you build rgbd with --release argument (optimized).

I will open an issue on rgb-node repo.

Please, build and/or install rgbd with --debug argument and try to reproduce the steps.

dr-orlovsky commented 2 years ago

Thank you and sorry for keeping it pending for long. I am not sure I got the conversation: was all the issues in it resolved or there are some pending?

cryptoquick commented 2 years ago

Yes, I think whatever issues I was having are separate from this work.