4

There are many explorers which allows to dissamble a transaction back into opcodes.

But what about scripts which aren’t broadcasted yet like this redeem script :512102974ffd58d960908d6f2930fbcc4aa288580d05b35a70869e9a8ada3d080acf392103ef884166c7bd20324fd7f959dc680989a6a8b0d62c348defa900fcd4d31200f152ae ?

2

1 Answer 1

5

bitcoind has a decodescript method.

$ bitcoin-cli decodescript "512102974ffd58d960908d6f2930fbcc4aa288580d05b35a70869e9a8ada3d080acf392103ef884166c7bd20324fd7f959dc680989a6a8b0d62c348defa900fcd4d31200f152ae"
{
  "asm": "1 02974ffd58d960908d6f2930fbcc4aa288580d05b35a70869e9a8ada3d080acf39 03ef884166c7bd20324fd7f959dc680989a6a8b0d62c348defa900fcd4d31200f1 2 OP_CHECKMULTISIG",
  "reqSigs": 1,
  "type": "multisig",
  "addresses": [
    "1CmMoanE9uahYETLahBTGZSFZSQGV8ADrR",
    "12z2brRNYFkqJe3zP58uoiGcLqDxfk6J7r"
  ],
  "p2sh": "34EJTjAmEPbPGXAPQWU7sn4beoZyGTTxBw",
  "segwit": {
    "asm": "0 a45407120f912ef91ecd7e66a27cb4dc106f962172470b1b39c1bb5008898277",
    "hex": "0020a45407120f912ef91ecd7e66a27cb4dc106f962172470b1b39c1bb5008898277",
    "reqSigs": 1,
    "type": "witness_v0_scripthash",
    "addresses": [
      "bc1q532qwys0jyh0j8kd0en2yl95msgxl93pwfrskxeecxa4qzyfsfmsfgd3m5"
    ],
    "p2sh-segwit": "32KAK2XxwcYPc5iu3tNoXv3ksu4Gf3NsH3"
  }
}
4
  • This particular script is a multisig script, which happens to require 1 of 2 signatures to be valid Commented Mar 28, 2019 at 3:05
  • So only one of 1CmMoanE9uahYETLahBTGZSFZSQGV8ADrR and 12z2brRNYFkqJe3zP58uoiGcLqDxfk6J7r is required to unlock funds ? Commented Mar 28, 2019 at 11:37
  • user2284570, yes
    – amaclin
    Commented Mar 28, 2019 at 16:01
  • Annoying that it can't handle large hex strings since on CLI, "Argument list too long" on Linux. Commented Mar 18 at 8:49

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.