-
Notifications
You must be signed in to change notification settings - Fork 30
Atomic swaps support in chainstate #1709
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
Conversation
chainstate/tx-verifier/src/transaction_verifier/signature_check.rs
Outdated
Show resolved
Hide resolved
chainstate/tx-verifier/src/transaction_verifier/signature_destination_getter.rs
Outdated
Show resolved
Hide resolved
chainstate/tx-verifier/src/transaction_verifier/signature_destination_getter.rs
Outdated
Show resolved
Hide resolved
common/src/chain/transaction/signature/inputsig/standard_signature.rs
Outdated
Show resolved
Hide resolved
3421dc4 to
92a1cf6
Compare
chainstate/tx-verifier/src/transaction_verifier/signature_destination_getter.rs
Outdated
Show resolved
Hide resolved
c5c0ef9 to
6313763
Compare
ac95424 to
f104aff
Compare
common/src/chain/transaction/signature/inputsig/standard_signature.rs
Outdated
Show resolved
Hide resolved
common/src/chain/transaction/signature/inputsig/standard_signature.rs
Outdated
Show resolved
Hide resolved
common/src/chain/transaction/signature/inputsig/standard_signature.rs
Outdated
Show resolved
Hide resolved
5cb9e40 to
5a6c710
Compare
5a6c710 to
10c8ee0
Compare
10c8ee0 to
f04750a
Compare
f04750a to
de02614
Compare
|
|
||
| pub trait Transactable: Signable { | ||
| fn signatures(&self) -> Option<&[InputWitness]>; | ||
| fn signatures(&self) -> Vec<Option<InputWitness>>; |
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 is still a change I don't like. Do you still need this after having introduced mintscript? Can you please revert all the changes in this file?
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.
The reason I did this is because I want PartiallySignedTransaction to implement this trait and unify signature verification.
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.
Another round done. Please address the comments.
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 file has to go eventually. I haven't checked and I don't understand why it still exists. I was told it's used in tests. Maybe it's time to kill it.
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.
Yes it's used only in tests. I'd do it as a separate task
ea372e4 to
4001965
Compare
4001965 to
08c1e84
Compare
This PR contains types required for the implementation of the following atomic swaps algorithm. Most of the business logic will be handled by the wallet (which will be done in a separate PR).
xTxOutput::AtomicSwap. It revealsH(x)in the output and can be spent if B knowsxor 2-of-2 multisig is signed by A&B but only after 48 hours.H(x)then 2 scenarios are possibleTxOutput::TransferN coins from TX1 back to A with 2-of-2Destination::ClassicMultisig. Multisig is signed by A.TxOutput::AtomicSwap. It can be spent if A knowsx(which he knows) or multisig is signed by A&B but only after 24 hours.TxOutput::TransferM coins from TX3 back to B. Multisig is signed by B.xwhich reveals the secret to B.x, otherwise spending wouldn’t be authorizedThis is an adaptation of the original algorithm from here: https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949
TODOs: