rooch-network / rooch

VApp Container with Move Language for Bitcoin ecosystem
https://rooch.network
Apache License 2.0
158 stars 83 forks source link

[Bitcoin] Refactor process_utxos and add BitcoinSatStore to track inscriptions correctly #1426

Closed adshao closed 3 weeks ago

adshao commented 6 months ago

According to the documentation on inscriptions, inscriptions are inscribed on sats. This implies that in order to accurately track inscriptions with their correct sequence numbers to ordinals.com, it is essential to monitor sats in alignment with the principles of ordinal theory.

Sats should be numbered and transferred according to the algorithm specified in Ord BIP.

The relationship between sats and inscriptions is summarized as follows:

Our current tracking of inscriptions seems to be incorrect in the following aspects:

adshao commented 6 months ago

In fact, tracking SAT_TO_SATPOINT and OUTPOINT_TO_SAT_RANGES within index_sats is not necessary. Instead, our focus should solely be on monitoring satpoint_to_sequence_number and sequence_number_to_inscription_entry as demonstrated in inscriptions_on_output, as well as outpoint_to_value.

We need to implement the logic of index_inscriptions.

jolestar commented 3 weeks ago

Implement the full inscription logic at https://github.com/rooch-network/rooch/blob/main/frameworks/bitcoin-move/sources/inscription_updater.move

And verify the case with ord events in https://github.com/rooch-network/rooch/blob/main/crates/rooch-framework-tests/src/tests/bitcoin_tester_test.rs

Except:

  1. Sat index: Rooch does not handle the Sat index.
  2. Fee: the fee in the ordinals protocol is to display the cost; Rooch does not handle the fee logic.