sovereign-sdk
sovereign-sdk copied to clipboard
Update DA Services with Transaction IDs
#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
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.