fun library for electrum. have fun!
segwiit_addr.py - Copyright (c) 2017 Pieter Wuille
In electrum console:
import sys
sys.path.append("/path/to/clone/directory")
import segwit_addr
import el
from elm import elm_nosig, elm_sig
Note that you need segwit wallet to call these functions.
- args: command_set, text, dest_addr, coeff = 10, len_offset = 100, final_amount = 1000
Please set command_set to globals()
in the console.
- Send coeff * (len(script) + len_offset) + final_amount to an address with script "OP_PUSHDATA < text > OP_DROP OP_TRUE" (script). Via P2WSH.
- From the address, send (final_amount) to dest_addr.
- args: command_set, text, dest_addr, coeff = 10, len_offset = 100, final_amount = 1000
Please set command_set to globals()
in the console.
- Create an address(tmp_addr)
- Send coeff * (len(script) + len_offset) + final_amount to an address with script "OP_PUSHDATA < text > OP_DROP OP_DUP OP_HASH160 < pubKeyHash of tmp_addr > OP_EQUALVERIFY OP_CHECKSIG" (script). Via P2WSH.
- From the address, send (final_amount) to dest_addr, using the private key of the address generated in 1.
If you install Electrum 3.3.8 via pip, you can use Electrum as a python library.
For more details, see https://github.com/spesmilo/electrum/tree/e81f4bdcd11a072e7c4f38fb1c7eec19c2f7e1a8.
See standalone.py for sample script.