Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ElMato

Pages: [1] 2
1
Technical Support / New API for witness_node
« on: December 26, 2016, 07:50:44 pm »
Continuing  the discussion on changing / updating the API of witness_node.

The BitShares blockchain has a more diverse STATE than the Bitcoin blockchain (UTXO/Address Balance).
We have a lot of entities: accounts, balances, assets, orders, feeds, etc.

We need maximum flexibility when querying the state.

The state doesn't have all the appropriated indexes or doesn't have the specific function to query that specific part of the state.

Eg:
We needed to list all the holders of a specific asset.

The index was already there.

... ordered_unique< tag<by_asset_balance>,
            composite_key<
               account_balance_object,
               member<account_balance_object, asset_id_type, &account_balance_object::asset_type>,
               member<account_balance_object, share_type, &account_balance_object::balance>,
               member<account_balance_object, account_id_type, &account_balance_object::owner>
            >,
          ...


So, we just write the function using that index.

Code: [Select]
vector<account_asset_balance> database_api_impl::get_asset_holders( asset_id_type asset_id )const
{
   const auto& bal_idx = _db.get_index_type< account_balance_index >().indices().get< by_asset_balance >();
   const auto range = bal_idx.equal_range( boost::make_tuple( asset_id ) );
   vector<account_asset_balance> result;
   for( const account_balance_object& bal : boost::make_iterator_range( range.first, range.second ) )
   {
     assert( bal.asset_type == asset_id );
     auto account = _db.find(bal.owner);

     account_asset_balance aab;
     aab.name       = account->name;
     aab.account_id = account->id;
     aab.amount     = bal.balance.value;

     result.push_back(aab);
   }

   return result;
}

So if we want to query the state in any imaginable way we have many options each one of them with some trade-offs.

1) Add more boost_multi_index_container for the state with the corresponding functions when needed.
     This will increase memory usage in all nodes since indexes occupy memory space.
     But can be set at compile time or with a custom plugin.

2) Replicate the state in a MySQL/neo4J database.
    Add a function to dump the FULL STATE of the object db.
    And then apply state changes (add/edit/delete objects).
 
    This process need to lock the block processing until we apply the state change in our underlying database.
    Otherwise if we miss a delta-diff our outside-state will be different from the real state.

    Eg: if we just connect to the WS interface, and wait for "object_changed" callback and affect the outside-state accordingly, then our process go down, the blockchain keeps updating objects, we reconnect later and .... we are in problems.

    We have been experimenting with this approach developing a plugin that will call a python function with the changed_objects content.

Code: [Select]
void db_update_plugin::plugin_initialize(const boost::program_options::variables_map& options)
{
  auto script_str = options.at("python-script").as<std::string>();
  if ( !script_str.size() )
    return;

  Py_Initialize();

  my->_main_module = bp::import("__main__");
  my->_global      = my->_main_module.attr("__dict__");

  auto script_path =  bp::str(script_str);

  bp::exec_file(script_path, my->_global, my->_global);

  my->_handler = my->_global["Handler"]();

  database().changed_objects.connect([&]( const std::vector<graphene::db::object_id_type>& ids) {

    bp::list list_ids;
    bp::list list_values;

    for( auto id : ids ) {

      fc::variant vo;
      to_variant(id, vo);
      list_ids.append( vo.get_string() );

      const graphene::db::object *obj = database().find_object(id);
      if ( obj != nullptr ) {
        list_values.append( fc::json::to_string(obj->to_variant()) );
      } else {
        list_values.append( "" );
      }
    }

    bp::call_method<void>(my->_handler.ptr(), "changed_objects", list_ids, list_values);
  });
}

 

    (We have to take care of possible forks in the chain? Or the changed_objects callback also tell us [in case of undo] which objects need to be deleted?) 

3) Create a pluggable db backend.
     Take graphene::db::object_database as the base, create an interface and implement object_database_mysql, object_database_neo4j ... etc.


2
General Discussion / Can we copy MakerDao blackswan mitigation techniques?
« on: September 10, 2015, 10:47:58 pm »
--disclaimer: not an expert talking--

I think we will have a robust system when 2.0 is out and running.

- Clear and defined governance model
- Ability to (de)centralize at will
- Aligned economic incentives
- A good degree of privacy

Among other excellents features such as smartcoins, transaction speed, scalability, copay-on-protocol, etc, etc, etc.

Looking at MakerDao, one of the things that sounds interesting is the actions their planned to mitigate the effects of a blackswan.

I know that "printing" more BTS is a sensible subject in the community, but i think in an scenario like this.

Supose that 2 years have passed from now and the marketcap of bitUSD is 100M USD, basically a lot of people is using it as a medium of exchange etc etc. Suddenly a black swan event ocurrs, the rainy-day pool is not enough to cover all, and we declare the bitUSD market dead and everyone gets their bitUSD swaped by (what is left) BTS.

Bad publicity and difficult to restart confidence in the sysmtem again.

Should we as stake holders take the losse on it in order to keep the business running?

3
General Discussion / [ANN] LimeWallet - Beta
« on: August 09, 2015, 08:00:39 am »
iOS Version
PM you email to add you to apple's testflight.

*Update1*
*Fix errors in memo handling.

Important!:
Always Backup your seed before uninstalling the app

https://s3.amazonaws.com/limewalletdwn/limewallet-beta1-update1.apk


Dear community,

 It has been a long time wihtout updates from our side, basically because we were working as hard as we could to produce a usable mobile wallet.

 So *beta1* of LimeWallet is here for you to test.



 Despite the fact that there is a lot to be done, we think it is in a usable state.

Installation from binary:

Android:
(See above)
 
iOS: [instructions soon]

Installation from source:

Go to https://github.com/limewallet/limewallet and follow the instructions there.


Features:
  • Private keys on client side
  • Full wallet recovery from a seed. (This include in/out memos)
  • Deposit / Withdraw in Bitcoin
  • Bitcoin payments
  • Handling of Bitcoin urls (android intent)
  • Password locking
  • Local addressboook
  • Send to name, pubkey or address with memo (all from client side)
  • Paper wallet balance import
  • Crypto operations using "standard" libraries (bitcoinj, CoreBitcoin)
  • Android & iOS version

Liquidity BitAsset<=>BTC

Our backend is agregating the liquidity from:
  • Yunbi
  • Metaexchange (just BTA=>BTC)
  • BTSBOTS
  • BitShares Exchange (*1)
  • btc38 (*2)

*1 Turned off until next week.
*2 Avilable, but not enough bank to be in every exchange at the moment.

We charge 0.3%, of the best price we find.
But we plan to go to 0% as we build partnerships with already established exchanges.
Bottom line is that we want to provide the best exchange rate that the market has for bitAssets<->BTC.

*IMPORTANT*

We are low on bank, and not every exchange allows us to auto-adjust our wallets (asking by API to do a withdraw) so balancing the wallets its a manual process.

If you want to stay in the safe side go for BTC<->USD , BTC<->CNY in amounts not greater that $25 until we have more liquidity.

The refund process will be addressed next week.

iOS Version:

iOS version is ready also and we are setting up everything in (the recently acquired by Apple) testflightapp.
Pablo will collect iOS devices serials numbers to produce an IPA.

Thanks for your patience!:
Please, help us test the wallet!. We need your feedback!! :


Note:
If anyone wants to recover funds from alpha1 or alpha2 wallet please PM me.
 

4
Is this correct ?

