GithubHelp home page GithubHelp logo

ascribe / transactions Goto Github PK

View Code? Open in Web Editor NEW
115.0 12.0 20.0 124 KB

๐Ÿ“Ÿ transactions: Bitcoin for humans

License: Apache License 2.0

Python 99.58% Dockerfile 0.42%
bitcoin cryptocurrency python

transactions's Introduction

https://readthedocs.org/projects/transactions/badge/?version=latest

transactions: Bitcoin for Humans

transactions is a small python library to easily create and push transactions to the bitcoin network.

Installation

$ pip install transactions

Examples

Assuming the following cast of characters:

>>> alice = 'mhyCaF2HFk7CVwKmyQ8TahgVdjnHSr1pTv'
>>> bob = 'mqXz83H4LCxjf2ie8hYNsTRByvtfV43Pa7'
>>> carol = 'mtWg6ccLiZWw2Et7E5UqmHsYgrAi5wqiov'

Moving 10000 satoshis from alice to bob:

>>> from transactions import Transactions
>>> transactions = Transactions(testnet=True)
>>> tx = transactions.create(alice, (bob, 10000))
>>> tx_signed = transactions.sign(tx, 'alice master secret')
>>> transactions.push(tx_signed)

Moving 600 satoshis from bob to carol with a custom op_return:

>>> tx = transactions.create(bob, (carol, 600), op_return='HELLOFROMASCRIBE')
>>> tx_signed = transactions.sign(tx, 'bob master secret')
>>> transactions.push(tx_signed)

Check it out fbbd6407b8fc73169918b2fce7f07aff6a486a241c253f0f8eeb942937fbb970

With transactions all amounts are in satoshi and we currently only support BIP32 wallets (hierarchical deterministic wallets, aka "HD Wallets").

Documentation

https://transactions.readthedocs.org/

Contributing

Pull requests, feedback, and suggestions are welcome. Issues and pull requests are handled via github.

Background

This was developed by ascribe GmbH as part of the overall ascribe technology stack. https://www.ascribe.io

Copyright

This code is ยฉ 2015 ascribe GmbH.

Licensed under the Apache License, Version 2.0.

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.