Code Monkey home page Code Monkey logo

beet's Introduction

BitShares

BitShares is a software platform designed to help coordinate voluntary free market operations amongst a set of social actors.

These social actors together maintain a replicated deterministic state machine which defines the state of a free market. This state machine unambigiously defines the ownership of resources amongst market participants, the rules by which resources are reallocated through market operations, and the history of all market operations. Social actors are free to voluntarily enter and exit the market as desired.

Replicas of the state machine are kept consistent using the Delegated Proof-of-Stake distributed consensus protocol, which depends on market operations by a special class of market participants colloquially known as shareholders. Resource ownership is secured using digital signatures and inputs to the state machine are shared amongst actors using a peer-to-peer mesh network.

Features

The system is designed to ensure the following properties:

  • Fault-Tolerance: the market should be resilient to bad actors
  • Immutability: the historical intent of all market participants should be preserved
  • Transparency: any actor can inspect the market to verify that it is operating correctly
  • Censorship Resistance: no actor can be kept from performing valid market operations
  • Flexibility: the rules of the market should be able to change given sufficient shareholder approval
  • Self-Sustainability: the market should be be able to fund its own continued operation

Additional information is available at BitShares.org and the BitShares Wiki. Community discussion occurs at BitSharesTalk.org.

Building

Different platforms have different build instructions:

Using the RPC server

For many applications, it is useful to execute BitShares commands from scripts. The BitShares client includes RPC server functionality to allow programs to submit JSON-formatted commands and retrieve JSON-formatted results over an HTTP connection. To enable the RPC server, you can edit the rpc section of config.json as follows:

  "rpc": {
    "enable": true,
    "rpc_user": "USERNAME",
    "rpc_password": "PASSWORD",
    "rpc_endpoint": "127.0.0.1:1775",
    "httpd_endpoint": "127.0.0.1:1776",

Here, USERNAME and PASSWORD are authentication credentials which must be presented by a client to gain access to the RPC interface. These parameters may also be specified on the command line, but this is not recommended because some popular multi-user operating systems (Linux in particular) allow command line parameters of running programs to be visible to all users.

After editing the configuration file and (re)starting the BitShares client, you can use any HTTP client to POST a JSON object and read the JSON response. Here is an example using the popular curl command line HTTP client:

curl --user USERNAME:PASSWORD http://127.0.0.1:1776/rpc -X POST -H 'Content-Type: application/json' -d '{"method" : "blockchain_get_account", "params" : ["dev0.theoretical"], "id" : 1}'

The POST request returns a JSON result like this (some data elided for brevity):

{"id":1,"result":{"id":31427,"name":"dev0.theoretical","public_data":{"version":"v0.4.27.1"},"owner_key":"BTS75vj8aaDWFwg7Wd6WinAAqVddUcSRJ1hSMDNayLAbCuxsmoQTf", ...},"meta_data":{"type":"public_account","data":""}}}

Since HTTP basic authentication is used, the authentication credentials are sent over the socket in unencrypted plaintext. For this reason, binding to an interface other than localhost in the configuration file is not recommended. If you wish to access the RPC interface from a remote system, you should establish a secure connection using SSH port forwarding (the -L option in OpenSSH) or a reverse proxy SSL/TLS tunnel (typically supported by general-purpose webservers such as nginx).

Please keep in mind that anyone able to connect to the RPC socket with the correct username and password will be able to access all funds, accounts and private keys in any open wallet (including wallets opened manually or by another RPC client connected to the same bitshares_client instance). Thus, your security procedures should protect the username, password, and socket accordingly (including config.json since it contains the username and password)!

Contributing

The source code can always be found at the BitShares GitHub Repository. There are four main branches:

  • master - official BitShares releases are tagged from here; this should only change for a new release
  • bitshares - updates to BitShares are staged here in preparation for the next official release
  • develop - all new development happens here; this is what is used for internal BitShares XTS test networks
  • toolkit - this is the most recent common ancestor between master and develop; forks of BitShares should base from here

Some technical documentation is available at the BitShares GitHub Wiki.

Support

Bugs can be reported directly to the BitShares Issue Tracker.

Technical support can be obtained from the BitSharesTalk Technical Support Forum.

License

The BitShares source code is in the public domain under the Unlicense. See the LICENSE for more information.

beet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beet's Issues

On-chain blacklist

