- What is the standard Bitshares address structure and format?
- What is the format of the block header?
- What is the maximum bitshares block size?
- Are there any sharding mechanics currently deployed?
- How are SPV clients handled?
- How is time addressed in the blockchain? Is NTP used or some other protocol?
- How do new clients bootstrap into the network?
- What is the average block time?
- How is accounting addressed in Bitshares? Is it a Nxt style accounting model or like Bitcoin’s UTXO
- Are there any special affordances made for privacy?
- Does the protocol provide mechanisms for overlay protocols to interact such as OR_RETURN?
- Is this done via a gossip protocol or through a federate relay?
- Is there a specification for Bitshares scripting language? (assuming there is one)
- Is the scripting language turing complete?
- How's a block structured?
- What types of Operations are available in BitShares? And want to read Detailed Descriptions?
- What BitShares Objects names and the descriptions?
- Account Registration
- How to change a password if using a Cloud Wallet : from BitShares UI wiki
- How to create, register and upgrade an account to Lifetime Membership
- Use Ubuntu Linux
- Use OS X
- Use Windows
- Use Windows - CLI Tools
- Use Windows Subsystem for Linux
- System Requirements
- Using the API
- Access Restricted APIs
- Access the Named API via HTTP
- Available Calls
- Often Used API Calls
- Where to find BitShares APIs list in oxygen documentation
- What kinds of Object IDs and the types BitShares has?
- How an Exchange can integrate their services to the BitShares UI Wallet - Gateway Integration Requirements : from BitShares UI wiki
- How do I get the network_add_nodes command to work? Why is it so complicated?
- Is there a way to access methods which require login over HTTP?
- Is there a way to allow external program to drive cli_wallet via websocket, JSONRPC, or HTTP?
- Is there a way to generate help with parameter names and method descriptions?
- What is the meaning of a.b.c numbers?
- The answer to the previous question was really confusing. Can you make it clearer?
- What happens to the asset creation fee?
- Can I change x after creation of the asset?
- What about Parent and Child assets?
- Can I change the issuer?
- How to Create a new UIA
- How to Update/Change an existing UIA
- How to Create a MPA
- How to Create a Prediction Market
- How to Closing/Setting a Prediction Market
- How to test the publishing of price feeds
- Python Script Example
Fee Pool
Market Fee
- What happens if I enable Market fees?
- How to claim accumulated fees?
- What if two different market fees are involved in a trade?
- What are Asset Flags and Permissions?
- What are the Permissions?
- What are the Flags?
Market Pegged Assets
- How to prepare BitShares Exchange Guide (Single Node Edition)
- How to prepare Distributed Access to the BitShares Decentralised Exchange (DEX)
- How to Create a new Committee Member
- How to Propose Committee Actions
- How to Approve/Disapprove a Committee Proposal
- How Committee Proposes a Change in Fee
- How 'Multi-sugunature' works
- How to use the CLI wallet to perform confidential transfers in BitShares
- Hot to Construct Any Transaction - Manually
- How to Propose a Transaction
- Running a Local Test Network (- wiki)
- Wallet Full Nodes & Witness Nodes(- wiki)
- Connect to a Public API Node service
- How can I close the CLI client in a clean way?
- How to import a GUI-wallet account into CLI-wallet
- Why does the CLI client crash immediately when I try to run it for the first time?
- How to setup Network and Wallet Configuration
- Wallet Full Nodes & Witness Nodes (-wiki)
- Examples - connect to the network and open up a node
- How can I close the witness node in a clean way?
- How do I check whether the witness node is already synced?
- How to Change The Signing Key of a Witness
- If it seems to be unable to sync beyond a certain date?
- Is it safe to delete logs stored in witness_node_data_dirlogsp2p?
- What is the best way to interact with the witness node?
- What is the meaning of all those different text colors in the witness node console?
- Whose private key is [“BTS6MRyAjQ..”,”5KQwrPbwdL..”]? Why is it predefined ion the config.ini?
- How to Create a Worker
- How to see Proposals on the Chain
- How to Vote for a Worker
- How Workers Get Paid
- How to find how much per hour allocated for all worker
address = ‘BTS’+base58(ripemd(sha512(compressed_pub))) (checksum obviated) But addresses are not used directly, instead you have an account (that can be controlled by one or more address, pubkey or another account). https://bitshares.org/technology/dynamic-account-permissions/
struct block_header
{
digest_type digest()const;
block_id_type previous;
uint32_t block_num()const { return num_from_id(previous) + 1; }
fc::time_point_sec timestamp;
witness_id_type witness;
checksum_type transaction_merkle_root;
extensions_type extensions;
static uint32_t num_from_id(const block_id_type& id);
};
Configurable by chain parameters.
struct chain_parameters
{
/** using a smart ref breaks the circular dependency created between operations and the fee schedule */
smart_ref<fee_schedule> current_fees; ///< current schedule of fees
uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks
uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL; ///< interval in sections between blockchain maintenance events
uint8_t maintenance_skip_slots = GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS; ///< number of block_intervals to skip at maintenance time
uint32_t committee_proposal_review_period = GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC; ///< minimum time in seconds that a proposed transaction requiring committee authority may not be signed, prior to expiration
uint32_t maximum_transaction_size = GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE; ///< maximum allowable size in bytes for a transaction
uint32_t maximum_block_size = GRAPHENE_DEFAULT_MAX_BLOCK_SIZE; ///< maximum allowable size in bytes for a block
uint32_t maximum_time_until_expiration = GRAPHENE_DEFAULT_MAX_TIME_UNTIL_EXPIRATION; ///< maximum lifetime in seconds for transactions to be valid, before expiring
uint32_t maximum_proposal_lifetime = GRAPHENE_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC; ///< maximum lifetime in seconds for proposed transactions to be kept, before expiring
uint8_t maximum_asset_whitelist_authorities = GRAPHENE_DEFAULT_MAX_ASSET_WHITELIST_AUTHORITIES; ///< maximum number of accounts which an asset may list as authorities for its whitelist OR blacklist
uint8_t maximum_asset_feed_publishers = GRAPHENE_DEFAULT_MAX_ASSET_FEED_PUBLISHERS; ///< the maximum number of feed publishers for a given asset
uint16_t maximum_witness_count = GRAPHENE_DEFAULT_MAX_WITNESSES; ///< maximum number of active witnesses
uint16_t maximum_committee_count = GRAPHENE_DEFAULT_MAX_COMMITTEE; ///< maximum number of active committee_members
uint16_t maximum_authority_membership = GRAPHENE_DEFAULT_MAX_AUTHORITY_MEMBERSHIP; ///< largest number of keys/accounts an authority can have
uint16_t reserve_percent_of_fee = GRAPHENE_DEFAULT_BURN_PERCENT_OF_FEE; ///< the percentage of the network's allocation of a fee that is taken out of circulation
uint16_t network_percent_of_fee = GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE; ///< percent of transaction fees paid to network
uint16_t lifetime_referrer_percent_of_fee = GRAPHENE_DEFAULT_LIFETIME_REFERRER_PERCENT_OF_FEE; ///< percent of transaction fees paid to network
uint32_t cashback_vesting_period_seconds = GRAPHENE_DEFAULT_CASHBACK_VESTING_PERIOD_SEC; ///< time after cashback rewards are accrued before they become liquid
share_type cashback_vesting_threshold = GRAPHENE_DEFAULT_CASHBACK_VESTING_THRESHOLD; ///< the maximum cashback that can be received without vesting
bool count_non_member_votes = true; ///< set to false to restrict voting privlegages to member accounts
bool allow_non_member_whitelists = false; ///< true if non-member accounts may set whitelists and blacklists; false otherwise
share_type witness_pay_per_block = GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK; ///< CORE to be allocated to witnesses (per block)
uint32_t witness_pay_vesting_seconds = GRAPHENE_DEFAULT_WITNESS_PAY_VESTING_SECONDS; ///< vesting_seconds parameter for witness VBO's
share_type worker_budget_per_day = GRAPHENE_DEFAULT_WORKER_BUDGET_PER_DAY; ///< CORE to be allocated to workers (per day)
uint16_t max_predicate_opcode = GRAPHENE_DEFAULT_MAX_ASSERT_OPCODE; ///< predicate_opcode must be less than this number
share_type fee_liquidation_threshold = GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD; ///< value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated
uint16_t accounts_per_fee_scale = GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE; ///< number of accounts between fee scalings
uint8_t account_fee_scale_bitshifts = GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS; ///< number of times to left bitshift account registration fee at each scaling
uint8_t max_authority_depth = GRAPHENE_MAX_SIG_CHECK_DEPTH;
extensions_type extensions;
/** defined in fee_schedule.cpp */
void validate()const;
};
No
No SPV clients at the moment, each full node can expose a public websocket/http api.
NTP
Trusted seed nodes. Knowledge of initial witness keys.
Current 3 seconds, configurable by chain parameters.
Q. How is accounting addressed in Bitshares? Is it a Nxt style accounting model or like Bitcoin’s UTXO
Each account has a finite set of balances, one for each asset type.
…such as using CoinJoin or a ZK-SNARK based privacy scheme like Zerocash? If mixing is integrated at the protocl level are you using the standards set forth by the BNMCKF Mixcoin proposal
Confidential values (same as blockstream elements using the same secp256k1-zkp lib) + stealth addresses. https://github.com/Ele
Yes, using a custom_operation.
struct custom_operation : public base_operation
{
struct fee_parameters_type {
uint64_t fee = GRAPHENE_BLOCKCHAIN_PRECISION;
uint32_t price_per_kbyte = 10;
};
asset fee;
account_id_type payer;
flat_set<account_id_type> required_auths;
uint16_t id = 0;
vector<char> data;
account_id_type fee_payer()const { return payer; }
void validate()const;
share_type calculate_fee(const fee_parameters_type& k)const;
};
Each node immediately broadcast the data it receives to its peers after validating it https://github.com/cryptonomex/graphene/blob/master/libraries/p2p/design.md
:: Blocks => transactions => operations => objects.
The blockchain state is contained in an object database that is affected by the operations. Example objects::
account_object
asset_object
account_balance_object
...
class account_balance_object : public abstract_object<account_balance_object>
{
public:
static const uint8_t space_id = implementation_ids;
static const uint8_t type_id = impl_account_balance_object_type;
account_id_type owner;
asset_id_type asset_type;
share_type balance;
asset get_balance()const { return asset(balance, asset_type); }
void adjust_balance(const asset& delta);
};
Same as Bitcoin, secp256k1.
No scripting
No scripting
You need to follow the instructions in the "Accessing restricted API's" section to allow a username/password access to the network_node API. Then you need to pass the username/password to the cli_wallet on the command line or in a config file.
It's set up this way so that the default configuration is secure even if the RPC port is publicly accessible. It's fine if your witness_node allows the general public to query the database or broadcast transactions (in fact, this is how the hosted web UI works). It's less fine if your witness_node allows the general public to control which p2p nodes it's connecting to. Therefore the API to add p2p connections needs to be set up with proper access contro
No. Login is inherently a stateful process (logging in changes what the server will do for certain requests, that's kind of the point of having it). If you need to track state across HTTP RPC calls, you must maintain a session across multiple connections. This is a famous source of security vulnerabilities for HTTP applications. Additionally, HTTP is not really designed for "server push" notifications, and we would have to figure out a way to queue notifications for a polling client.
Websockets solves all these problems. If you need to access Graphene's stateful methods, you need to use Websockets.
Yes. External programs may connect to the CLI wallet and make its calls over a websockets API. To do this, run the wallet in server mode, i.e. cli_wallet -s "127.0.0.1:9999" and then have the external program connect to it over the specified port (in this example, port 9999).
Yes. Documentation of the code base, including APIs, can be generated using Doxygen. Simply run doxygen
in this directory.
If both Doxygen and perl are available in your build environment, the CLI wallet's help
and gethelp
commands will display help generated from the doxygen documentation.
If your CLI wallet's help command displays descriptions without parameter names like signed_transaction transfer(string, string, string, string, string, bool)
it means CMake was unable to find Doxygen or perl during configuration. If found, the output should look like this: signed_transaction transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast)
The first number specifies the space. Space 1 is for protocol objects, 2 is for implementation objects. Protocol space objects can appear on the wire, for example in the binary form of transactions. Implementation space objects cannot appear on the wire and solely exist for implementation purposes, such as optimization or internal bookkeeping.
The second number specifies the type. The type of the object determines what fields it has. For a complete list of type ID's, see enum object_type and enum impl_object_type in types.hpp.
The third number specifies the instance. The instance of the object is different for each individual object.
All account ID's are of the form 1.2.x. If you were the 9735th account to be registered, your account's ID will be 1.2.9735. Account 0 is special (it's the "committee account," which is controlled by the committee members and has a few abilities and restrictions other accounts do not).
All asset ID's are of the form 1.3.x. If you were the 29th asset to be registered, your asset's ID will be 1.3.29. Asset 0 is special (it's BTS, which is considered the "core asset").
The first and second number together identify the kind of thing you're talking about (1.2 for accounts, 1.3 for assets). The third number identifies the particular thing.
50% of the asset creation fee are used to pre-fill the assets fee pool. From the other 50%, 20% go to the network and 80% go to the referral program. This means, that if you are a life-time member, you get back 40% of the asset creation fee after the vesting period (currently 90 days).
The following parameters can be changed after creation:
- Issuer
- UIA-Options:
- Max Supply
- Market Fee
- Permissions (disable only/nor re-enable)
- Flags (if permissions allow it)
- Core exchange rate
- White/Black Listing
- Description
- MPG-Options:
- Feed Life Time
- Minimum Feeds
- Force Settlement Offset/Delay/Volume
Things that cannot be changes:
- Symbol
- Precision
A parent/child relation ship for assets can be represented by the name of the symbol, e.g.:
PARENT.child
can only be created by the issuer of PARENT
and no one else.
The current issue of an asset may transfer ownership of the asset to someone else by changing the issuer in the asset’s settings.
The fee pool allows participants in the network to deal with assets and pay for the transaction fees without the need to hold BTS. Any transaction fee can be paid by paying any asset that has a core exchange rate (i.e. a price) at which the asset can be exchange implicitly into BTS to cover the network fee. If the asset’s fee pool is funded, the fees can be payed in the native UIA instead of BTS.
Note : The core exchange rate at which a fee can be exchanged into BTS may differ from the actual market valuation of the asset. A user, thus, may pay a premium or spare funds by paying in BTS.
Warning : Make sure your core exchange rate is higher than the lowest ask, otherwise, people will buy your token from the market and drain your fee pool via implicit abitrage.
It is the task of the issuer to keep the fee pool funded and the core exchange rate updated unless he wants the owner of his asset to be required to hold BTS for the fee.
Open up the issuer’s account, click the assets tab and open up the dialog to change the asset. There will be a fee pool tab that allows you to fund the fee pool and claim the accumulated fees!
If an order is created and paid in a non-BTS asset, the fee is implicitly exchange into BTS to pay the network fee. However, if the order is canceled, 90% of the fee will be returned as BTS. The result is, that if the core exchange rate is lower than the highest bid, people can simply buy your token from the market, and exchange them implicitly with the fee pool by creating and canceling an order. This will deplete the fee pool and leave the issuer with his tokens at a slight loss (depending on the offset of the core exchange rate). For this reason, we recommend to use a core exchange that is slightly higher than the market price of your asset. As a consequence, paying fees in BTS should always be cheaper.
If Market Fees of a UIA are turned on, fees have to be payed for each market transaction. This means, that market fees only apply to filled orders!
The percentage of market fees that are applied can be defined and changed by the issuer and any fee generated that way will be accumulated for each asset only to be claimed by the issuer.
If the Market Fee is set to 1%, the issuer will earn 1% of market volume as profit. These profits are accumulated for each UIA and can be withdrawn by the issuer.
Open up the issuer’s account, click the assets tab and open up the dialog to change the asset. There will be a fee pool tab that allows you to fund the fee pool and claim the accumulated fees!
Suppose, I set the market fee for MyUIA market at 0.1%. and the market fee for YourUIA market at 0.3%.
In BitShares, You pay the fee upon receiving an asset. Hence, one side will pay 0.3% the other will pay 0.1%.
When an asset is creatd, the issuer can set any combination of flags/permissions. Flags are set in stone unless there is permission to edit. Once a permission to edit is revoked, flags are permanent, and can never be modified again.
- Enable market fee
- Require holders to be white-listed
- Issuer may transfer asset back to himself
- Issuer must approve all transfers
- Disable confidential transactions
flag | |
---|---|
charge_market_fee | an issuer-specified percentage of all market trades in this asset is paid to the issuer |
white_list | accounts must be white-listed in order to hold this asset |
override_authority | issuer may transfer asset back to himself |
transfer_restricted | require the issuer to be one party to every transfer |
disable_force_settle | disable force settling |
global_settle | (only for bitassets) allows bitasset issuer to force a global settling - this may be set in permissions, but should not be set as flag unless, for instance, a prediction market has to be resolved. If this flag has been enabled, no further shares can be borrowed! |
disable_confidential | allow the asset to be used with confidential transactions |
witness_fed_asset | allow the asset to be fed by witnesses |
committee_fed_asset | allow the asset to be fed by the committee |
Yes!
parameter | |
---|---|
feed_lifetime_sec | The lifetime of a feed. After this time (in seconds) a feed is no longer considered valid. |
minimum_feeds | The number of feeds required for a market to become (and stay) active. |
force_settlement_delay_sec | The delay between requesting a settlement and actual execution of settlement (in seconds) |
force_settlement_offset_percent | A percentage offset from the price feed for settlement (100% = 10000) |
maximum_force_settlement_volume | Maximum percentage of the supply that can be settled per day (100% = 10000) |
short_backing_asset | The asset that has to be used to back this asset (when borrowing) |
Q. Public & private testnet differences What is the difference between public and private testnet?**
Not much. The biggest difference is that public testnet are intended for wider audience and has fixed (not easy to change parameters), while private testnets can be setup with arbitrary settings
In Windows closing the whole window produces a nasty exception. In Windows you can try ctrl-d which stops the process but stil produces a nasty exception.
The CLI client is unable to run on its own, i.e. without being connected to the witness node (via a web socket connection). So to successfully run the CLI client you need to do this:
- make sure you have this entry uncommented in the witness_node_data_dir/config.ini file rpc-endpoint = 127.0.0.1:8090
- before you start the CLI client, you need to start the witness node (and wait a while till it’s up and running)
In windows use ctrl-c.
Run the info command in the CLI client and check the head_block_age value.
You should always make sure you use the newest build available here_ as earlier releases will get stuck due to hard-forks.
Yes, but
- they’re rotated automatically after 24 hours anyway
- if you don’t use them you should probably modify config.ini so they aren’t written to disk in the first place.
The only way you can interact with the witness node is through the CLI client by using its API. You can also use the GUI (i.e. the light client).
In the GUI, open the Side Menu and go to [Settings] - [Nodes]. There are TABs (AVAILABLE, HIDDEN, and PERSONAL). Click PERSONAL and click [ADD NODE]. A form opens and type a Node name and an Address and Click [CONFIRM].
color | |
---|---|
green | debug |
white | info/default |
yellow/brown | warning |
red | error |
blue | some kind of info, I don’t know |
Related source files are in libraries/fc/include/fc/log/ and libraries/fc/src/log/.
It’s a shared key for some special purpose. But I don’t remember what it is. If I remember BM or someone else has ever explained it in the forum, but I can’t find the post right now. Just let it be there. I think if you comment it out, it will appear again automatically, it’s generated by the code of witness_node.