GithubHelp home page GithubHelp logo

aidatorajiro / elelib Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 44 KB

fun library for electrum. have fun!

License: MIT License

Python 100.00%
blockchain bitcoin electrum p2wsh python library fun p2wpkh

elelib's Introduction

Electrum fun library

fun library for electrum. have fun!

Library used

segwiit_addr.py - Copyright (c) 2017 Pieter Wuille

how to use

In electrum console:

import sys
sys.path.append("/path/to/clone/directory")
import segwit_addr
import el
from elm import elm_nosig, elm_sig

API reference

Note that you need segwit wallet to call these functions.

elm_nosig

  • args: command_set, text, dest_addr, coeff = 10, len_offset = 100, final_amount = 1000

Please set command_set to globals() in the console.

  1. Send coeff * (len(script) + len_offset) + final_amount to an address with script "OP_PUSHDATA < text > OP_DROP OP_TRUE" (script). Via P2WSH.
  2. From the address, send (final_amount) to dest_addr.

elm_sig

  • args: command_set, text, dest_addr, coeff = 10, len_offset = 100, final_amount = 1000

Please set command_set to globals() in the console.

  1. Create an address(tmp_addr)
  2. 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.
  3. From the address, send (final_amount) to dest_addr, using the private key of the address generated in 1.

Standalone version

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.

elelib's People

Contributors

aidatorajiro avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.