The reference UI always has the problem that it can't keep up with the scammers. Should we have an on-chain blacklist?

Beet load time

Describe the bug
Load time for the app was roughly 75 seconds.
After it loaded, it flashed, followed by another window.
Maybe not an error (assuming flash is seeking a wallet) but the load time is notable.

To Reproduce
Steps to reproduce the behavior:

  1. Downloaded, installed Beet. Reboot the system. See Gif for re-loading of Beet flash

Expected behavior

  1. A faster load of the app
  2. No flash with a second window.
  • Windows OS 8.1
  • Browser Opera
    beet_load_capture

Client/Server Multisig Setup with Beet

Is your feature request related to a problem? Please describe.
I want to be able to setup multisig system that consists of a client (beet) and a server. Both need to sign a transaction.

Describe the solution you'd like
The process I have in mind looks like this:

  1. The server creates a raw (unsigned transaction)
  2. Sever sends it to the client
  3. Clients signs the raw transaction (one out of two require signatures) using beet
  4. Client sends the partially signed tx to server
  5. Server adds the second signature and broadcasts the transaction

Describe alternatives you've considered
The alternative would be to do it the other way round and let the server sign first. The difference should be minimal as you just have to keep track of a potentially existing signature in the to-be-signed transaction.

Additional context
We would like to be able to improve security by removing the potential of the server-installed private key to do anything without the approval of a local signature.

Trollbox wrong text submitted

Describe the bug
No matter what I wrote the message was always 'text'.

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://www.bitsharesvotes.com/
  2. Click on trollbox
  3. Wrote text
  4. Submitted it

Expected behavior
The text that I wrote appear as new message

Actual behavior
The text in new message was 'text'

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubunut 18.04
  • Browser: Chromium Browser
  • Version 73.0.3683.75

Relinking when Beet loosing the identityhash

Ideally, the developer must only call beet.get and beet-js recovers by itself unless a severe error occurs.

Assume that Beet and some app have linked, now user re-installs Beet and visits the site again. Site wants to authenticate using the existing link, but Beet does not know it.

Since the identityhash is deterministic, Beet calculates the idendityhash for all imported accounts that match the requested connection details. Two cases:
a) there is match with the client identityhash, user sees a popup in Beet, possibly with a refined message to notify the user of this anomaly, and connection is re-linked. Nothing changes for the developer on the client side
b) there is no match with the client idendityhash. Beet sends an error to the client, and the client has two choices: either destroy the local identityhash and re-link (can happen automatically), or notify the user there and give him a chance to import the correct keys in Beet

Maintainability request: Store Naming

Since Store will be split into multiple modules for maintainability, what was originally the complete BeetStore will now host wallet related stuff only thus should be renamed to WalletStore in the codebase.

UX/UI Flow

  • Wallet selecting
    image
    Enter action: Select wallet and jump to password field

  • Enter password
    image
    Enter action: Euqal to clicking Unlock

  • In general: If there is only one item in combobox, preselect

Planned Development #3: Implement origin verification and authorisation persistence

When an app connects to Beet for the first time , it does so over an unencypted method call.

Upon connection, client lib provides a unique PIN visible to the user in the browser/app as well as in the Approval of connection request inside Beet.

