Skip to content

Instantly share code, notes, and snippets.

@inaltoasinistra
Created February 23, 2022 15:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save inaltoasinistra/ae00910db49d7eff96c88281318218d5 to your computer and use it in GitHub Desktop.

Elements craterawtransaction

Elements version: 210001

UTXOs of the wallet

asset:

- txid: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
  vout: 2
  amount: 2.00000000
  asset: 732a21875c9b17d123d68681357a601c339e25962e696cf850f7acfa098b9b82

btc:

- txid: dc5a6545a8a390b9a73089a014fb3115f275af4637c5236c9a903661dde2bdd4
  vout: 1
  amount: 0.00100000
  asset: 144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49

inputs off the transaction

- txid: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
  vout: 2
- txid: dc5a6545a8a390b9a73089a014fb3115f275af4637c5236c9a903661dde2bdd4
  vout: 1

outputs of the transaction:

- tex1qy42sf7sf7h95grvan8g6e2s78qvges52ekqqwp: 0.5
  asset: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
- tex1q6lmnh0mhvlay20afa83mxc6t883t3tea73yle7: 0.00099000
  asset: 144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49
- tex1qeev7x7xvh6fv038dfalqlchscufdnhjw946sae: 1.5
  asset: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
- fee: 0.00001000

inputs as json

[{"txid":"da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643","vout":2},{"txid":"dc5a6545a8a390b9a73089a014fb3115f275af4637c5236c9a903661dde2bdd4","vout":1}]

outputs as json

[{"tex1qy42sf7sf7h95grvan8g6e2s78qvges52ekqqwp":0.5,"asset":"da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643"},{"tex1q6lmnh0mhvlay20afa83mxc6t883t3tea73yle7":0.00099,"asset":"144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49"},{"tex1qeev7x7xvh6fv038dfalqlchscufdnhjw946sae":1.5,"asset":"da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643"},{"fee":1e-05}]
$ elements-cli -rpcwallet=e createrawtransaction $INPUTS $OUTPUTS

T=020000000002430640c7be24b0e3e9170d39ef5a946ea2ce837fb4e09702d47cb498768a2ada0200000000ffffffffd4bde2dd6136909a6c23c53746af75f21531fb14a08930a7b990a3a845655adc0100000000ffffffff0401430640c7be24b0e3e9170d39ef5a946ea2ce837fb4e09702d47cb498768a2ada010000000002faf08000160014255504fa09f5cb440d9d99d1acaa1e38188cc28a01499a818545f6bae39fc03b637f2a4e1e64e590cac1bc3a6f6d71aa4443654c140100000000000182b800160014d7f73bbf7767fa453fa9e9e3b3634b39e2b8af3d01430640c7be24b0e3e9170d39ef5a946ea2ce837fb4e09702d47cb498768a2ada010000000008f0d18000160014ce59e378ccbe92c7c4ed4f7e0fe2f0c712d9de4e01499a818545f6bae39fc03b637f2a4e1e64e590cac1bc3a6f6d71aa4443654c140100000000000003e8000000000000

$ elements-cli -rpcwallet=e signrawtransactionwithwallet $T

S=020000000102430640c7be24b0e3e9170d39ef5a946ea2ce837fb4e09702d47cb498768a2ada0200000000ffffffffd4bde2dd6136909a6c23c53746af75f21531fb14a08930a7b990a3a845655adc0100000000ffffffff0401430640c7be24b0e3e9170d39ef5a946ea2ce837fb4e09702d47cb498768a2ada010000000002faf08000160014255504fa09f5cb440d9d99d1acaa1e38188cc28a01499a818545f6bae39fc03b637f2a4e1e64e590cac1bc3a6f6d71aa4443654c140100000000000182b800160014d7f73bbf7767fa453fa9e9e3b3634b39e2b8af3d01430640c7be24b0e3e9170d39ef5a946ea2ce837fb4e09702d47cb498768a2ada010000000008f0d18000160014ce59e378ccbe92c7c4ed4f7e0fe2f0c712d9de4e01499a818545f6bae39fc03b637f2a4e1e64e590cac1bc3a6f6d71aa4443654c140100000000000003e800000000000000000247304402202554c4a21c5a2c67cc4b79380b108dcce4f5f65f0b432a41c16d646e59811c5d0220344080a27874b22d1cbd0d2160fd771fa485d54620f2b1198f714a77031a9a4a0121036b2f857198cc604519da665d3051face1a9d4a99c0827c35818785935936827b00000002473044022028f7b89b7a337dc21c6454a53118628d20cafe44f30483135735a0efdb6ddc0a0220461fb9ea17ad90ab668819628ce24e529da142cc77c329492cc20d12289a668c0121036b2f857198cc604519da665d3051face1a9d4a99c0827c35818785935936827b000000000000000000

$ elements-cli -rpcwallet=e sendrawtransaction $S


