How to use the bitbox02.BTCOutputInternal function in bitbox02

To help you get started, we’ve selected a few bitbox02 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digitalbitbox / bitbox02-firmware / py / send_message.py View on Github external
"prev_out_hash": b"11111111111111111111111111111111",
                "prev_out_index": 1,
                "prev_out_value": int(1e8 * 0.60005),
                "sequence": 0xFFFFFFFF,
                "keypath": [84 + HARDENED, 0 + HARDENED, bip44_account, 0, 0],
            },
            {
                "prev_out_hash": b"11111111111111111111111111111111",
                "prev_out_index": 1,
                "prev_out_value": int(1e8 * 0.60005),
                "sequence": 0xFFFFFFFF,
                "keypath": [84 + HARDENED, 0 + HARDENED, bip44_account, 0, 1],
            },
        ]
        outputs: List[bitbox02.BTCOutputType] = [
            bitbox02.BTCOutputInternal(
                keypath=[84 + HARDENED, 0 + HARDENED, bip44_account, 1, 0], value=int(1e8 * 1)
            ),
            bitbox02.BTCOutputExternal(
                output_type=bitbox02.btc.P2WSH,
                output_hash=b"11111111111111111111111111111111",
                value=int(1e8 * 0.2),
            ),
        ]
        sigs = self._device.btc_sign(
            bitbox02.btc.BTC,
            bitbox02.btc.SCRIPT_P2WPKH,
            bip44_account=bip44_account,
            inputs=inputs,
            outputs=outputs,
        )
        for input_index, sig in sigs: