<blockquote>
<p>With the use of segwit, transaction data is no longer part of transaction body</p>
</blockquote>
<p>That's incorrect. It's just not covered by the txid, but it's still an integral part of a transaction. Every updated full node will download the witness data, and if they're storing blocks, also remember the witness data.</p>
<blockquote>
<p>and thus can’t be retrieved from block explorers.</p>
</blockquote>
<p>That would only be the case of the block explorer doesn't support segwit.</p>
<p>For example, <a href="https://blockstream.info/api/tx/28250abbca9547b7a8e4b62d065fd62633b26e628c267a4237c8848cf641d710/hex" rel="nofollow noreferrer">here</a> is a recent segwit transaction (with witness data included) on blockstream.info.</p>
<blockquote>
<p>So is there a Bitcoin rpc method in order to get it.</p>
</blockquote>
<p>Sure, <code>getrawtransaction</code> will give it to you (it needs the txindex=1 config option, though).</p>

CC BY-SA 4.0
2020-09-15T23:51:45.640Z
I wanted to mean signature data of course. Not transaction data. Please see my last edit.
user2284570
CC BY-SA 4.0
2020-09-15T23:52:25.527Z
I assumed so; signature data is what my answer is about.
Pieter Wuille
CC BY-SA 4.0
2020-09-16T00:06:10.897Z
but `getrawtransaction` is for finding the signature manually. Something I don’t know how to do. I just want to perform pay to pubkey transactions wothout asking the pubkey to addresses and as far I understand, recovering the pubkey from EC signature is the only way to do that.
user2284570
CC BY-SA 4.0
2020-09-16T00:11:33.023Z
You're confused in multiple ways. 1) You don't need to recover public keys from the signature - they're directly revealed in the witness (scriptSig for non-segwit transactions, witness stack for segwit ones). 2) You'll need getrawtransaction regardless of what you want to learn about a transaction. 3) You absolutely shouldn't be trying to determine the "sender's public key" of a transaction and use it for anything but debugging. Multiple parties can collaborate to construct a transaction, and there is no way (intentionally) of telling who is who. If you need a pubkey, ask them.
Pieter Wuille
CC BY-SA 4.0
2020-09-16T00:22:37.753Z
this is for figuring the answer to this question https://bitcoin.stackexchange.com/q/98779 myself. About your concerned about who is who, this is of course about used adresses.
user2284570
CC BY-SA 4.0
2020-09-16T00:43:39.487Z
I don't really understand what you're trying to do. Why do you need to figure out the public key for a used address, except for debugging purposes? You shouldn't try to reuse keys.
Pieter Wuille
CC BY-SA 4.0
2020-09-16T00:46:02.623Z
I want things to be tracked easly for accountability. Privacy isn t something I want to use.
user2284570
CC BY-SA 4.0
2020-09-16T00:47:22.487Z
Why do you need other people's public keys for accountability?
Pieter Wuille
CC BY-SA 4.0
2020-09-16T00:58:25.883Z
that s my general rule not specific to the current case. This just means I don t care about privacy.
user2284570
CC BY-SA 4.0
2020-09-15T23:48:15.807Z
2020-09-15T23:52:06.553Z
2020-09-15T23:52:06.553Z
Pieter Wuille
<p>With the use of segwit, signature data is no longer part of transaction body and thus can’t be retrieved from block explorers. So is there a Bitcoin rpc method in order to get it directly without having to extract it from transaction manually?</p>
<p>My aim is to retrieve the public key behind segwit Bitcoin addresses from EC signature which requires the signature along signed data.</p>

<segregated-witness><signature><ecdsa><bech32-address>
How to get the raw signature data of a transaction?
user2284570
# How to get the raw signature data of a transaction?

(Asked by: username_0 on 2020-09-15)

With the use of segwit, signature data is no longer part of transaction body and thus can’t be retrieved from block explorers. So is there a Bitcoin rpc method in order to get it directly without having to extract it from transaction manually?

My aim is to retrieve the public key behind segwit Bitcoin addresses from EC signature which requires the signature along signed data.

**Tags:** segregated-witness, signature, ecdsa, bech32-address


---

## 1 answers

### Answer by username_1 on 2020-09-15. Score: 0 | Accepted answer

> With the use of segwit, transaction data is no longer part of transaction body

That's incorrect. It's just not covered by the txid, but it's still an integral part of a transaction. Every updated full node will download the witness data, and if they're storing blocks, also remember the witness data.

> and thus can’t be retrieved from block explorers.

That would only be the case of the block explorer doesn't support segwit.

For example, [here](https://blockstream.info/api/tx/28250abbca9547b7a8e4b62d065fd62633b26e628c267a4237c8848cf641d710/hex) is a recent segwit transaction (with witness data included) on blockstream.info.

> So is there a Bitcoin rpc method in order to get it.

Sure, `getrawtransaction` will give it to you (it needs the txindex=1 config option, though).

> **Comments:**
> **username_0**: I wanted to mean signature data of course. Not transaction data. Please see my last edit.  
> **username_1**: I assumed so; signature data is what my answer is about.  
> **username_0**: but `getrawtransaction` is for finding the signature manually. Something I don’t know how to do. I just want to perform pay to pubkey transactions wothout asking the pubkey to addresses and as far I understand, recovering the pubkey from EC signature is the only way to do that.  
> **username_1**: You're confused in multiple ways. 1) You don't need to recover public keys from the signature - they're directly revealed in the witness (scriptSig for non-segwit transactions, witness stack for segwit ones). 2) You'll need getrawtransaction regardless of what you want to learn about a transaction. 3) You absolutely shouldn't be trying to determine the "sender's public key" of a transaction and use it for anything but debugging. Multiple parties can collaborate to construct a transaction, and there is no way (intentionally) of telling who is who. If you need a pubkey, ask them.  
> **username_0**: this is for figuring the answer to this question https://bitcoin.stackexchange.com/q/98779 myself. About your concerned about who is who, this is of course about used adresses.  
> **username_1**: I don't really understand what you're trying to do. Why do you need to figure out the public key for a used address, except for debugging purposes? You shouldn't try to reuse keys.  
> **username_0**: I want things to be tracked easly for accountability. Privacy isn t something I want to use.  
> **username_1**: Why do you need other people's public keys for accountability?  
> **username_0**: that s my general rule not specific to the current case. This just means I don t care about privacy.  

---

