<p>Bitcoin does not actually use addresses internally. Addresses are just a way for us humans to specify what scriptPubKey we want the wallet software to create. When a transaction output is spent, the address is not included anywhere because it is not needed.</p>

<p>Bitcoin Core's decoding RPCs will include more information than is actually present in the transaction, block, or script. This is because it can infer and display the information present in different ways.</p>

<p>Since an address describes a scriptPubKey, it is typically possible to take a scriptPubKey and compute an address that corresponds to it. This is not always possible because not all scriptPubKeys correspond to addresses. But usually they do, and so the decoder will show you that.</p>

<p>However scriptSigs do not have corresponding addresses. You cannot get a scriptSig from an address and vice versa. In fact, the idea that you send from an address is really not true; that's just a simpler way to describe things to people. It isn't how Bitcoin actually works.</p>

<p>The reference to the previous output is done by explicitly referencing it, not referencing some address. Every output is uniquely identified by the transaction it is included in, and its index in the array of outputs in that transaction. Bitcoin Core displays this to you as the <code>txid</code> and <code>vout</code> fields for each input.</p>

<p>Bitcoin really does not have wallet ids. Contrary to popular belief, addresses are not wallet ids, nor are public keys.</p>

CC BY-SA 4.0
2019-08-05T15:44:13.350Z
So, the reference to previous output is the type Outpoint inside the Transaction input? so the hash inside the outpoint is the hash of the Previous Transaction output?
vincenzopalazzo
CC BY-SA 4.0
2019-08-05T17:12:10.557Z
Yes. The hash is the txid of the previous transaction, no the hash of the previous transaction output. It tells you what transaction to look up. The vout is the index of the transaction output in the array of transaction outputs in the previous transaction. It tells you where exactly in that transaction is the output being spent.
Ava Chow
CC BY-SA 4.0
2019-08-06T11:18:01.413Z
Thank so much, so for get the previus txout I could decodeRawTransaction(outpoinHasTx) -> access the transactionOutoput where vout = nOutpoint -> decode the scriptPubKeys
vincenzopalazzo
CC BY-SA 4.0
2019-08-06T17:27:32.570Z
Yes. That is how you would get the address for an input.
Ava Chow
CC BY-SA 4.0
2019-08-05T15:28:46.057Z
2019-08-05T15:45:12.793Z
2019-08-05T15:45:12.793Z
Ava Chow
<p>I'm trying to get the wallet id from scriptSing and ScriptPubKey. When I decode the scriptSig, the result does not contain the address address. But when I decode the scriptPubKey, it contains the address.</p>

<p>Why the scriptSig does not contain the address?</p>

<p>If it does not contain the wallet id, does it contain any references to previous transaction output?
if yes, what is the property inside the RPC response that contains the reference to previous output? </p>

<p>This is the documentation reference <a href="https://bitcoin-rpc.github.io/en/doc/0.17.99/rpc/rawtransactions/decodescript/" rel="nofollow noreferrer">bitcoin core</a></p>

<bitcoin-core><bitcoind><json-rpc><bitcoin-core-development>
What does the scriptSing contain when it is decoded with RPC framework?
vincenzopalazzo
# What does the scriptSing contain when it is decoded with RPC framework?

(Asked by: username_0 on 2019-08-05)

I'm trying to get the wallet id from scriptSing and ScriptPubKey. When I decode the scriptSig, the result does not contain the address address. But when I decode the scriptPubKey, it contains the address.

Why the scriptSig does not contain the address?

If it does not contain the wallet id, does it contain any references to previous transaction output?
if yes, what is the property inside the RPC response that contains the reference to previous output?

This is the documentation reference [bitcoin core](https://bitcoin-rpc.github.io/en/doc/0.17.99/rpc/rawtransactions/decodescript/)

**Tags:** bitcoin-core, bitcoind, json-rpc, bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2019-08-05. Score: 2 | Accepted answer

Bitcoin does not actually use addresses internally. Addresses are just a way for us humans to specify what scriptPubKey we want the wallet software to create. When a transaction output is spent, the address is not included anywhere because it is not needed.

Bitcoin Core's decoding RPCs will include more information than is actually present in the transaction, block, or script. This is because it can infer and display the information present in different ways.

Since an address describes a scriptPubKey, it is typically possible to take a scriptPubKey and compute an address that corresponds to it. This is not always possible because not all scriptPubKeys correspond to addresses. But usually they do, and so the decoder will show you that.

However scriptSigs do not have corresponding addresses. You cannot get a scriptSig from an address and vice versa. In fact, the idea that you send from an address is really not true; that's just a simpler way to describe things to people. It isn't how Bitcoin actually works.

The reference to the previous output is done by explicitly referencing it, not referencing some address. Every output is uniquely identified by the transaction it is included in, and its index in the array of outputs in that transaction. Bitcoin Core displays this to you as the `txid` and `vout` fields for each input.

Bitcoin really does not have wallet ids. Contrary to popular belief, addresses are not wallet ids, nor are public keys.

> **Comments:**
> **username_0**: So, the reference to previous output is the type Outpoint inside the Transaction input? so the hash inside the outpoint is the hash of the Previous Transaction output?  
> **username_1**: Yes. The hash is the txid of the previous transaction, no the hash of the previous transaction output. It tells you what transaction to look up. The vout is the index of the transaction output in the array of transaction outputs in the previous transaction. It tells you where exactly in that transaction is the output being spent.  
> **username_0**: Thank so much, so for get the previus txout I could decodeRawTransaction(outpoinHasTx) -> access the transactionOutoput where vout = nOutpoint -> decode the scriptPubKeys  
> **username_1**: Yes. That is how you would get the address for an input.  

---