delegates ->
   * elected by shareholders (how many can be elected?)
   * have control of the genesis account (1.3.0)
     so they can => [adjust tx fees, ... , ?]
     (they publish a proposal and shareholders have time to vote them out if they don't like the change)

witnesses ->
   * elected by shareholders (no fixed number, no more 101 hardcoded)
   * block signers (aka: miners)
   * all get the same payment based on what delegates decide is fair for maintain the node (time+materials)

workers ->
   * elected by shareholders
   
refund-workers ->
   * elected by shareholders
   * return their pay to the reserve pool

No downvote for delegates
No downvote for witnesses
No downvote for workers (?)
No downvote for refund-workers (?)

5
Technical Support / Running witness node
« on: June 09, 2015, 07:48:34 pm »
While we wait for the official testnet, anyone is trying to run the code posted yesterday?

After compiling and running witness_node im getting.

No witnesses configured! Please add witness IDs and private keys to configuration.

So i edit the config.ini (there is no config.json as github says)
and set

witness-id = "1.2.0"

since the privkey is already configured for this witness. (is this reasoning ok??)
private-key = ["1.2.0","aeebad4a796fcc2e15dc4c6061b45ed9b373f26adfc798ca7d2d8cc58182718e"]

Code: [Select]
10 assert_exception: Assert Exception
fc::to_uint64( s.substr( 0, first_dot ) ) == SpaceID && fc::to_uint64( s.substr( first_dot+1, second_dot-first_dot-1 ) ) == TypeID:
    {}
    th_a  object_id.hpp:182 from_variant

    {"var":"1.2.0"}
    th_a  object_id.hpp:184 from_variant


If i set the witness id to witness-id = "1.7.0"
The node starts ....

Any hints?

Code: [Select]
2375001ms th_a       witness.cpp:129               operator()           ] Not producing block because production is disabled.
2380000ms th_a       witness.cpp:171               block_production_loo ] slot: 435756 scheduled_witness: 1.7.2 scheduled_time: 2015-06-09T19:39:40 now: 2015-06-09T19:39:40
2380001ms th_a       witness.cpp:129               operator()           ] Not producing block because production is disabled.
2385000ms th_a       witness.cpp:171               block_production_loo ] slot: 435757 scheduled_witness: 1.7.3 scheduled_time: 2015-06-09T19:39:45 now: 2015-06-09T19:39:45
2385000ms th_a       witness.cpp:129               operator()           ] Not producing block because production is disabled.
2390001ms th_a       witness.cpp:171               block_production_loo ] slot: 435758 scheduled_witness: 1.7.4 scheduled_time: 2015-06-09T19:39:50 now: 2015-06-09T19:39:50
2390001ms th_a       witness.cpp:129               operator()           ] Not producing block because production is disabled.
2395000ms th_a       witness.cpp:171               block_production_loo ] slot: 435759 scheduled_witness: 1.7.7 scheduled_time: 2015-06-09T19:39:55 now: 2015-06-09T19:39:55
2395000ms th_a       witness.cpp:129               operator()           ] Not producing block because production is disabled.

6
General Discussion / Micropayment channel with bitUSD
« on: June 03, 2015, 04:31:58 am »
I was looking at Streamium and thinking what is missing from our part to support the micropayment channel protocol with bitAssets.
https://en.bitcoin.it/wiki/Contracts#Example_7:_Rapidly-adjusted_.28micro.29payments_to_a_pre-determined_party

It seems that we only need a new transaction field "valid_from" that prevents a transaction to be broadcasted/accepted into the blockchain before that date.

And the mechanics could be as follow.

Client: Ask the server for a pubkey.
Server: Sends pubkey

Client: Calculate a multisig deposit with both client_pubkey and server_pubkey
Client: Send and unsigned tx to server that returns 100% of the funds he is willing to use to his self with a valid_from field set to Now+2hours and expiration set to Now+2hours+1day.
Server: Sings transaction and send back to client

Server: Create unsigned transaction that allocates 99% to the client 1% to the server
Client: Validates/sign the transaction and send back to server

Some minutes/seconds pass ...

Server: Create unsigned transaction that allocates 98% to the client 2% to the server
Client: Validates/sign the transaction and send back to server

Some minutes/seconds pass ...

Server: Create unsigned transaction that allocates 97% to the client 3% to the server
Client: Validates/sign the transaction and send back to server

And so on and so forth... until the channel is closed and the server broadcast the transaction to get his money and send the rest to the client.
If the server hangs the client has the first transaction signed by the server that can broadcast after the specified date in "valid_from".

I think micropayments in bitUSD has a lot of potential in a lot of audiences/industries.
games, video streaming, torrent seeds, adult entertainment, etc, etc, etc.

Questions:

What is the impact to add that field to the transaction?
Is a hard fork required?

