Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: 250 PTS - BOUNTY - Import wallet.dat Private Keys via API call (2 PTS Referral)  (Read 4510 times)

0 Members and 1 Guest are viewing this topic.

Offline bytemaster


Our wallets will need to import from many different wallet.dat files which may be protected by a password.  For easy of development we would like an API call implemented in the bitshares code base that can import a wallet.dat file.

Files to be created:
include/bts/bitcoin_wallet.hpp
src/bitcoin_wallet.cpp

Code: [Select]
namespace bts  {
      std::vector<fc::ecc::private_key> import_bitcoin_wallet( const fc::path& wallet_dat, const std::string& passphrase );
}

The bounty will be awarded to the first person who can complete the task with pull request that is accepted by our team.  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.   All code must follow the same conventions found in the bitshares repository.   Code must compile with g++ and VC 2010 or newer.   A 1 PTS penalty will be assessed (deducted from ultimate award) for every submission attempt that is sent back for coding style violations, compilation errors, or failed unit tests.   

There is an additional 2 PTS bounty paid to the person who refers the winner of this bounty to this thread.  You must be the first to post the name of the person who ultimately wins the bounty to this thread.   You cannot refer yourself.

Any questions regarding the implementation of this method or about the requirements must be posted in this thread.  More bounties will be forth coming.

« Last Edit: January 18, 2014, 08:55:43 PM by bytemaster »
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

I'm starting this, contact me if anyone wants to work together
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline toast

Can you take fc/ out of the .gitignore, or at least explain what's supposed to be in there?
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

Can you take fc/ out of the .gitignore, or at least explain what's supposed to be in there?

bitshares/fc  -> https://github.com/InvictusInnovations/fc

Which repository are you referring to for the .gitignore
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

BitShares
https://github.com/InvictusInnovations/BitShares/blob/master/.gitignore#L46

Igorning fc from the bitshares repo is because fc is a foreign repository checked out separately...

git clone bitshares
cd bitshares
git clone fc
cmake .
make
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

got it, getting other build errors but it's probably due to my environment

anyone developing this on OSX that I can chat with?
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

got it, getting other build errors but it's probably due to my environment

anyone developing this on OSX that I can chat with?

Me :)   

g++4.8 from mac ports
build boost 1.54 from source and install

For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

Code: [Select]
boost-1.54.0 already installed
I'm using brew though.


I did get this during cmake, is it relevant?:

Code: [Select]
(~/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
--   context
CMake Warning (dev) at CMakeLists.txt:87 (set):
  Cannot set "BOOST_LIBRARIES": current scope has no parent.

the full errors I'm getting during make

Code: [Select]
[  1%] Building CXX object CMakeFiles/bshare.dir/src/network/server.cpp.o
clang: 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 here
template <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 here
template <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 1
make[1]: *** [CMakeFiles/bshare.dir/all] Error 2
make: *** [all] Error 2
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

You are using XCodes clang++ compiler rather than g++. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora
Quote
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.
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?
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline bytemaster

Quote
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.
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?

Bitcoin-QT and ProtoShares use the same wallet format, these are the only wallets required by this bounty. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora
This means we can reuse code from bitcoin. I have been looking at bitcoin/src/wallet.{h,cpp}. I might be able to do this basing my solution on bitcoin code. For now we should make unit tests firsts and put them online.
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline toast

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
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

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

I haven't upgraded to Mavericks yet on my primary development machine.   FYI, once this task is done I will have more follow-on tasks as fast as I can specify them, which is becoming my full time job :)
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

 

Google+