Skip to content
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

Tx structure improvements #18

Open
saiy2k opened this issue Apr 10, 2024 · 3 comments
Open

Tx structure improvements #18

saiy2k opened this issue Apr 10, 2024 · 3 comments
Assignees

Comments

@saiy2k
Copy link
Contributor

saiy2k commented Apr 10, 2024

Following updates are needed with Tx structure:

  1. tx.inputs is now of type TxOut. It should be TxIn that has outpoint and scriptSig for each inputs. Right now TxOut has outpoint.
  2. tx.outputs should have asset specific data right? for liquid and for usdt (in our case)?
@i5hi
Copy link
Collaborator

i5hi commented Apr 10, 2024

  1. I had this thought initially too but check out this struct from lwk: https://docs.rs/lwk_wollet/latest/lwk_wollet/struct.WalletTx.html - inputs and outputs are both WalletTxOut. The field tx: Transaction, has input and output as TxIn and TxOut but this is a native bitcoin struct and does not have the Liquid specific data

  2. https://docs.rs/lwk_wollet/latest/lwk_wollet/struct.WalletTxOut.html -> https://docs.rs/elements/0.24.1/elements/struct.TxOutSecrets.html asset can be found here. In lwk-dart its under TxOut->TxOutSecrets :

#[derive(Clone, Debug, PartialEq)]
pub struct TxOut {
    pub script_pubkey: String,
    pub outpoint: OutPoint,
    pub height: Option<u32>,
    pub unblinded: TxOutSecrets,
}

#[derive(Clone, Debug, PartialEq)]
pub struct TxOutSecrets{
    pub value: u64,
    pub value_bf: String,
    pub asset: String,
    pub asset_bf: String,
}

@i5hi i5hi self-assigned this Apr 10, 2024
@i5hi
Copy link
Collaborator

i5hi commented Apr 10, 2024

  1. I don't think we have any use for TxIn, do we? Other users of the library may, but not sure what to do because we are just following lwk's structure.

@saiy2k
Copy link
Contributor Author

saiy2k commented Apr 10, 2024

So if a single tx spends both liquid and usdt (if that is even possible), it will have 2 txouts, one for liquid and another for usdt. right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants