sovereign-sdk icon indicating copy to clipboard operation
sovereign-sdk copied to clipboard

Update DA Services with Transaction IDs

Open preston-evans98 opened this issue 2 years ago • 1 comments

#1188 adds a TransactionId to the DaService::send_transaction method, but does not update the existing services to return a valid ID. We should return a unique ID for every transaction in each DA service.

  • [ ] Celestia
  • [ ] Avail
  • [ ] Mock DA
  • [ ] RNG DA

preston-evans98 avatar Nov 28 '23 20:11 preston-evans98

Hy! I'm happy to take this on. Should the data blob be included in tx id generation? Can also append the blob with a prehashed namespace (DA) to make it deterministic. Open for suggestions as well!

Attaching a PoC for your ref:

pub enum Services {}

impl Services {
  fn get_hash() {}
}

fn generate_tx_id(service: &Services, data_blob: &[u8]) -> String {
    let namespace_hash = service.get_hash()); //  maybe fetch from enum?
    let mut hasher = Sha256::new();
    hasher.update(namespace_hash); 
    hasher.update(data_blob);
    let txId = hasher.finalize();
}

lmk what do you think.

PraneshASP avatar Dec 01 '23 08:12 PraneshASP