1

My target is to make transaction with unspent transaction outputs(UTXOS). The information of UTXOs is as follow.

[   
  {
    "pt_idx": 0,
    "subaccount": 37,
    "ga_asset_id": 1,
    "value": "92343",
    "block_height": 1288714,
    "txhash": "9e2d2d56632b609e9b5d0a1990cf0ffbd9865cec558b68ed106df352fd89cfb1",
    "pointer": 1083,
    "script_type": 14   
  },
  {
    "pt_idx": 1,
    "subaccount": 37,
    "ga_asset_id": 1,
    "value": "9961066",
    "block_height": 1288718,
    "txhash": "b0e37f463aba4e3abb078eb77c472b29621cfdd17ed83ae41122b0b95df5e518",
    "pointer": 1096,
    "script_type": 14   
  },
  {
    "pt_idx": 1,
    "subaccount": 37,
    "ga_asset_id": 1,
    "value": "315595",
    "block_height": 1288721,
    "txhash": "b062efcab010d436ca2f6bed0dc61b90d8cbced756e1ed7cc7593cac30d87326",
    "pointer": 1099,
    "script_type": 14   
  },
  {
    "pt_idx": 1,
    "subaccount": 37,
    "ga_asset_id": 1,
    "value": "1872759",
    "block_height": 1288716,
    "txhash": "f88cfdb328f9d298b0ff8a641198d3e63ea7efaf6f98f5692ba3f88a03a73c2b",
    "pointer": 1088,
    "script_type": 14   }
]

From these I made transaction using pycoin library. By the way, it is difficult to sign a SegWit transaction. If anyone knows about this, please tell me.

4
  • What the pycoin version ?
    – f4r4
    Apr 16, 2018 at 17:35
  • pycoin 0.80.If you have solution, Pls tell me.
    – Coder HHC
    Apr 17, 2018 at 17:58
  • @Mickey102644 Can you paste the (unsigned) transaction you made with Pycoin?
    – Mike D
    Jun 1, 2018 at 9:04
  • I’m voting to close this question because the user doesn't show any trace of experiment or trial-and-error whatsoever, essentially asking us to write code for them. Dec 4, 2023 at 12:21

1 Answer 1

0

For compatible segwit transactions, it is basically using p2sh transactions.
For pycoin specifically, you need to provide p2sh_lookup dict when sign the p2sh transaction.
I have a sample for bitcoin offline/paper transaction if you would like to check, the method spend_sh_fund may suit your need.

1
  • What about native segwit? Is there library to sign those? Aug 30, 2022 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.