<blockquote>
  <p>Is it really necessary to indicate the age of the pieces used?</p>
</blockquote>

<p>The "age" is shown only in Blockcypher's API. Transaction itself does not have such field</p>

<blockquote>
  <p>Is there a way to reduce the size of the transaction script? </p>
</blockquote>

<p>Yes. Use segwit</p>

CC BY-SA 3.0
2018-01-12T20:16:30.363Z
Is there a documentation on how to create SegWit transactions?
Nestor Mata Cuthbert
CC BY-SA 3.0
2018-01-06T19:41:34.407Z
2018-01-06T19:41:34.407Z
amaclin
<p>Transactions been formed with too many pieces of different ages, causing the transaction to have a huge size and therefore require very high fees.</p>

<h2>Question</h2>

<p>Is there a way to reduce the size of the transaction?</p>

<h1>Story</h1>

<p>I have a payment system that accepts bitcoins.
Therefore my client (the store owner) receives many transactions of relatively small amounts ($30 - $400 amounts).
And every now and then he tries to move what he has on his address to exchange that to dollars.
We use Blockcypher's API.
The problem is that when we construct the transaction, the script gets formed with all the sum of the different pieces, indicating which pieces will form the payment, as I see it, this is done using the age.</p>

<p>An example of how these pieces are in the input list is here:</p>

<pre><code>"inputs": [
  {
    "prev_hash": "094be5d93ec5a5299fc8f64501855010649e3bb15d56f41ac9b5291d0XXXXX",
    "output_index": 0,
    "script": "483045022100d73dd1a8499caac0d237f5f2df17786722b4e50120756bc63c4f5f513b4f4244022019d20416762f21870e63fe035e2a0599217bc62323430ca428c2d1c8930b67270121035a3ce00ccf0701a28f124e634f4243ef2b40650aad5b0433eba4feXXXXXXX",
    "output_value": 1883692,
    "sequence": 4294967295,
    "addresses": [
      "1Lpua75bYTfeVUaEYDEkzY1vxwaVFvUNNr"
    ],
    "script_type": "pay-to-pubkey-hash",
    "age": 498654
  },
  {
    "prev_hash": "1917bb8a51642541f9d4b20beeec02a57193d5ede91e7fc79a6b7aXXXXXXX",
    "output_index": 0,
    "script": "483045022100d5f54e8b89fe080b16236a742bce0d4512f83d382a683bee96a25d5c1ff41a0802206844d81b0c2d909e4d893733a7f317caaa49a408f69c0414cee0685ac96883850121035a3ce00ccf0701a28f124e634f4243ef2b40650aad5b0433ebaXXXXXXXX",
    "output_value": 2470000,
    "sequence": 4294967295,
    "addresses": [
      "1Lpua75bYTfeVUaEYDEkzY1vxwaVFvUNNr"
    ],
    "script_type": "pay-to-pubkey-hash",
    "age": 498665
  },
</code></pre>

<p>Is it really necessary to indicate the age of the pieces used?
Is there a way to reduce the size of the transaction script?
This is costing too much in fees to my client. We are talking transactions that costs hundreds or more dollars.</p>

<p>Thanks in advance.</p>

<transactions><bitcoin-core><transaction-fees>
Transaction using too many pieces
Nestor Mata Cuthbert
# Transaction using too many pieces

(Asked by: username_0 on 2018-01-06)

Transactions been formed with too many pieces of different ages, causing the transaction to have a huge size and therefore require very high fees.
Question
Is there a way to reduce the size of the transaction?
Story
I have a payment system that accepts bitcoins.
Therefore my client (the store owner) receives many transactions of relatively small amounts ($30 - $400 amounts).
And every now and then he tries to move what he has on his address to exchange that to dollars.
We use Blockcypher's API.
The problem is that when we construct the transaction, the script gets formed with all the sum of the different pieces, indicating which pieces will form the payment, as I see it, this is done using the age.
An example of how these pieces are in the input list is here:
"inputs": [
  {
    "prev_hash": "094be5d93ec5a5299fc8f64501855010649e3bb15d56f41ac9b5291d0XXXXX",
    "output_index": 0,
    "script": "483045022100d73dd1a8499caac0d237f5f2df17786722b4e50120756bc63c4f5f513b4f4244022019d20416762f21870e63fe035e2a0599217bc62323430ca428c2d1c8930b67270121035a3ce00ccf0701a28f124e634f4243ef2b40650aad5b0433eba4feXXXXXXX",
    "output_value": 1883692,
    "sequence": 4294967295,
    "addresses": [
      "1Lpua75bYTfeVUaEYDEkzY1vxwaVFvUNNr"
    ],
    "script_type": "pay-to-pubkey-hash",
    "age": 498654
  },
  {
    "prev_hash": "1917bb8a51642541f9d4b20beeec02a57193d5ede91e7fc79a6b7aXXXXXXX",
    "output_index": 0,
    "script": "483045022100d5f54e8b89fe080b16236a742bce0d4512f83d382a683bee96a25d5c1ff41a0802206844d81b0c2d909e4d893733a7f317caaa49a408f69c0414cee0685ac96883850121035a3ce00ccf0701a28f124e634f4243ef2b40650aad5b0433ebaXXXXXXXX",
    "output_value": 2470000,
    "sequence": 4294967295,
    "addresses": [
      "1Lpua75bYTfeVUaEYDEkzY1vxwaVFvUNNr"
    ],
    "script_type": "pay-to-pubkey-hash",
    "age": 498665
  },

Is it really necessary to indicate the age of the pieces used?
Is there a way to reduce the size of the transaction script?
This is costing too much in fees to my client. We are talking transactions that costs hundreds or more dollars.
Thanks in advance.

**Tags:** transactions, bitcoin-core, transaction-fees


---

## 1 answers

### Answer by username_1 on 2018-01-06. Score: 1

> Is it really necessary to indicate the age of the pieces used?

The "age" is shown only in Blockcypher's API. Transaction itself does not have such field

> Is there a way to reduce the size of the transaction script?

Yes. Use segwit

> **Comments:**
> **username_0**: Is there a documentation on how to create SegWit transactions?  

---

