babylonchain / staking-indexer

A tool that extracts BTC staking relevant data from the Bitcoin blockchain
Other
3 stars 5 forks source link

for new staking tx add key.index and proof in db #134

Open RafilxTenfen opened 2 months ago

RafilxTenfen commented 2 months ago

To create BTC delegations we also need the index and proof

// TransactionInfo is the info of a tx on Bitcoin,
// including
// - the position of the tx on BTC blockchain
// - the full tx content
// - the Merkle proof that this tx is on the above position
message TransactionInfo {
  // key is the position (txIdx, blockHash) of this tx on BTC blockchain
  // Although it is already a part of SubmissionKey, we store it here again
  // to make TransactionInfo self-contained.
  // For example, storing the key allows TransactionInfo to not relay on
  // the fact that TransactionInfo will be ordered in the same order as
  // TransactionKeys in SubmissionKey.
  TransactionKey key = 1;
  // transaction is the full transaction in bytes
  bytes transaction = 2;
  // proof is the Merkle proof that this tx is included in the position in `key`
  // TODO: maybe it could use here better format as we already processed and
  // validated the proof?
  bytes proof = 3;
}
RafilxTenfen commented 2 months ago

related #135