Closed netrome closed 1 year ago
However, the operation does not contain the signed message,
That's because it's not necessary. The data that goes into the message to be signed can be extracted from the sBTC smart contract and Bitcoin state.
Downstream applications (such as the Stacks Coordinator) must therefore fetch the corresponding bitcoin transaction to be able to derive this information. It would be much more convenient if the sender information was stored in the op in the stacks node directly.
Thank you for clarifying this @jcnelson. We'll recover the public key in the Coordinator instead then.
- Writing data to non-segwit Bitcoin data spaces is expensive. An ounce of effort today will save users literally hundreds of dollars down the road.
To clarify, I'm not proposing changing anything written to Bitcoin. I'm just proposing to update the internal struct stored in the sortition database and burnchain ops table in the stacks nodes. But I'm completely fine with saving space here.
Jude and I sorted out the confusion in discord. "Sender" was a confusing name. Renaming the field to stx_address
. We now agreed that this proposal makes sense.
Thinking some more on this, I realize we don't need to actually store the stx_address
as we can recover it given the recipient
and amount
which are already stored in the op.
However, I think it still makes sense to have this logic in the stacks node as a reference. Therefore I will rephrase this ticket to add a public method pub fn stx_address()
on the PegOutRequestOp
.
Background
The stacks coordinator must be able to derive an STX address from a peg out request operation. This address can be derived using the
recipient
,amount
andsignature
fields already present in the op. However, everyone using sBTC must agree on this scheme so it makes sense to implement this logic in thePegOutRequestOp
struct to act as a reference for all users of sBTC.Definition of done
The
PegOutRequestOp
struct has astx_address
method returning aStacksAddress
, corresponding to the sBTC holders stacks account.