error code: -26
error message:
bad-txns-in-ne-out, value in != value out
$ elements-cli -rpcwallet=e decoderawtransaction $S | yq e -P
txid: c7cad4926f628da79f3d4447fce9f76fd4a544fe1a310c9873cd7a4f3f9c2eab
hash: f2a1c959de392eb48ad1c39ef749ed659632ffe745f4c0bc3efc7419e1fc11c1
wtxid: f2a1c959de392eb48ad1c39ef749ed659632ffe745f4c0bc3efc7419e1fc11c1
withash: 5e4d3ee04502cdf5f51ae344f1986aaa78a517c47b31f40fd46dc3dca308545b
version: 2
size: 563
vsize: 392
weight: 1568
locktime: 0
vin:
  - txid: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
    vout: 2
    scriptSig:
      asm: ""
      hex: ""
    is_pegin: false
    sequence: 4294967295
    txinwitness:
      - 304402202554c4a21c5a2c67cc4b79380b108dcce4f5f65f0b432a41c16d646e59811c5d0220344080a27874b22d1cbd0d2160fd771fa485d54620f2b1198f714a77031a9a4a01
      - 036b2f857198cc604519da665d3051face1a9d4a99c0827c35818785935936827b
  - txid: dc5a6545a8a390b9a73089a014fb3115f275af4637c5236c9a903661dde2bdd4
    vout: 1
    scriptSig:
      asm: ""
      hex: ""
    is_pegin: false
    sequence: 4294967295
    txinwitness:
      - 3044022028f7b89b7a337dc21c6454a53118628d20cafe44f30483135735a0efdb6ddc0a0220461fb9ea17ad90ab668819628ce24e529da142cc77c329492cc20d12289a668c01
      - 036b2f857198cc604519da665d3051face1a9d4a99c0827c35818785935936827b
vout:
  - value: 0.50000000
    asset: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
    commitmentnonce: ""
    commitmentnonce_fully_valid: false
    n: 0
    scriptPubKey:
      asm: 0 255504fa09f5cb440d9d99d1acaa1e38188cc28a
      hex: 0014255504fa09f5cb440d9d99d1acaa1e38188cc28a
      reqSigs: 1
      type: witness_v0_keyhash
      addresses:
        - tex1qy42sf7sf7h95grvan8g6e2s78qvges52ekqqwp
  - value: 0.00099000
    asset: 144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49
    commitmentnonce: ""
    commitmentnonce_fully_valid: false
    n: 1
    scriptPubKey:
      asm: 0 d7f73bbf7767fa453fa9e9e3b3634b39e2b8af3d
      hex: 0014d7f73bbf7767fa453fa9e9e3b3634b39e2b8af3d
      reqSigs: 1
      type: witness_v0_keyhash
      addresses:
        - tex1q6lmnh0mhvlay20afa83mxc6t883t3tea73yle7
  - value: 1.50000000
    asset: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
    commitmentnonce: ""
    commitmentnonce_fully_valid: false
    n: 2
    scriptPubKey:
      asm: 0 ce59e378ccbe92c7c4ed4f7e0fe2f0c712d9de4e
      hex: 0014ce59e378ccbe92c7c4ed4f7e0fe2f0c712d9de4e
      reqSigs: 1
      type: witness_v0_keyhash
      addresses:
        - tex1qeev7x7xvh6fv038dfalqlchscufdnhjw946sae
  - value: 0.00001000
    asset: 144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49
    commitmentnonce: ""
    commitmentnonce_fully_valid: false
    n: 3
    scriptPubKey:
      asm: ""
      hex: ""
      type: fee
$ elements-cli -rpcwallet=e listunspent | yq e -P
- txid: da2a8a7698b47cd40297e0b47f83cea26e945aef390d17e9e3b024bec7400643
  vout: 2
  address: tex1qeev7x7xvh6fv038dfalqlchscufdnhjw946sae
  label: ""
  scriptPubKey: 0014ce59e378ccbe92c7c4ed4f7e0fe2f0c712d9de4e
  amount: 2.00000000
  asset: 732a21875c9b17d123d68681357a601c339e25962e696cf850f7acfa098b9b82
  amountblinder: "0000000000000000000000000000000000000000000000000000000000000000"
  assetblinder: "0000000000000000000000000000000000000000000000000000000000000000"
  confirmations: 190
  spendable: true
  solvable: true
  desc: wpkh([a1e2399b/0'/0'/0']036b2f857198cc604519da665d3051face1a9d4a99c0827c35818785935936827b)#qpy8f887
  safe: true
- txid: dc5a6545a8a390b9a73089a014fb3115f275af4637c5236c9a903661dde2bdd4
  vout: 1
  address: tex1qeev7x7xvh6fv038dfalqlchscufdnhjw946sae
  label: ""
  scriptPubKey: 0014ce59e378ccbe92c7c4ed4f7e0fe2f0c712d9de4e
  amount: 0.00100000
  asset: 144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49
  amountblinder: "0000000000000000000000000000000000000000000000000000000000000000"
  assetblinder: "0000000000000000000000000000000000000000000000000000000000000000"
  confirmations: 190
  spendable: true
  solvable: true
  desc: wpkh([a1e2399b/0'/0'/0']036b2f857198cc604519da665d3051face1a9d4a99c0827c35818785935936827b)#qpy8f887
  safe: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment