* Inject properties from a witness block commitment. * @private * @param {Buffer} hash * @param {String|Buffer} flags
(hash, flags)
| 1655 | */ |
| 1656 | |
| 1657 | fromCommitment(hash, flags) { |
| 1658 | const bw = bio.write(36); |
| 1659 | |
| 1660 | bw.writeU32BE(0xaa21a9ed); |
| 1661 | bw.writeHash(hash); |
| 1662 | |
| 1663 | this.clear(); |
| 1664 | this.pushOp(opcodes.OP_RETURN); |
| 1665 | this.pushData(bw.render()); |
| 1666 | |
| 1667 | if (flags) |
| 1668 | this.pushData(flags); |
| 1669 | |
| 1670 | return this.compile(); |
| 1671 | } |
| 1672 | |
| 1673 | /** |
| 1674 | * Create a witness block commitment. |