KasarLabs / barknet

https://kasar.io
MIT License
13 stars 0 forks source link

net/bitcoin_da #4

Open antiyro opened 1 year ago

antiyro commented 1 year ago

Description:

Integrate methods in the BitcoinClient struct that cater to Bitcoin's unique data availability requirements, leveraging the functionalities provided in the Bitcoin-da crate.

Tasks:

  1. Design Methods to Listen to Storage Changes for Bitcoin:

    • Listen to Changes:

      • Design a method in BitcoinClient that listens for relevant storage changes in the substrate.
      • This method should be asynchronous and might involve hooks or listeners to the substrate's storage system.
    • Process Changes:

      • Once detected, these changes should be processed and prepared for potential publication on the Bitcoin network.
      • Utilize the chunk_slice utility to handle large data sets that exceed Bitcoin's transaction size limits.
  2. Implement a Method to Update the Bitcoin State:

    • Fetch Latest State:

      • Create a method, e.g., update_bitcoin_state, that fetches the latest state from the substrate system.
      • Use the Bitcoin-da crate's RPC functionalities to interact with a Bitcoin node and fetch relevant data.
    • Process State:

      • Depending on the DaMode, decide how to process and potentially publish this state.
      • Maintain a record of the last published state to prevent redundant publications.
  3. Address Unique Bitcoin Characteristics:

    • UTXO Model:

      • Implement functionalities to handle Bitcoin's UTXO model correctly. This might involve:
        • Selecting the right UTXOs for transactions.
        • Managing change outputs.
        • Ensuring transaction outputs aren't double-spent.
    • Data Embedding:

      • Given the functionalities like extract_push_data, design methods to embed and extract data from Bitcoin transactions. This is essential for data availability.
    • Taproot:

      • Bitcoin's Taproot offers advanced scripting possibilities. If your implementation requires complex scripts or wishes to leverage Taproot for privacy, design methods accordingly.
      • Utilize the Bitcoin-da crate's Taproot functionalities to construct and interpret Taproot-based transactions.
github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!