Code: [Select]
struct transaction
   {
      fc::time_point_sec    expiration;
      optional<fc::time_point_sec>    valid_from;
      optional<uint64_t>    reserved;
      vector<operation>     operations
    ....

7
General Discussion / Reconstruct memo info from a seed
« on: May 19, 2015, 05:24:39 pm »
If we want to reconstruct the entire transaction history of an account, we need to decode the memos that were sent from us and the memos received by us. (The second ones are not a problem since we have all the necessary information to decode).

But, the reconstruction of the shared secret (used to encrypt the memo out) forces the client to keep a reference to the key used (child index of HD key, full ECkey, other).

If we can just store 4 bytes in the memo we can relieve the client from storing that references (since the reference will be in the blockchain) and will let reconstruct the entire history just from a seed.

This 4 bytes can be obscured/encrypted using skip32 or other mechanism.

It there any possibility to do this in the core?
I don't want to increment blockchain size since it will have a big impact on the long term, but can we give a new meaning to some memo fields?

@vikram

8
General Discussion / Wrong amount in small orders
« on: March 18, 2015, 08:47:02 am »
When i submit a bid wanting to buy 8 BTS @ 0.000132555 USD i get this in the orderbook.
Code: [Select]
0.0010 USD                7.54403 BTS                     0.000132555000 USD
Why i don't get the full 8 BTS?

When buying 4 BTS
Code: [Select]
0.0005 USD                3.81679 BTS                     0.000131000000 USD
When buying 2 BTS
Code: [Select]
0.0002 USD                1.65289 BTS                     0.000121000000 USD
Is this a precision problem?

9
Technical Support / 0.5.3 wont sync
« on: February 01, 2015, 09:47:12 am »
I'm stuck at block 1603649 and the client keeps saying ...

Code: [Select]
--- there are now 4 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- in sync with p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- syncing with p2p network, 68892 blocks left to fetch
--- there are now 3 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- in sync with p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- syncing with p2p network, 68961 blocks left to fetch
--- there are now 3 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 2 active connections to the p2p network

I've already removed peers db and nothing changes.


Code: [Select]
(wallet closed) >>> about
{
  "blockchain_name": "BitShares",
  "blockchain_description": "Life, Liberty, and Property for All",
  "client_version": "v0.5.3",
  "bitshares_revision": "8c908f81510e7103b41323bcf5a5731047c59994",
  "bitshares_revision_age": "10 days ago",
  "fc_revision": "64c6c01b806efcf70bb06aeb55ca317492123d80",
  "fc_revision_age": "25 days ago",
  "compile_date": "compiled on Jan 31 2015 at 04:44:06",
  "boost_version": "1.56",
  "openssl_version": "OpenSSL 1.0.1i 6 Aug 2014",
  "build": "osx 64-bit"
}

Code: [Select]
(wallet closed) >>> info
{
  "blockchain_head_block_num": 1603649,
  "blockchain_head_block_age": "8 days old",
  "blockchain_head_block_timestamp": "2015-01-24T01:18:30",
  "blockchain_average_delegate_participation": "0.14 %",
  "blockchain_confirmation_requirement": 1,
  "blockchain_share_supply": "2,498,419,725.46411 BTS",
  "blockchain_blocks_left_in_round": 29,
  "blockchain_next_round_time": "at least 5 minutes in the future",
  "blockchain_next_round_timestamp": "2015-02-01T09:49:20",
  "blockchain_random_seed": "27dac4b3b71302c47ec55bd794a6a4c8100b8f7c",
  "client_data_dir": "/Users/[edited]/Library/Application Support/BitShares",
  "client_version": "v0.5.3",
  "network_num_connections": 6,
  "network_num_connections_max": 200,
  "network_chain_downloader_running": false,
  "network_chain_downloader_blocks_remaining": null,
  "ntp_time": "2015-02-01T09:44:30",
  "ntp_time_error": 0.14476700000000001,
  "wallet_open": false,
  "wallet_unlocked": null,
  "wallet_unlocked_until": null,
  "wallet_unlocked_until_timestamp": null,
  "wallet_last_scanned_block_timestamp": null,
  "wallet_scan_progress": null,
  "wallet_block_production_enabled": null,
  "wallet_next_block_production_time": null,
  "wallet_next_block_production_timestamp": null
}

any ideas?

10
Follow My Vote / DemocracyOS + VOTE?
« on: January 08, 2015, 12:34:17 am »
Is there a PDF/Paper or something that exactly says what VOTE will do?

I can introduce BitShares and VOTE to the creator of DemocracyOS (that happens to be a Bitcoin advocate) and i think the concept of voting in a blockchain could be the spearhead.

11
General Discussion / Are we forking?
« on: January 08, 2015, 12:04:32 am »
- Desktop node was in a 100% delegate participation chain.
- Server node was in a low participation chain (about 12% or 0.12% don't remember well), 2hs behind.

I wanted to get in the main chain again, so i added hosts listed (in the client) by network_get_peer_info to the server.
Quickly the server was again in the main chain (info returned 100% participation rate)

But suddenly the participation rate started to drop (in the server).
As i'm writing this is at 66% and going down.

Last block in the server 1466059.
Last block in the client 1466114.

--- update
Participation rate in the server node stopped at ~61%.
Added a new node to the server and we are back on the main chain ... :|




12
https://twitter.com/jonmatonis/status/549976223980744704
https://www.cryptocoinsnews.com/stealth-payments-create-anonymous-bitcoin-transactions/#comment-1764405685

I think this is what we are achieving with BitShares Mail.
Maybe someone more fluent can comment best or upvote.

13
Stakeholder Proposals / Delegate Proposal: Mobile Wallet - elmato
« on: December 20, 2014, 12:27:06 am »
Dear community,

 My name is Matias Romeo and together with Pablo Tutino we are both cofounders of Latincoin.com.
 We are based in Buenos Aires (Argentina) working from the "Bitcoin Center Buenos Aires" (aka: Bitcoin Embassy)
 
 We are looking for a 100% pay delegate to fund the development of a mobile wallet.

 In fact we already started with the development and today we release the alpha-2 version.
 https://bitsharestalk.org/index.php?topic=11902.0

 I have been presenting BitShares in the first meetup held in Buenos Aires together with @fran2k.
 http://www.meetup.com/Bitcoin-Argentina/photos/25792368/#432388669

Short term goals are: 
 - Have a stable mobile wallet for Android/iOS published in the stores.
 - Have On/Off ramp with Bitcoin
 - Have On/Off ramp with ARS

Also we are working together with @Method-X and @matt608 helping them with the marketing strategy for Argentina.

Besides this we have bigger plans for BitShares in the region, but i don't want to oversell but to deliver first.

Please, ask any question you have if in doubt to vote.



Thanks
Matias

翻译:
受托人名称:elmato

亲爱的社区:
我的名字是Matias Romeo,正在与Pablo Tutino工作,我们是Latincoin.com的创始人。
 We are based in Buenos Aires (Argentina) working from the "Bitcoin Center Buenos Aires" (aka: Bitcoin Embassy)
我们是在阿根廷布宜诺斯艾利斯的“比特币大使馆”里工作的。
 我们寻求一个100%支付率的受托人,以资助手机钱包的开发计划。
实际上我们已经开始了开发而且已经释出了alpha-2测试版本。

https://bitsharestalk.org/index.php?topic=11902.0

我还有与fran2k一起在布宜诺斯艾利斯举办了首次的见面会。
http://www.meetup.com/Bitcoin-Argentina/photos/25792368/#432388669

我们的短期目标是:
 - 有一个稳定的移动钱包,这样安卓和苹果都可以放在它们的软件商店里。
 -以比特币为基准的出入口
 - 以阿根廷货币为基准的法币出入口


我们还与Method-x和matt608一起进行阿根廷市场推广策略的商讨。

我们还有在这个地区给比特股的更大的计划,不过我不想在成功之前过分宣传。

请提出任何问题,如果你有疑问的话。

谢谢
Matias

14
Can i request a list of transactions of any address?
Or only address of local accounts?

Because i saw this and i know that that address has some transactions involved.

Quote
default (unlocked) >>> blockchain_list_address_transactions BTS9pTBfYkFwmUm46XTaeTLukGDrupobHwzc "1970-1-1T00:00:01"
[]

15
Technical Support / blockchain_list_address_balances not working?
« on: December 17, 2014, 08:03:15 pm »
Quote
default (unlocked) >>> blockchain_get_balance BTS2CV6F52pMnhJeiDF7ZQK8XoX5ejdENM3b
{
  "condition": {
    "asset_id": 0,
    "slate_id": 0,
    "type": "withdraw_signature_type",
    "data": {
      "owner": "BTS9pTBfYkFwmUm46XTaeTLukGDrupobHwzc",
      "memo": null
    }
  },
  "balance": 100000,
  "restricted_owner": null,
  "snapshot_info": null,
  "deposit_date": "2014-11-14T05:27:01",
  "last_update": "2014-12-16T06:16:00"
}
default (unlocked) >>> blockchain_list_address_balances BTS9pTBfYkFwmUm46XTaeTLukGDrupobHwzc
10 assert_exception: Assert Exception
!"This balance's condition type doesn't have a true owner.":
    {}
    th_a  balance_record.cpp:30 owners

    {"addr":"BTS9pTBfYkFwmUm46XTaeTLukGDrupobHwzc"}
    th_a  chain_database.cpp:2399 get_balances_for_address

    {}
    th_a  common_api_client.cpp:1633 blockchain_list_address_balances

    {"command":"blockchain_list_address_balances"}
    th_a  cli.cpp:579 execute_command
default (unlocked) >>>

Pages: [1] 2