Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

91
Visualizações
Sending bitcoin transaction using multiple inputs and multiple outputs

My target - send to one of my users requested amount of BTC. I have many BTC wallets generated from the same mnemonic phrase with different balances.

So, my inputs data is - target wallet, target amount and list of wallets with balances. If found a set of inputs with total balance more than I need to send, I need to return difference between inputs balance and target amount to random input.

My data looks like:

[
  {
    "wallet": "xxxx1",
    "privateKey": "key1",
    "unspentAmount": 46659,
    "unspentTransactions": [
      {
        "tx_hash_big_endian": "..",
        "tx_hash": "...",
        "tx_output_n": 0,
        "script": "...",
        "value": 46659,
        "value_hex": "00b643",
        "confirmations": 757,
        "tx_index": 1156017252431081
      }
    ]
  },
  {
     "wallet": "xxx2",
    "privateKey": "key2",
    "unspentAmount": 13339,
    "unspentTransactions": [
      {
        "tx_hash_big_endian": "...",
        "tx_hash": "...",
        "tx_output_n": 0,
        "script": "...",
        "value": 13339,
        "value_hex": "00b643",
        "confirmations": 757,
        "tx_index": 1156017252431081
      }
    ]
  }
]

How to build transaction using bitcoin-core or bitcoin-lib? I need multiple inputs and multiple outputs.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda