0 Members and 1 Guest are viewing this topic.
...Please provide me your PTS addresses.
Quote from: batmaninpink on January 21, 2014, 01:09:02 pmQuote from: drekrob on January 21, 2014, 12:06:52 pmwell awesome, welcome to the forum and thanks for letting everyone know they are wasting their time on this because you are nearly finished. that's a two person nightshift and 20+ hours of coding beeing utterly useless now.Sorry, I started this yesterday when being stuck at an airport - fully aware that I was probably too late anyway. So any status update would've been "I am looking into this" - which I am sure would not have deterred you or anyone else from continuing (I see a couple of those status updates earlier in this thread...).Batmaninpink, your code was superior upon inspection due to proper use of the fc library for managing encryption. The other submission had potential memory leaks and used OpenSSL calls directly without clear tracking of memory or exception safety. Your submission also had better abstraction of data parsing. I have merged your code and will be evaluating it prior to paying the bounty. Drekrob, your submission was also very good and absent the competition may have been accepted after some robustness enhancements. I will give you a 30 PTS tip for your submission (~$360 dollars) which should partially recognize your time. These bounties are a kind of interview and so redundant work actually has value to us.It is very clear to me that you are both talented developers and I would like to discuss how we can work together on a non-bounty basis to eliminate redundant effort. I am looking for some serious c++ full time developers.Please provide me your PTS addresses.
Quote from: drekrob on January 21, 2014, 12:06:52 pmwell awesome, welcome to the forum and thanks for letting everyone know they are wasting their time on this because you are nearly finished. that's a two person nightshift and 20+ hours of coding beeing utterly useless now.Sorry, I started this yesterday when being stuck at an airport - fully aware that I was probably too late anyway. So any status update would've been "I am looking into this" - which I am sure would not have deterred you or anyone else from continuing (I see a couple of those status updates earlier in this thread...).
well awesome, welcome to the forum and thanks for letting everyone know they are wasting their time on this because you are nearly finished. that's a two person nightshift and 20+ hours of coding beeing utterly useless now.
I have made pull requests for this, see:https://github.com/InvictusInnovations/fc/pull/4https://github.com/InvictusInnovations/BitShares/pull/21
Well sorry for sounding kind of rough, it's hardly your fault. I specificaly told arlen i do not like to work on bounties as i saw exactly this problem coming up. Even if you would not have done it and our solution had been the first, there were still three or four others puting time into this. In the end you are always spending way more time on a task than it is needed.
How do you want the function to respond to soft errors (corrupt data in db, decryption error etc). Should it throw an exception or ignore and continue with the remaining keys?I'm able to import the correct private keys from a bitcoin wallet (verified it with a address utility, the public key matches the address in the client). But the public keys i import from pts wallets dont get me the right addresses with Code: [Select]auto test_pub = imported_keys[n].get_public_key();bts::pts_address test_addr(test_pub);So if the pts_address class is supposed to work i somehow don't get the right public keys from pts wallets while i get the right public keys from bitcoin wallets.
auto test_pub = imported_keys[n].get_public_key();bts::pts_address test_addr(test_pub);
do I understand correctly that wallet.dat is a Berkeley database file?
I am going to increase this bounty to 250 PTS as this is a high priority.
This project on github claims to be able to import private keys among other things. It is written i PythonSome code I found on the repositoryCode: [Select]def i2d_ECPrivateKey(pkey, compressed=False):#, crypted=True): part3='a081a53081a2020101302c06072a8648ce3d0101022100' # for uncompressed keys if compressed: if True:#not crypted: ## Bitcoin accepts both part3's for crypted wallets... part3='a08185308182020101302c06072a8648ce3d0101022100' # for compressed keys key = '3081d30201010420' + \ '%064x' % pkey.secret + \ part3 + \ '%064x' % _p + \ '3006040100040107042102' + \ '%064x' % _Gx + \ '022100' + \ '%064x' % _r + \ '020101a124032200' else: key = '308201130201010420' + \ '%064x' % pkey.secret + \ part3 + \ '%064x' % _p + \ '3006040100040107044104' + \ '%064x' % _Gx + \ '%064x' % _Gy + \ '022100' + \ '%064x' % _r + \ '020101a144034200' return key.decode('hex') + i2o_ECPublicKey(pkey, compressed)I am going to test pywallet to see if this works.
def i2d_ECPrivateKey(pkey, compressed=False):#, crypted=True): part3='a081a53081a2020101302c06072a8648ce3d0101022100' # for uncompressed keys if compressed: if True:#not crypted: ## Bitcoin accepts both part3's for crypted wallets... part3='a08185308182020101302c06072a8648ce3d0101022100' # for compressed keys key = '3081d30201010420' + \ '%064x' % pkey.secret + \ part3 + \ '%064x' % _p + \ '3006040100040107042102' + \ '%064x' % _Gx + \ '022100' + \ '%064x' % _r + \ '020101a124032200' else: key = '308201130201010420' + \ '%064x' % pkey.secret + \ part3 + \ '%064x' % _p + \ '3006040100040107044104' + \ '%064x' % _Gx + \ '%064x' % _Gy + \ '022100' + \ '%064x' % _r + \ '020101a144034200' return key.decode('hex') + i2o_ECPublicKey(pkey, compressed)
Edit: One note of caution. I cant find a license accompanying the code on github.
Just install it with apt-getapt-get install libboost1.54-all-dev Quote from: pvaladares on January 01, 2014, 01:53:53 amQuote from: enodata on December 31, 2013, 04:34:24 amUbuntu (I assume you're on 13.10) installs boost 1.53 by default, bitshares require 1.54. You can install it with apt-get or you can stay on 1.53 and just downgrade required boost version in CMakeList.txt and also remove boost_coroutine requirement from it. It compiles and runs fine with 1.53, I compiled and ran Keyhotee a few days ago.Yes, I am running Ubuntu 13.10.I tried to install Boost 1.55, with this sequence:Code: [Select]wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2tar --bzip2 -xf /path/to/boost_1_55_0.tar.bz2cd boost_1_55_0/./bootstrap.sh --prefix=/usr/local/./b2 install./bjamsudo ./bjam installThe same error about 1.53 still appears.Code: [Select]CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1126 (message): Unable to find the requested Boost libraries. Boost version: 1.53.0 Boost include path: /usr/include The following Boost libraries could not be found: boost_coroutine Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.Call Stack (most recent call first): CMakeLists.txt:57 (FIND_PACKAGE)-- Boost version: 1.53.0-- Found the following Boost libraries:-- thread-- date_time-- system-- filesystem-- program_options-- signals-- serialization-- chrono-- unit_test_framework-- contextCMake Warning (dev) at CMakeLists.txt:87 (set): Cannot set "BOOST_LIBRARIES": current scope has no parent.This warning is for project developers. Use -Wno-dev to suppress it.-- Configuring incomplete, errors occurred!
Quote from: enodata on December 31, 2013, 04:34:24 amUbuntu (I assume you're on 13.10) installs boost 1.53 by default, bitshares require 1.54. You can install it with apt-get or you can stay on 1.53 and just downgrade required boost version in CMakeList.txt and also remove boost_coroutine requirement from it. It compiles and runs fine with 1.53, I compiled and ran Keyhotee a few days ago.
wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2tar --bzip2 -xf /path/to/boost_1_55_0.tar.bz2cd boost_1_55_0/./bootstrap.sh --prefix=/usr/local/./b2 install./bjamsudo ./bjam install
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1126 (message): Unable to find the requested Boost libraries. Boost version: 1.53.0 Boost include path: /usr/include The following Boost libraries could not be found: boost_coroutine Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.Call Stack (most recent call first): CMakeLists.txt:57 (FIND_PACKAGE)-- Boost version: 1.53.0-- Found the following Boost libraries:-- thread-- date_time-- system-- filesystem-- program_options-- signals-- serialization-- chrono-- unit_test_framework-- contextCMake Warning (dev) at CMakeLists.txt:87 (set): Cannot set "BOOST_LIBRARIES": current scope has no parent.This warning is for project developers. Use -Wno-dev to suppress it.-- Configuring incomplete, errors occurred!
Almost... compiled.Got 3 errors. Any idea on how to fix this?Code: [Select]compilation terminated due to -fmax-errors=3.make[2]: ** [fc/CMakeFiles/fc.dir/src/crypto/city.cpp.o] Erro 1make[1]: ** [fc/CMakeFiles/fc.dir/all] Erro 2make: ** [all] Erro 2
compilation terminated due to -fmax-errors=3.make[2]: ** [fc/CMakeFiles/fc.dir/src/crypto/city.cpp.o] Erro 1make[1]: ** [fc/CMakeFiles/fc.dir/all] Erro 2make: ** [all] Erro 2
cmake -DBoost_INCLUDE_DIR:PATH=/usr/local/include -DBoost_LIBRARY_DIR:PATH=/usr/local/lib .
Yep of course, the idea was to just get it to work *at all* and the prune
Status update: First we tried starting with CBitcoinSecret and pulling out as little as possible to make this work (I think we only need the stuff in fc::ecc and possibly in openssl), then we gave up and tried mass-importing everything from bitcoin it built with CBitcoinSecret but ran into build problems involving boost.Some points of interest:https://github.com/bitcoin/bitcoin/blob/086d7ec2b8c6ee352af820fe57908d43ec86f586/src/rpcdump.cpp#L159https://github.com/bitcoin/bitcoin/blob/f76c122e2eac8ef66f69d142231bd33c88a24c50/src/key.cpp#L150The repo (note, two branches trying top-down and bottom-up approaches):https://github.com/nmushegian/BitShares
When I try to compile I get the boost errorCode: [Select]CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1126 (message): Unable to find the requested Boost libraries. Boost version: 1.53.0 Boost include path: /usr/include The following Boost libraries could not be found: boost_coroutine Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.Call Stack (most recent call first): CMakeLists.txt:57 (FIND_PACKAGE)-- Boost version: 1.53.0-- Found the following Boost libraries:-- thread-- date_time-- system-- filesystem-- program_options-- signals-- serialization-- chrono-- unit_test_framework-- contextCMake Warning (dev) at CMakeLists.txt:87 (set): Cannot set "BOOST_LIBRARIES": current scope has no parent.This warning is for project developers. Use -Wno-dev to suppress it.-- Configuring incomplete, errors occurred!Is there any guide on how to properly install latest version?
What platform? For me it was just "brew install boost" on osx
Yeah, I've looked through the code and it shouldn't be too hard, I think once I actually start working I'll be able to finish in less than a day. arcke, want to split the work somehow?Right now I'm almost done getting this to build, successfully got it to use g++ for CXX objects but still working on getting it to use gcc instead of clang for C objects. Very good learning experience. Turns out OSX mavericks quitely links g++/gcc to clang, how nice
QuoteTo be accepted, a unit test case must be provided using boost unit tests that verifies that the keys can be imported and converted to the proper PTS address.I am in doubt regarding the task demanded by the bounty. What types of wallets should the method import? Should it import protoshares wallets into bitshares or is this method universally importing wallets of all bitcoin-forks or just bitcoin?
To be accepted, a unit test case must be provided using boost unit tests that verifies that the keys can be imported and converted to the proper PTS address.
boost-1.54.0 already installed
(~/projects/BitShares (cmake .statusCompiling on UNIX-- Boost version: 1.54.0-- Found the following Boost libraries:-- thread-- date_time-- system-- filesystem-- program_options-- signals-- serialization-- chrono-- unit_test_framework-- context-- coroutine-- Boost version: 1.54.0-- Found the following Boost libraries:-- thread-- date_time-- system-- filesystem-- program_options-- signals-- serialization-- chrono-- unit_test_framework-- contextCMake Warning (dev) at CMakeLists.txt:87 (set): Cannot set "BOOST_LIBRARIES": current scope has no parent.
[ 1%] Building CXX object CMakeFiles/bshare.dir/src/network/server.cpp.oclang: warning: argument unused during compilation: '-fmax-errors=3'warning: unknown warning option '-Wno-unused-local-typedefs' [-Wunknown-warning-option]In file included from /Users/nikolai/projects/BitShares/src/network/server.cpp:1:In file included from /Users/nikolai/projects/BitShares/include/bts/network/server.hpp:2:In file included from /Users/nikolai/projects/BitShares/include/bts/network/message.hpp:2:In file included from /Users/nikolai/projects/BitShares/include/bts/network/channel_id.hpp:76:In file included from /Users/nikolai/projects/BitShares/fc/include/fc/reflect/reflect.hpp:9:In file included from /Users/nikolai/projects/BitShares/fc/include/fc/utility.hpp:3:In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/new:56:In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/exception:81:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:770:38: error: implicit instantiation of undefined template 'std::__1::hash<fc::ip::endpoint>' : public integral_constant<bool, __is_empty(_Tp)> {}; ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/unordered_map:327:54: note: in instantiation of template class 'std::__1::is_empty<std::__1::hash<fc::ip::endpoint> >' requested heretemplate <class _Key, class _Tp, class _Hash, bool = is_empty<_Hash>::value ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/unordered_map:678:13: note: in instantiation of default argument for '__unordered_map_hasher<fc::ip::endpoint, std::__1::shared_ptr<bts::network::connection>, std::__1::hash<fc::ip::endpoint> >' required here typedef __unordered_map_hasher<key_type, mapped_type, hasher> __hasher; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/Users/nikolai/projects/BitShares/src/network/server.cpp:62:71: note: in instantiation of template class 'std::__1::unordered_map<fc::ip::endpoint, std::__1::shared_ptr<bts::network::connection>, std::__1::hash<fc::ip::endpoint>, std::__1::equal_to<fc::ip::endpoint>, std::__1::allocator<std::__1::pair<const fc::ip::endpoint, std::__1::shared_ptr<bts::network::connection> > > >' requested here std::unordered_map<fc::ip::endpoint,connection_ptr> connections; ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3081:29: note: template is declared heretemplate <class _Tp> struct hash; ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2147:15: error: no matching constructor for initialization of 'bts::network::connection' __second_(_VSTD::forward<_Args2>(get<_I2>(__second_args))...) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2421:15: note: in instantiation of function template specialization 'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<bts::network::connection>, bts::network::connection, 1>::__libcpp_compressed_pair_imp<std::__1::allocator<bts::network::connection> &, const std::__1::shared_ptr<bts::network::stcp_socket> &, bts::network::detail::server_impl *&&, 0, 0, 1>' requested here : base(__pc, _VSTD::move(__first_args), _VSTD::move(__second_args), ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3703:16: note: in instantiation of function template specialization 'std::__1::__compressed_pair<std::__1::allocator<bts::network::connection>, bts::network::connection>::__compressed_pair<std::__1::allocator<bts::network::connection> &, const std::__1::shared_ptr<bts::network::stcp_socket> &, bts::network::detail::server_impl *&&>' requested here : __data_(piecewise_construct, _VSTD::forward_as_tuple(__a), ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4277:26: note: in instantiation of function template specialization 'std::__1::__shared_ptr_emplace<bts::network::connection, std::__1::allocator<bts::network::connection> >::__shared_ptr_emplace<const std::__1::shared_ptr<bts::network::stcp_socket> &, bts::network::detail::server_impl *>' requested here ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...); ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4636:12: note: in instantiation of function template specialization 'std::__1::shared_ptr<bts::network::connection>::make_shared<const std::__1::shared_ptr<bts::network::stcp_socket> &, bts::network::detail::server_impl *>' requested here return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...); ^/Users/nikolai/projects/BitShares/src/network/server.cpp:116:28: note: in instantiation of function template specialization 'std::__1::make_shared<bts::network::connection, const std::__1::shared_ptr<bts::network::stcp_socket> &, bts::network::detail::server_impl *>' requested here auto con = std::make_shared<connection>(s,this); ^/Users/nikolai/projects/BitShares/include/bts/network/connection.hpp:61:9: note: candidate constructor not viable: no known conversion from 'bts::network::detail::server_impl *' to 'bts::network::connection_delegate *' for 2nd argument connection( const stcp_socket_ptr& c, connection_delegate* d); ^/Users/nikolai/projects/BitShares/include/bts/network/connection.hpp:62:9: note: candidate constructor not viable: requires single argument 'd', but 2 arguments were provided connection( connection_delegate* d ); ^/Users/nikolai/projects/BitShares/include/bts/network/connection.hpp:58:10: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided class connection : public std::enable_shared_from_this<connection> ^In file included from /Users/nikolai/projects/BitShares/src/network/server.cpp:1:In file included from /Users/nikolai/projects/BitShares/include/bts/network/server.hpp:2:In file included from /Users/nikolai/projects/BitShares/include/bts/network/message.hpp:2:In file included from /Users/nikolai/projects/BitShares/include/bts/network/channel_id.hpp:76:In file included from /Users/nikolai/projects/BitShares/fc/include/fc/reflect/reflect.hpp:18:In file included from /Users/nikolai/projects/BitShares/fc/include/fc/reflect/typename.hpp:2:In file included from /Users/nikolai/projects/BitShares/fc/include/fc/string.hpp:7:In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:434:In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2147:15: error: no matching constructor for initialization of 'bts::network::connection' __second_(_VSTD::forward<_Args2>(get<_I2>(__second_args))...) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2421:15: note: in instantiation of function template specialization 'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<bts::network::connection>, bts::network::connection, 1>::__libcpp_compressed_pair_imp<std::__1::allocator<bts::network::connection> &, bts::network::detail::server_impl *&&, 0, 0>' requested here : base(__pc, _VSTD::move(__first_args), _VSTD::move(__second_args), ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3703:16: note: in instantiation of function template specialization 'std::__1::__compressed_pair<std::__1::allocator<bts::network::connection>, bts::network::connection>::__compressed_pair<std::__1::allocator<bts::network::connection> &, bts::network::detail::server_impl *&&>' requested here : __data_(piecewise_construct, _VSTD::forward_as_tuple(__a), ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4277:26: note: in instantiation of function template specialization 'std::__1::__shared_ptr_emplace<bts::network::connection, std::__1::allocator<bts::network::connection> >::__shared_ptr_emplace<bts::network::detail::server_impl *>' requested here ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...); ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4636:12: note: in instantiation of function template specialization 'std::__1::shared_ptr<bts::network::connection>::make_shared<bts::network::detail::server_impl *>' requested here return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...); ^/Users/nikolai/projects/BitShares/src/network/server.cpp:251:29: note: in instantiation of function template specialization 'std::__1::make_shared<bts::network::connection, bts::network::detail::server_impl *>' requested here connection_ptr con = std::make_shared<connection>( my.get() ); ^/Users/nikolai/projects/BitShares/include/bts/network/connection.hpp:58:10: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'bts::network::detail::server_impl *' to 'const bts::network::connection' for 1st argument class connection : public std::enable_shared_from_this<connection> ^/Users/nikolai/projects/BitShares/include/bts/network/connection.hpp:62:9: note: candidate constructor not viable: no known conversion from 'bts::network::detail::server_impl *' to 'bts::network::connection_delegate *' for 1st argument connection( connection_delegate* d ); ^/Users/nikolai/projects/BitShares/include/bts/network/connection.hpp:61:9: note: candidate constructor not viable: requires 2 arguments, but 1 was provided connection( const stcp_socket_ptr& c, connection_delegate* d); ^1 warning and 3 errors generated.make[2]: *** [CMakeFiles/bshare.dir/src/network/server.cpp.o] Error 1make[1]: *** [CMakeFiles/bshare.dir/all] Error 2make: *** [all] Error 2
got it, getting other build errors but it's probably due to my environmentanyone developing this on OSX that I can chat with?
BitShareshttps://github.com/InvictusInnovations/BitShares/blob/master/.gitignore#L46
Can you take fc/ out of the .gitignore, or at least explain what's supposed to be in there?
namespace bts { std::vector<fc::ecc::private_key> import_bitcoin_wallet( const fc::path& wallet_dat, const std::string& passphrase );}