Bitcoin Forum
May 11, 2024, 10:01:50 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / In coinjoins, do coordinators know the relationship between inputs and outputs ? on: September 08, 2022, 05:18:36 AM
If I understand correctly, Samourai and Wasabi's Coinjoin implementations use a central coordinator.

This coordinator is responsible for receiving the inputs that users want to join and distributing the values ​​equally among the outputs provided by them.

The amounts left over from this division are considered change and should not be mixed with the outputs that were used.

JoinMarket uses a similar process, but instead of a central coordinator, it uses IRC addresses where so-called takers can act as transaction coordinators and also uses the concept of "mixdepths" to isolate coins (for each coinjoin round).

If what is described above is correct, the central coordinator (or the taker) needs to know which outputs are related to certain inputs in order to distribute the value correctly.
In this case, a malicious coordinator or taker will know the relationship between the inputs/outputs of the transactions.
So there is a relationship of trust involved (in relation to the coordinators) and in the case of takers, a chain analysis company can pass itself off as one with very attractive fees to be able to track the maximum number of transactions.

My questions are:

1) Is this description about how coinjoin works correct?

1.1) If so, is there a way to prevent coordinator or takers from knowing the relationship between inputs / outputs?
1.2) If it is wrong, how can coordinators or takers be prevented from knowing this?
2  Bitcoin / Development & Technical Discussion / Re: Is there a way to import coins into a Bitcoin Core wallet? on: April 12, 2022, 07:15:45 PM
Thanks. But creating a transaction or PSBT does not add it to the wallet (specifically to the `mapWallet` collection).
What I'm looking for is a way to import a coin (UTXO) into the wallet so that it can be considered when calculating the inputs for a transaction.

Is there an RPC to add a specific transaction to a wallet even if its outputs do not belong to the wallet ?
3  Bitcoin / Development & Technical Discussion / Is there a way to import coins into a Bitcoin Core wallet? on: April 12, 2022, 04:42:34 AM
Is there a way to import coins (UTXOs) into a Bitcoin Core wallet?

And can these coins also be used to build transactions / PSBTs (to be partially signed by the original / hot wallet)?
4  Bitcoin / Development & Technical Discussion / Re: Extract the Public Key from a "CScript CTxIn::scriptSig" object on: April 09, 2022, 05:29:04 AM
Thanks for your detailed answer.

Yes, I understand that "CPubKey pubkey(vchPubKey);" would work on "bool EvalScript(...)", but I am trying to extract the public key from "CScript CTxIn::scriptSig" inside "CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, ...)", where I have access to the scriptSig from the transaction inputs ("CTransaction::vin") and to the "CWallet::chain()", where I can retrieve the coins (`class Coin`) related to an input and get the "Coin::CTxOut:: scriptPubKey" if necessary (perhaps to infer the transaction type?).

1) and 3) For SegWit version 0 scripts (P2PWKH and P2SH-P2WPKH), I think the data will be in "CScriptWitness CTxIn::scriptWitness" and not in "CScript scriptSig". The same may apply to P2TR transactions (SegWit version 1).

2) For legacy address (P2PKH, P2SH and P2PK) I think  it will be in "CScript CTxIn::scriptSig".

So I would like to extract the Public Key inside "CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, ...)". The reason is to do an ECDH operation with other keys.

I think this issue is already solved at some point in the code as it is necessary to evaluate the script, but I haven't been able to find this logic so far.
5  Bitcoin / Development & Technical Discussion / Re: Extract the Public Key from a "CScript CTxIn::scriptSig" object on: April 09, 2022, 04:27:46 AM
Thanks for your reply.
But I assume the steps you mentioned already exists in the code (or something like that) as the "src/script/interpreter.cpp::EvalChecksig(...)" needs the public key(s) to process the OP_CHECKSIG and OP_CHECKMULTISIG operation codes.

Code:
bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptExecutionData& execdata, ScriptError* serror)
{
    // ...
    case OP_CHECKSIG:
    case OP_CHECKSIGVERIFY:
    {
        // ....
        valtype& vchSig    = stacktop(-2);
        valtype& vchPubKey = stacktop(-1);

But I couldn't find the part of the code where the public key is extracted from the scriptSig and inserted into the script stack. I've tried debugging and grep to "stack.push_back("  but no good results.

I'm particularly interested in extracting the public key of "CScript CTxIn::scriptSig" from P2PKH, P2WPKH, P2TR.
6  Bitcoin / Development & Technical Discussion / Extract the Public Key from a "CScript CTxIn::scriptSig" object on: April 09, 2022, 02:41:42 AM
In Bitcoin Core code, how can the Public Key ("class CPubKey" or "class XOnlyPubKey") be extracted from a "CScript CTxIn::scriptSig" object ?

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!