Categories
Bitcoin Cryptocurrency Mastering Development

Retrieve address when create a channel lightning network

I have two nodes in regtest. the first one is: $ l1-cli getinfo { "id": "02c3f99e70c8da59e428dd119d36c0a1317e5cd85218a760355b5f9b4f822f6109", "alias": "ALICE", "color": "ddff06", "num_peers": 0, "num_pending_channels": 0, "num_active_channels": 0, "num_inactive_channels": 0, "address": [], "binding": [ { "type": "ipv4", "address": "127.0.0.1", "port": 6060 } ], "version": "v0.8.2-269-g6014644", "blockheight": 1, "network": "regtest", "msatoshi_fees_collected": 0, "fees_collected_msat": "0msat", "lightning-dir": "/tmp/l1-regtest/regtest" } $ […]

Categories
Bitcoin Cryptocurrency Mastering Development

OP_CHECKLOCKTIMEVERIFY non-mandatory-script-verify-flag

I have two addresses in my regtest. A address is the P2SH-P2PKH. (sender) B address is the P2SH-P2PKH, but with OP_CHECKLOCKTIMEVERIFY block height 201. (receiver) My regtest doesen’t have any block before it, Then I create some blocks (101) for A and transfer some bitcoins to B. A Wants that the UTXO is available after […]

Categories
Bitcoin Cryptocurrency Mastering Development

Limitations in P2WSH custom script

I did a stupid custom validation script in P2SH where after check signature, check if OP_3 is equal of OP_3. Now I want to move the same logic in P2WSH multisignatue 1-3. it’s my script 6C512103dee28d1db5d8b92181ac5baa04c28c01d2b14d19a3c6adaf7bd3430d0c6c8146210343a6f95f841b48ba2b97822a546976aea951e5a1f1c0a10078fdbbded165dbe32103f2f0a25413bb97af3b2ef21694fab820146e2e1bed41b6528a9ce6dd218d9bd353AE755387 bitcoin-cli decodescript 6C512103dee28d1db5d8b92181ac5baa04c28c01d2b14d19a3c6adaf7bd3430d0c6c8146210343a6f95f841b48ba2b97822a546976aea951e5a1f1c0a10078fdbbded165dbe32103f2f0a25413bb97af3b2ef21694fab820146e2e1bed41b6528a9ce6dd218d9bd353AE755387 { “asm”: “OP_FROMALTSTACK 1 03dee28d1db5d8b92181ac5baa04c28c01d2b14d19a3c6adaf7bd3430d0c6c8146 0343a6f95f841b48ba2b97822a546976aea951e5a1f1c0a10078fdbbded165dbe3 03f2f0a25413bb97af3b2ef21694fab820146e2e1bed41b6528a9ce6dd218d9bd3 3 OP_CHECKMULTISIG OP_DROP 3 OP_EQUAL”, “type”: “nonstandard”, “p2sh”: “2N87Vic9xVhe3k7TEQ1Jj512jNWfwyFZTd2”, […]

Categories
Bitcoin Cryptocurrency Development Python

Decoding hex scriptsig in Python

Running decodescript on d1a076722d11ddfd0fadb96d6d960b8b2ad6c6369570cd00df70a801a6be9e44 is returning: { “asm”: “0 30440220278ee027abaf4720f580ce469139d75e330e120f91ff52b2c73955a712b96f3902204f11b7b1541dee5497cffd50291347b796e44ab1b6dac845d43a7185fdda184901 3045022100c3602c2872248e73f543fbf21ddc9fa3b73052261f619452fd5254852c9ea55102202c1323830f38a6fe149e0eccb18f92eba962165733285812deb96bcb8482de5d01 30450221008caaadf9b887828d02911ff22df335606c372f968d5c2ea0fa2f8c1a083fe5f502204c55eb85c0f06e10d488d7643a5c571bbabdeb935acc917836d44e755db6b1f601 532102939a016f9a4cfc4c73ba395c2baf16382a4de078dadf2bafaaac6846d786ed392102c7cf0bd62fb500d8f6ed39a46c7e72dc1b5185754e1a48d25a22195f113b35d8210306179c491a25d6db330a3a3e3ba0788b3ccea45aebfa2a06fc114787aadc01532103b8a79bd499afbc0f4b68e4c0e175176a013b1e2143da6ec95772add5c6728d6d2103bec7b18285d7af85b4f2c0936a106b746eaad14071f41788257fdffeb2e68e9a2103e4fda639ffcf2d996dc372db5eda18857afdd21054009d65ddd17ce96d5feed22103f5d1065abd2a8b5adc6ecda48712d2a572a24130b786f538629ff834b298379857ae”, “type”: “nonstandard”, “p2sh”: “32QZxW8qHSufifvr5UzXpzGG6jdcgnTCSF”, “segwit”: { “asm”: “0 59d0d03149e611e8f8e879ab7c1133c99091ec09758ed29a9111341e424d9891”, “hex”: “002059d0d03149e611e8f8e879ab7c1133c99091ec09758ed29a9111341e424d9891”, “reqSigs”: 1, “type”: “witness_v0_scripthash”, “addresses”: [ “bc1qt8gdqv2fucg7378g0x4hcyfnexgfrmqfwk8d9x53zy6pusjdnzgsdvlm7s” ], “p2sh-segwit”: “36sk1CLrrv8HXgE1d1CKkNkwnK2tWKeWSL” } } The original Hex: 004730440220278ee027abaf4720f580ce469139d75e330e120f91ff52b2c73955a712b96f3902204f11b7b1541dee5497cffd50291347b796e44ab1b6dac845d43a7185fdda184901483045022100c3602c2872248e73f543fbf21ddc9fa3b73052261f619452fd5254852c9ea55102202c1323830f38a6fe149e0eccb18f92eba962165733285812deb96bcb8482de5d014830450221008caaadf9b887828d02911ff22df335606c372f968d5c2ea0fa2f8c1a083fe5f502204c55eb85c0f06e10d488d7643a5c571bbabdeb935acc917836d44e755db6b1f6014cf1532102939a016f9a4cfc4c73ba395c2baf16382a4de078dadf2bafaaac6846d786ed392102c7cf0bd62fb500d8f6ed39a46c7e72dc1b5185754e1a48d25a22195f113b35d8210306179c491a25d6db330a3a3e3ba0788b3ccea45aebfa2a06fc114787aadc01532103b8a79bd499afbc0f4b68e4c0e175176a013b1e2143da6ec95772add5c6728d6d2103bec7b18285d7af85b4f2c0936a106b746eaad14071f41788257fdffeb2e68e9a2103e4fda639ffcf2d996dc372db5eda18857afdd21054009d65ddd17ce96d5feed22103f5d1065abd2a8b5adc6ecda48712d2a572a24130b786f538629ff834b298379857ae Blockstream explorer is returning the script in form of OP_CODEs, my question is, is there […]