-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disprove tx #388
disprove tx #388
Conversation
core/src/actor.rs
Outdated
@@ -286,6 +286,36 @@ impl Actor { | |||
Ok(sig_hash) | |||
} | |||
|
|||
#[tracing::instrument(err(level = tracing::Level::ERROR), ret(level = tracing::Level::TRACE))] | |||
pub fn convert_tx_to_script_spend( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have this in Actor
core/src/builder/sighash.rs
Outdated
|
||
let sig_hash = sighash_cache.taproot_key_spend_signature_hash( | ||
txin_index, | ||
&bitcoin::sighash::Prevouts::All(&tx.prevouts), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is inccorect, it should be like:
&match sighash_type {
Some(TapSighashType::SinglePlusAnyoneCanPay) => {
bitcoin::sighash::Prevouts::One(input_index, prevouts[input_index].clone())
}
_ => bitcoin::sighash::Prevouts::All(prevouts),
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a511219
core/src/builder/sighash.rs
Outdated
let mut sighash_cache: SighashCache<&mut bitcoin::Transaction> = | ||
SighashCache::new(&mut tx_handler.tx); | ||
|
||
let prevouts = bitcoin::sighash::Prevouts::All(&tx_handler.prevouts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is inccorect, it should be like:
&match sighash_type {
Some(TapSighashType::SinglePlusAnyoneCanPay) => {
bitcoin::sighash::Prevouts::One(input_index, prevouts[input_index].clone())
}
_ => bitcoin::sighash::Prevouts::All(prevouts),
},
core/src/builder/transaction.rs
Outdated
|
||
let tx_outs = vec![TxOut { | ||
value: OPERATOR_CHALLENGE_AMOUNT, | ||
script_pubkey: operator_taproot_address.script_pubkey(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use operator_reimbursement_wallet_address here,
We use operator_taproot_address for signing but operators will be using their bitcoin core wallet to send the fee paying child txs for their assert txs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 9a907d4
core/src/builder/transaction.rs
Outdated
TxOut { | ||
// value in create_move_tx currently | ||
value: bridge_amount_sats - MOVE_TX_MIN_RELAY_FEE - anyone_can_spend_txout.value, | ||
script_pubkey: operator_taproot_address.script_pubkey(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use operator_reimbursment_address here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/src/builder/sighash.rs
Outdated
let mut sighash_cache: SighashCache<&mut bitcoin::Transaction> = | ||
SighashCache::new(&mut tx_handler.tx); | ||
let prevouts = &match sighash_type { | ||
Some(TapSighashType::SinglePlusAnyoneCanPay) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add other cases?
For these sighases:
SIGHASH_ALL|ANYONECANPAY
SIGHASH_SINGLE|ANYONECANPAY
SIGHASH_NONE|ANYONECANPAY
We require One prevout, otherwise we require all prevouts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added them 536f1f7
Description
Adds disprove tx, challenge tx and happy reimburse tx.