Python BitShares

Welcome to pybitshares’s documentation!

BitShares is a blockchain-based autonomous company (i.e. a DAC) that offers decentralized exchanging as well as sophisticated financial instruments as products.

It is based on Graphene (tm), a blockchain technology stack (i.e. software) that allows for fast transactions and ascalable blockchain solution. In case of BitShares, it comes with decentralized trading of assets as well as customized on-chain smart contracts.

About this Library

The purpose of pybitshares is to simplify development of products and services that use the BitShares blockchain. It comes with

  • it’s own (bip32-encrypted) wallet
  • RPC interface for the Blockchain backend
  • JSON-based blockchain objects (accounts, blocks, prices, markets, etc)
  • a simple to use yet powerful API
  • transaction construction and signing
  • push notification API
  • and more



All methods that construct and sign a transaction can be given

the account= parameter to identify the user that is going to affected by this transaction, e.g.:

  • the source account in a transfer
  • the accout that buys/sells an asset in the exchange
  • the account whos collateral will be modified

Important, If no account is given, then the default_account according to the settings in config is used instead.

Create a wallet

from bitshares import BitShares
bitshares = BitShares()

Unlock the wallet for a transfer

from bitshares import BitShares
bitshares = BitShares()
bitshares.transfer("<to>", "<amount>", "<asset>", "[<memo>]", account="<from>")

Monitor the BitShares Blockchain operation-wise

from bitshares.blockchain import Blockchain
blockchain = Blockchain()
for op in Blockchain.ops():

Obtain the content of one block

from bitshares.block import Block

Obtain Account balance, open orders and history

from bitshares.account import Account
account = Account("init0")
for h in account.history():

Adjust collateral

from bitshares.dex import Dex
dex = Dex()
dex.adjust_collateral_ratio("SILVER", 3.5)

Developers and Community

Discussions around development and use of this library can be found in a [dedicated Telegram Channel](

Indices and tables