User must verify the same PIN is visible prior to approving as well as choose an account (see #10 ) to use with the app. Once approved, client lib and Beet proceed to a key exchange and use a HOTP implementation to identify all subsequent requests & responses.

Companion asks to allow receive identity without being asked for it

this.holder.btscompanion.connect('BitShares Voting Widget').then(connected => {
                if(connected){
                    //this.btscompanion = btscompanion; Unbind from window and bind to your own state var to avoid extension hijacking
                    //window.btscompanion = null;
                    window.btscompanion.requestSignature({op_type: "transfer",op_data: {
                        "amount": {
                            "amount": 100000,
                            "asset_id": "1.3.0"
                        },
                        "extensions": [],
                        "fee": {
                            "amount": 10420,
                            "asset_id": "1.3.0"
                        },
                        "from": "1.2.386825",
                        "to": "1.2.386826"
                    }});

                }
            })

Executing the above will also trigger to access account ID
image

This popup should only appear when accountId is requested

Broadcast successfull notification

I imagine a popover on the bottom above the footer saying

Transaction <type> successfully broadcast
<link to explorer>

That disappears after 5 seconds

Allow anonymous signing

When the user wants to update e.g. votes, the voting widget does not need to know the identiy stored in companion.

For that purpose a placeholder account id can be used, that the companion fills in when receiving a transaction, e.g. 1.2.0 (no one will sign as committee using companion).

Cannot copy-paste private keys on beet

Describe the bug
Cannot copy-paste my private keys into beet app.

Looks like hotkeys doesn't work when cursor is inside fields. I cannot even copy my username using cmd+a (after I typed it manually)

Desktop (please complete the following information):

  • OS: OSX (.dmg)
  • Beet 0.4.2

Refine Account Details Request

When opened and at least two accounts present and the app requests "ANY" chain, user can't confirm the default selection
image

Linked should be shown also in selected item (in the screen the WhaleShares account is already linked)

Planned Development #7: Integrate node-checking & selection algorithm

This is to ensure we do our best to stay connected to the best possible node.

Especially important on first use as we want the wizard to be very simple and avoid adding node-selection until wallet has been created and user is at Dashboard screen.

@sschiessl-bcp How easy would it be to port your node-selection code over?

This also solves the occasional hardcoded node failure as in #6.

Planned Development #6: Modify Initial Approval

Right now, the initial connection does no checks because each API action call is explicitly verified.

Upon completion of #9. Initial connection will request approval, connection of specific account and handshake but return no personal data. That will be left to the API calls.

This also modifies behaviour as discussed in #2.

Signed Message Format

Describe the bug
The signed message from beet is awkward. It appears to be key, value pairs, but really is not:

["from", "xeroc", "BTS5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE", "time", "Fri, 29 Mar 2019 12:12:43 GMT", "text", "Login at bitshares.org on 2019/03/29 @ 12:12:40 UTC"]

The additional pubkey has no name.

To Reproduce
use the example in examples.

Expected behavior
I want the array to declare a name for the public key. E.g.

  • from: xeroc
  • pubkey: BTS....
  • ...

Additional context
Additionally, I believe that timestamps are easier to parse than human readable strings. Ultimately, no one will probably ever look into those messages anyways.

My particular use case is for login into a website using beet's signed message.

Step 2: Checkbox for .BIN import

Is your feature request related to a problem? Please describe.
Consider a Local Wallet check box on Step 2 allowing .BIN import from a back up or storage device.

Describe the solution you'd like
Ability to utilize Beet for both local and cloud wallet users.

UI and api version

version call returns ui and api version. Beet and client with same api level are considered compatible.

separation of account adding process from creation of Beet wallet

Ideally the user would first create a Beet wallet, and then go about adding accounts:

  1. For creating a Beet wallet, I would suggest letting the user enter the wallet name and password on the same screen. Perhaps encourage a backup after the wallet is created. Then you can prompt user to add their first account.

  2. For adding accounts, it would be helpful to have an "Add Account" title/header at the top. Also, I think you can let the user enter the blockchain and other info on the same screen.

By the way, is it really necessary (or even useful) to enter account name? Is it not the case that only the private keys are necessary (aside from bitshares cloud wallet) and the account name could then be be looked up?

[kennybll][2] Fix and test eosjs transfer

See #91

To test the transfer open the corresponding example in beet-js while running beet.
https://github.com/bitshares/beet-js/blob/90b8ad8eb472af96ab59fc48e5785c9844343180/examples/transfer/eos.html#L4

The code in beet is found here:

async transfer(key, from, to, amount, memo = null) {

I want to be able to support the transfer of any EOSIO token, and the action I implemented is probably wrong and only for EOS.

Owner key must not be mandatory

When creating an account the owner key must be entered, otherwise an exception is thrown after entering wallet password.

Furthermore, the default question should be to collect active and memo. The field to enter owner key could appear when a small button "Include owner key" or similar is clicked.

Improve navigation

Of the four icons at the bottom, only two have a readily apparent purpose (gear and lock). Of the other two, one is unnecessary and the other is misplaced. I would put the settings gear and lock icons in the upper right. I would remove the graph icon since the user can just close the settings (with a "Back" or "Return" button) to go back to the main screen (where the accounts are listed). And finally, you can have a [+] add account button next to the accounts drop down list.

Alternatively, you can have tabs at the top where "Accounts" is one tab and "Tools/Settings" is another, and you can add additional tabs if/when needed in the future. Under settings you can have sub-items such as below.

Tab 1: Accounts
Tab 2: Tools/Settings

  • Linked dApps
  • Wallet back-up
  • Wallet Timeout (hint hint)
  • etc...

Min/Max/Close/tray behavior

Describe the bug

  1. Multiple Beet icons in the tray after first opening of Beet.
  2. Clicking the maximum button tabs from right to left; clicking max again tabs left to right.
  3. Clicking the minimum button reduces to the tray without the running in the background notification.
  4. Clicking the "X" reduces to the tray; does not close the program. User must go to the tray, right click on the Beet icon, click quit to quit the program.

To Reproduce
Steps to reproduce the behavior:

  1. Open Beet
  2. Click to open the tray noting multiple Beet icons
  3. Open Beet; click maximum window noting tabulation to the left; click max again noting tabulation to
    the right.
  4. Click minimize window noting it reduces to the tray without the initial running in the background
    notification.
  5. Click the "X" to end and close Beet noting that it did not close, but minimized to the tray. Clicking on
    the Beet icon in the tray merely re-opens the app. User must right mouse click on the Beet icon in the
    tray then click quit to exit the app.

Expected behavior

  1. Clicking maximum to maximize the window, not tab
  2. Clicking minimum button to minimize to the taskbar; if reduced to the tray, a notification would help
    inform the user.
  3. Clicking the "X" to end and close Beet.

Screenshots
See Gif

Desktop (please complete the following information):

  • OS: 8.1
  • Browser Opera
    beet_window_capture

[40] Initial development (for auditing purposes)

Tasks & work prior to UI worker inclusion.

  1. Initial research & planning
  2. Development stack identification
  3. App architecture planning
  4. Dev stack and build process setup
  5. Alpha functionality goals identified
  6. Initial UX/UI design
  7. Development of alpha version
  8. Development of alpha version of beet-js client library
  9. Alpha version testing
  10. Voting widget integration
  11. Alpha version distribution build
  12. Future roadmap creation

Closed via e520d25

Restore backup flow

Current routing is to / after restoring, which causes user to enter password again.

Routing should be to /dashboard after restoring, but getting the error

2019-04-13 23:06:16 GMT+2 - [ERROR] TypeError: Cannot read property 'chain' of undefined
    at VueComponent.selectedChain (/home/schiessl/Projekte/BitShares/beet/src/components/dashboard.vue:116:41)

HTLC on bitcoin

Is your feature request related to a problem? Please describe.
I want to be able to setup an HTLC on bitcoin

Describe the solution you'd like
Use BIP199 to setup CSV/HTLC on bitcoin

Additional context
BIP199:
https://github.com/bitcoin/bips/blob/master/bip-0199.mediawiki

Some basic example code (unittest):
https://github.com/bitcoinjs/bitcoinjs-lib/blob/3588d1100f82af1718e0a2b0c91db1d33a4204b0/test/integration/csv.js#L38-L95

Some implementation (submorineswaps):
https://github.com/submarineswaps/swaps-service/tree/master/swaps

Fix id & hash mismatch

Run Beet from any branch (master/develop/Steem-Support) and run the new example from beet-js (bitshares/beet-js#10)

Notice:

  • 1st load: account and chain gets linked
  • refresh: msg encrpytion error
  • refresh: hash mismatch error
    if (hash == client.next_hash) {
  • refresh: like 1st load

Also see the uncommented lines in new example from beet-js. Put them back in to get a different strange id mismatch bug

Any ideas / pointers?

Beet Auto close app

Is your feature request related to a problem? Please describe.

I was thinking a checkbox to "auto close the app after xx time" might be a good option. But, how could that be done in the event that a transaction occurs, a back up is mandated, but the user is either unavailable, device is lost, stolen, away from backup device, etc?
With that said, I am curious as to how Beet would currently handle an instance where a user accesses the app, makes transactions, and experiences a power failure, reboot, loss of connection, or back up needed?

Step 2: key input; tooltips; Copy/paste

Describe the bug

  1. Active/Memo key input exceeds the window size; consider reducing the font size or enlarging the key
    input window size so that the keys fit within the window in entirety.
  2. Unable to copy/paste the keys
  3. Tooltips are generic; Consider detailed, simple directive tooltips to guide the user

To Reproduce
Steps to reproduce the behavior:

  1. Open Beet; Go to step 2 for Active/Memo key input

  2. Click in Active key window; attempt to copy/paste the key into the window

  3. Note that copy/paste is disabled; Input the Active key manually noting it scrolls outside the window
    beet2_key_capture_2

  4. Click in the Memo key window; attempt to copy/paste the key into the window

  5. Note that copy/paste is disabled; Input the Memo key manually noting it scrolls outside of the window

  6. Note that tooltips throughout are generic in terms of direction to the user

Expected behavior

  1. Ability to copy/paste the key; if disabled, consider a copy/paste disabled notification to the user
  2. Ability to input the Active/Memo key and see it in entirety.
  3. Ability to hover over a field, utilizing the tooltip for concise, direction.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 8.1
  • Browser Opera

Additional context
Best practice is never copy/paste keys, but eliminates human error entry.
Tooltip wording is crucial for the user to know exactly what is asked of them, especially when it involves keys.

Integration testing

We want you

In order to polish and finalize beet beta we are looking for integration testers.

Requirements

  • currently there are no binaries available yet, so the minimum requirement is that you know how to install and run beet via npm locally according to the readme and are able to read javascript
  • attention to detail and ability to report precisely

Tasks

With estimation of effort in the front
  • [0.25] Install and start Beet and import accounts for each chain that you have an account, at least 3 different chain
  • [0.25] Check your accounts balance with external explorers
  • are all tokens you have listed?
  • is the balance correct?
  • [0.25] Click around in beet, does something feel weird? Is the UX broken? Is something not self-explanatory?
  • [0.5] Execute at least one example for each chain (must broadcast something) found here https://github.com/bitshares/beet-js/tree/develop/examples If using transfer example make sure the recipient is one of your own accounts
  • [0.3] Use http://examples.get-beet.io/binance-dex to trigger transfers

Process

Comment in here that you are interested and what chains you can do. When accepted, please create your own integration testing issue.
  • Each click and every action you do needs to be reported via window screenshot in the issue
  • When broadcasing, please post a link to the transaction
  • If there are any errors appearing, report the console log of beet (push CTRL+SHIFT+I when beet is open) and the electron output (visible in the console where you started beet), if executing an example also the browser console log of the example

Header: Space next to account

Currently connector it is always visible
image

Show connector only while connecting, and if it errored. When not present, default to purple background with a refresh icon that reloads current account balance.

Branding: Wallet selector

Currently looking like this
image

Task is to match the style as seen in #34 (comment)

Due to a build process issue (couldnt get vue sass loader to work properly) npm run buildcss needs to be run to compile global sass files.

Styling the default combobox seems obnoxious (https://css-tricks.com/dropdown-default-styling/), switching to multiselect may be warranted (as seen here https://github.com/bitshares/beet/blob/develop/src/components/account-select.vue) and adjust it's styling to match.

Either solution is fine as long as the default combobox UX flow is maintained.

[15] Beet UX/UI Design

The UI design will be handled by the winner of the Beet logo contest (https://whaleshares.io/art/@pixel/beet-artcontest-bring-life-to-beet)

Beet UX is bootstrap based.

This is a list of things we're going to need:

  • Primary logo with & without app name
  • Logo in secondary color scheme with & without app name
  • Mini logo/icon
  • Main font
  • Secondary/Headings font
  • Button style
  • Bootstrap theme colors x 8 (primary,secondary,success,danger, warning, info, light,dark )
  • Form control styles (input textbox, checkbox, radio, switch)
  • Status indicator (connected/not connected)
  • Icon set suggestion (close, lock/unlock, save, load etc.)
  • Modal/popup styling

Multi-graphene Chain support

Is your feature request related to a problem? Please describe.

Other graphene-based blockchains are facing a similar problem that beet is solving: Trust in third party apps. Some other chains may even experience this as a bigger problem, such as PeerPlays Blockchain which would like to allow 3rd party game developers to develop custom games.

Describe the solution you'd like

I'd like beet to be able to not only speak/sign for BitShares, but also other chains (e.g. PeerPlays, SoundDac, Decent, ....).

Describe alternatives you've considered

Forking + Customization

Additional context

Basically, the app could have a slider of some kind to define which chain you want to talk to. Then, the app would load chain-specific plugins/jslibrary and offer chain-specific API calls.

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.