Bitcoin full node and query server

February 2019

Archive of the libbitcoin Slack #general channel.

Tuesday, February 5, 2019

P
Phil10:52
Hey! If I understood it correctly, ec_private is dealing with p2kh privkeys only, why? https://github.com/libbitcoin/libbitcoin-system/blob/00b1b1c5ebfcc91b8ad370fa9197f9ae93fb30fc/src/wallet/ec_private.cpp#L42-L48
evoskuil10:55
You don't understand correctly 😉 These values are provided solely for payment address (and WIF) conversion. The class is more general than you assume.
P
Phil11:05
Oh, ok. Thanks for clarifying!
evoskuil11:05
No prob!

Wednesday, February 6, 2019

evoskuil16:00
The hashing choice for payment indexing is based on Electrum’s design.

Thursday, February 7, 2019

sesh08:43
i am trying to use bitcoin as a library in one of Stellar based blockchain app have trouble building bitcoin/bitcoin as a library i am a c++ noob wondering if i libbitcoin solves the problem
N
narodnik11:40
not sure if I shared this yet or not, but here is a mimblewimble implementation written in libbitcoin: https://github.com/narodnik/dtek
👍 3
21 replies · neillm, Revive, narodnik · last Feb 20, 2019
neillm12:43
What is the status of this implementation? Haven't had a chance to build it yet.
Revive20:42
I tried for a while to get this to run, but libbitcoin-database dependency from master no longer builds with your libbitcoin fork
Revive20:42
i will try again later
neillm20:50
@Revive I would assume version3 is required, as it's the only stable version
Revive21:18
narodnik forked libbitcoin from master and added some stuff
neillm21:47
Ah, ok. Might just have to backup to the fork then
Revive17:40
here is the error i'm getting now. i backed it up to narodnik's last commit
Revive17:40
CXXLD tools/initchain/initchain /usr/bin/ld: tools/initchain/initchain-initchain.o: in function `main': /home/revive/src/bitcoin/libbitcoin/libbitcoin-database/tools/initchain/initchain.cpp:63: undefined reference to `libbitcoin::settings::settings(libbitcoin::config::settings)' /usr/bin/ld: /home/revive/src/bitcoin/libbitcoin/libbitcoin-database/tools/initchain/initchain.cpp:65: undefined reference to `libbitcoin::config::block::operator libbitcoin::chain::block const&() const'
Revive17:40
any ideas?
Revive18:25
@narodnik
neillm19:21
That's an error in libbitcoin(-system). You'll have to make sure that repo is backed up as well
Revive19:50
you didnt happen to try to build it @neillm? i gave up a 2nd time
Revive19:50
response from OP would be beneficial
neillm19:51
No, not yet. The script looks fairly straight-forward. I think once you have the correct commit hashes of the repos, it could be modified to build properly (without requiring root, for example)
N
narodnik07:45
hey
N
narodnik07:46
ahh I'm not sure why it's building
N
narodnik07:46
I would try version3 of the repo
neillm19:49
@Revive This modified installer worked for me: https://github.com/thecodefactory/dtek/tree/installer-updates
Revive14:22
oh nice changes, i like it 👍 i'll check it out today
neillm14:22
Cool, let me know if it works for you. You still need to install the reqs as root (commented)
neillm12:42
@sesh I'm not familiar with Stellar. What is the build issue?

Friday, February 8, 2019

P
Phil11:06
Hey, I’m not sure I get right the purpose of the following method (payment_address::extract_input). Can you guys help me? I get it returns a vector<payment_address> object and I don’t get the logic of the sequence of elements returned according with the type of the script https://github.com/libbitcoin/libbitcoin-system/blob/master/src/wallet/payment_address.cpp#L274-L320
(edited)
P
Phil12:05
I mean, I get it, that each element of the list is filled with payment_address constructors parameter, but what’s the sense to return these 5 and 6 lines, for examepl?
Untitled JavaScript · 250 B
case script_pattern::sign_key_hash:
        {
            return
            {
                { ec_public{ script[1].data() }, p2kh_version },
                { bitcoin_short_hash(script.back().data()), p2sh_version }
            };
        }
neillm12:58
@Phil Both aren't returned, what you posted is altered. See original: https://github.com/libbitcoin/libbitcoin-system/blob/master/src/wallet/payment_address.cpp#L289

Saturday, February 9, 2019

P
Phil09:31
Got it. Thanks @neillm

Tuesday, February 12, 2019

P
Phil15:45
Guys, which tool/ide do you use to build/generate building code to libbitcoin? I’m trying to add some classes and I’m not being able to build it to test it
neillm15:46
I use emacs. What repo are you trying to add classes to? It's likely that you just need to checkout libbitcoin-build and run the generate.sh script to regenerate the build artifacts
P
Phil15:50
interesting. I’m trying to add classes to libbitcoin-system
@neillm but git checkout libbitcoin-build doesn’t work on it
neillm15:53
Use git clone, it's a separate repo
P
Phil15:54
ooh, ok
neillm15:54
Check the readme too, there's a dependency (gsl)
P
Phil15:56
Ok. Thanks!
P
Phil20:13
@neillm is it common to get this kind of error when the file/folder actually exists? gsl/4 M: Directory open failure: /path/to/libbitcoin-blockchain/libbitcoin_blockchain_test_runner.sh: No such file or directory
neillm20:14
The repos should all live at the same level as the -build repo, is that what you mean?
P
Phil20:15
All the repos are in the same level, but the generate.sh still gives me several errors just like that one, but the majority of the files/foldes, the script finds
pmienk20:16
how are you invoking generate.sh?
P
Phil20:17
$ ./generate.sh
pmienk20:21
and the permissions for the subtree make it accessable to the user?
P
Phil20:22
I suppose so. I just cloned all the repos with the same user
Except one of them. I’ll try again.
The output is pretty much the same, if someone wants to take a look.
Untitled Plain Text · 20.4 KB
$ ./generate.sh                                                                                                                                                                                                                            
gsl/4 M: Generating copy_modules.sh...
gsl/4 M:  Evaluating repository: libbitcoin-blockchain
gsl/4 M:  Evaluating repository: libbitcoin-client
gsl/4 M:  Evaluating repository: libbitcoin-consensus
gsl/4 M:  Evaluating repository: libbitcoin-database
gsl/4 M:  Evaluating repository: libbitcoin-explorer
gsl/4 M:  Evaluating repository: libbitcoin-network
gsl/4 M:  Evaluating repository: libbitcoin-node
gsl/4 M:  Evaluating repository: libbitcoin-protocol
gsl/4 M:  Evaluating repository: libbitcoin-server
gsl/4 M:  Evaluating repository: libbitcoin-system
gsl/4 M: Generating copy_properties.sh...
gsl/4 M:  Evaluating repository: libbitcoin-blockchain
gsl/4 M:  Evaluating repository: libbitcoin-client
gsl/4 M:  Evaluating repository: libbitcoin-consensus
gsl/4 M:  Evaluating repository: libbitcoin-database
gsl/4 M:  Evaluating repository: libbitcoin-explorer
gsl/4 M:  Evaluating repository: libbitcoin-network
gsl/4 M:  Evaluating repository: libbitcoin-node
gsl/4 M:  Evaluating repository: libbitcoin-protocol
gsl/4 M:  Evaluating repository: libbitcoin-server
gsl/4 M:  Evaluating repository: libbitcoin-system
gsl/4 M: Generating generate_artifacts.sh...
gsl/4 M: Generating output/libbitcoin-blockchain/include/bitcoin/blockchain/version.hpp...
gsl/4 M: Generating output/libbitcoin-client/include/bitcoin/client/version.hpp...
gsl/4 M: Generating output/libbitcoin-consensus/include/bitcoin/consensus/version.hpp...
gsl/4 M: Generating output/libbitcoin-database/include/bitcoin/database/version.hpp...
gsl/4 M: Generating output/libbitcoin-explorer/include/bitcoin/explorer/version.hpp...
gsl/4 M: Generating output/libbitcoin-network/include/bitcoin/network/version.hpp...
gsl/4 M: Generating output/libbitcoin-node/include/bitcoin/node/version.hpp...
gsl/4 M: Generating output/libbitcoin-protocol/include/bitcoin/protocol/version.hpp...
gsl/4 M: Generating output/libbitcoin-server/include/bitcoin/server/version.hpp...
gsl/4 M: Generating output/libbitcoin-system/include/bitcoin/system/version.hpp...
gsl/4 M: Directory open failure: /path/to/libbitcoin-blockchain/libbitcoin-blockchain-test_runner.sh: No such file or directory
gsl/4 M: Generating output/libbitcoin-blockchain/autogen.sh...
gsl/4 M: Generating output/libbitcoin-client/autogen.sh...
gsl/4 M: Generating output/libbitcoin-consensus/autogen.sh...
gsl/4 M: Generating output/libbitcoin-database/autogen.sh...
gsl/4 M: Generating output/libbitcoin-explorer/autogen.sh...
full file
pmienk20:31
and you're sure libbitcoin-blockchain exists?
pmienk20:47
all the errors in what you've posted refer to blockchain - specifically in what look to be attempts to enumerate files of that project.
given that it's the first project by name, it could be that the relative path between your execution of generate.sh and the root of all your projects is mismatched.

Wednesday, February 13, 2019

P
Phil14:57
@pmienk Yes. I just noticed that the ‘generate.sh’ script cannot find only a file called ‘libbitcoin-blockchain/libbitcoin-blockchain-test_runner.sh’ and a folder called ‘libbitcoin-blockchain/src/validate’ and I do have both in the exact location the script searches for.
Any thoughts?
neillm14:58
I haven't seen an error where it can't find /path/to rather than having a real path in there. Not sure
P
Phil15:03
The real path was too big, than I replaced to /path/to to post here
neillm15:05
Wouldn't it just be ../?
P
Phil15:06
No, it gives me the whole path
neillm15:07
Did you try rm -rf the directory and re-cloning?
P
Phil15:08
I think so. Anyway, I’ll try it again to be sure.
P
Phil15:46
@neillm I did it and I still get the error
Wait, now it fails on the opening of some folders of libbitcoin
P
Phil15:56
@neillm Maybe it’s something with gsl or something in the system. I just tried in another system and it’s all good.
👍 1

Monday, February 18, 2019

skaht17:50
1m5.io
Invisible Matrix Services

Wednesday, February 20, 2019

N
narodnik08:42
nice initiative but they will need to build custom layers, this approach will be inadequate by itself

Thursday, February 21, 2019

jungly21:57
Hi all, @evoskuil mentioned there was an android wrapper to libbitcoin-system|client. I can’t seem to find it in the libbitcoin org cause I think we are not maintaining it. Does anyone know where I can find it?
pmienk22:04
I believe compilation support was added so that libbitcoin-system supported compilation for android. I don't recall any wrapper.
jungly22:04
ah. yes.. that’s what Eric mentioned. I got confused. That’s bang on. Thanks a million.
evoskuil23:04
@narodnik ?

Saturday, February 23, 2019

thomas15:09
Bitcoin Developer Network
In this tutorial, we will be taking a closer look at libbitcoin, a multipurpose bitcoin library targeted at high-end use. An ideal backend to build fast implementations on top: mobile apps, desktop clients and server API's.
👍 3👏🏾 1

Sunday, February 24, 2019

N
narodnik08:18
@evoskuil I meant that link posted above comment
"The pattern I'm seeing is that it really does help to add CPUs, but only if the amount of transactions in a block, and thus the block size, goes up. Or, the other way around, as the block size increases it is beneficial to add cores and keep the processing time down."
N
narodnik08:27
BTW the new C++20 looks amazing, a bigger change to the language than even C++11 adding modules, coroutines, loads of stuff
Also executors which is kind of like the libbitcoin threadpool system used
neillm19:19
Having intermittent power issues. mainnet2/testnet2 will be down for the next few hours (likely starting in 15-20 minutes or so), should be back up later today.
(edited)
👍 2
skaht22:27
Looking like BLS threshold signatures can facilitate PoW block aggregation in a leaderless way to not give any one miner an advantage while producing rhythmic big blocks and facilitating parallelization.
3 replies · evoskuil, skaht · last Feb 26, 2019
evoskuil22:36
How so?
skaht16:05
This is my naive understanding. With BLS, nobody knows the result of the aggregate signature until enough small signed mined blocks come together. Individual PoW mined small block signature results are causal, but aggregate signature results are random until the threshold is achieved. Many small blocks propagate better than one big block.
evoskuil16:10
Sorry, not following any of that - but I don't dabble in futures much. Do you have any sort of reference?
evoskuil22:36
replied to a thread: view
How so?
neillm23:01
mainnet2/testnet2 back online
🕺 1👍 1

Tuesday, February 26, 2019

T
Terry Bennett15:07
When building libbitcoin-system.lib for Windows, is there a preferred version of the boost dependencies? When I use the latest version, it says it cant find boost.targets (It says its in version 1.64). When I use 1.64, it successfully builds the library but I receive syntax errors in the boost libraries after implementing in my project. I'm using Windows SDK 10.0.17134.0
T
Terry Bennett15:16
I'm also using visual studios 2017
T
Terry Bennett15:29
It looks like the version 1.64 boost libraries are not compatible with newer versions of visual studio beyond 2005. I'm updating them to version 1.67 and will try to work through the build errors of missing file boost.target
The missing file is ..\..\..\..\..\.nuget\packages\boost.1.64.0.0\build\native\boost.targets.
neillm15:37
@Terry Bennett Unfortunately, I can't offer much Windows build help, but @pmienk or @evoskuil should be able to.
T
Terry Bennett15:52
@neillm I appreciate getting back to me, hopefully I can get a response from them
neillm15:52
You will, just depends on when they're on 😉
👍 1
evoskuil16:03
The builds reference specific versions of nuget dependencies, including boost (1.64.0.0 for vs 2015/2017, 1.57.0.0 for vs 2013).
It looks like the version 1.64 boost libraries are not compatible with newer versions of visual studio beyond 2005.
How so?
evoskuil16:12
FWIW I build all libbitcoin libs with vs2017 regularly and older versions less frequently.
T
Terry Bennett16:22
I found what the problem was, in the .vcxproj file. Nuget wasnt removing import for the older version: <Import Project="$(NuGetPackageRoot)boost_thread-vc141.1.64.0.0\build\native\boost_thread-vc141.targets" Condition="Exists('$(NuGetPackageRoot)boost_thread-vc141.1.64.0.0\build\native\boost_thread-vc141.targets')" /> but if you manually remove the references to the old versions of the boost packages. it successfully builds libbitcoin-systems.lib
T
Terry Bennett16:45
@evoskuil I had thought they were incompatible because when I would bring them into my project, i would get errors related to which visual studios version i was running. For example there was logic for is MSVS == 1300, or 1400. I figured since i wasnt running those versions that it wasnt compiling the code correctly which generated errors. I could of been mistaken though.
In my current project, its the standard Hello World but i added an #include <bitcoin/system.hpp> so when i build it would compile with the library. After implementing the library, it did generate these errors. I thought i would share them before i started tinkering with them.
T
Terry Bennett16:55
i added add _CRT_SECURE_NO_WARNINGS to my processor definitions to clear one of them up
Sorry, but I don’t know what you mean by removal of imports for older versions.
T
Terry Bennett17:25
ill import this now, in file explorer you can right click on the .vsxproj for libbitcoin-system and open in a text editor like notepad++ When you scroll down, you'll find many lines like these references the nuget packages: <Import Project="$(NuGetPackageRoot)boost_thread-vc141.1.64.0.0\build\native\boost_thread-vc141.targets" Condition="Exists('$(NuGetPackageRoot)boost_thread-vc141.1.64.0.0\build\native\boost_thread-vc141.targets')" /> When i updated them, it generated new versions of these import project lines of code, but didnt remove the older lines import projects code. When building it tried to import the wrong versions causing it to say that they were missing
this is after making the changes but there were many references to the older versions.
evoskuil17:30
Don’t update them.
T
Terry Bennett17:32
I'm definitely open to suggestions to get it to build without those changes
evoskuil17:34
You haven’t presented a problem description short of one caused by changing the configured boost version.
P
Phil17:35
Hey! Why is friend needed here if the implementation never touches a private attribute? https://github.com/libbitcoin/libbitcoin-system/blob/master/include/bitcoin/system/wallet/payment_address.hpp#L83-L84
T
Terry Bennett17:35
After updating the Nuget packages, when you try to build, you get this error message: The missing file is ..\..\..\..\..\.nuget\packages\boost.1.64.0.0\build\native\boost.targets.
neillm17:38
Stack Overflow
My question is in regards to friend functions as well as overloading the << and >>. From my understanding I thought friend functions could (and should) access private member variables directly.
2 replies · Phil · last Feb 27, 2019
P
Phil17:51
Thanks for sharing that, but still, @neillm, there is no access to private attribute on the methods implementations. So is friend needed?
P
Phil10:16
@neillm I figured it out why friend is needed on the overloading of >> and << in payment_address.hpp. friend makes the overloading a non-member method. So it can be declared in the right way inside the payment_address class. Interesting
T
Terry Bennett17:39
I discarded my changes so i can reproduce the issue, ill upload a snippet of the .vsxproj file that shows both old and newer version references.
This is after updating the boost dependencies in nuget
Notice the top half is requiring to import 1.64 versions even though they have been updated to 1.69
By removing those requirements for the older versions, it eliminates the error that they are missing
@evoskuil
neillm17:43
@Terry Bennett It's not clear if there's an error from a clean checkout w/o changes. What is that error?
T
Terry Bennett17:43
Pasted image at 2019-02-26, 11:43 AM
Severity Code Description Project File Line Suppression State Error This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\..\..\..\.nuget\packages\boost.1.64.0.0\build\native\boost.targets. libbitcoin-system C:\Users\tb594\Documents\GitHub\libbitcoin-system\builds\msvc\vs2017\libbitcoin-system\libbitcoin-system.vcxproj 576
docs.microsoft.com
A description of common NuGet restore errors in Visual Studio and how to troubleshoot them.
neillm17:44
So you enable the downloads. Then what?
T
Terry Bennett17:45
Right, after enabling to download what packages are missing and updating the packages, i try to build
and i receive this error
evoskuil17:45
Just explicitly get the required nuget packages. Don’t upgrade them to new versions.
An easy way to do this is to run the build batch file, it includes the command to pull down the packages. But it’s also easily done manually.
T
Terry Bennett17:47
When i use the 1.64 versions i get boost syntax errors in the project. It'll take time but ill do this and post the errors
P
Phil17:51
replied to a thread: view
Thanks for sharing that, but still, @neillm, there is no access to private attribute on the methods implementations. So is friend needed?
neillm17:52
Not sure, maybe there was at some point
P
Phil17:53
Ok, thanks!
T
Terry Bennett18:12
@evoskuil After implementing the 1.64 version of boost to the libbitcoin-system.lib, building libbitcoin-system.lib and implementing libbitcoin-system.lib into my project with the 1.64 boost .libs and includes. It produces these errors when i try to build the standard "hello world" with an #include <bitcoin/system.hpp>
One of the errors is related to an elseif VisualStudio version is higher than 1400 which is visual studio 2005. Thats why i thought 1.64 wasnt compatible with 2017 but im probably mistaken
evoskuil18:24
I don’t know how you have set up your project. I suggest you modify the examples project and work backwards from there. https://github.com/libbitcoin/libbitcoin-system/tree/master/builds/msvc/vs2017/libbitcoin-system-examples
T
Terry Bennett18:25
Will do
(edited)

Wednesday, February 27, 2019

jbaczuk01:04
Hi, I’m trying to read through libbitcoin and I’m looking for main entry point to bx. I found BC_USE_LIBBITCOIN_MAIN, can you tell me where this is defined?
Actually I think I found it in libbitcoin-system/include/bitcoin/system/unicode/unicode.hpp
evoskuil03:03
This macro is only required for unicode compat in VC++ builds.
jbaczuk03:38
ok, is that the main entry point of bx, then?
evoskuil03:59
Yes
P
Phil10:16
replied to a thread: view
@neillm I figured it out why friend is needed on the overloading of >> and << in payment_address.hpp. friend makes the overloading a non-member method. So it can be declared in the right way inside the payment_address class. Interesting
haven't watched yet -- but jimmy discusses libbitcoin at some point
jungly18:19
we need to turn around that "is resource intensive" to "whoa, i tried it and it synched so quick!" 😉
👍 1
evoskuil18:19
@Phil In terms of code organization it’s preferable to scope methods within classes as opposed to implementing the same functionality as free functions. The downside is that the operator can only be overloaded in one direction, but often that’s not an important consideration.

Thursday, February 28, 2019

P
Phil08:52
@evoskuil Very interesting! Thanks for sharing that knowledge!
vdeurzen10:23
I attended a talk at CppCon two years ago that argued for more free functions, might be interesting to see: https://www.youtube.com/watch?v=WLDT1lDOsb4
evoskuil10:45
Use C, it’s all free functions.
vdeurzen10:52
stop programming then even you can be free 😉
4 replies · evoskuil, vdeurzen · last Mar 01, 2019
evoskuil19:05
I get it
vdeurzen19:06
just joking of course 😜
evoskuil01:16
I've made this decision more than once. Programming is all-consuming.
vdeurzen08:59
it certainly can be, I've missed some lunches and even dinner a couple of times due to the need to find that particular bug 0.o
T
Terry Bennett19:01
I'm going through the transaction example and there is an include file for <bitcoin/bitcoin.hpp> but in the libbitcoin-system directory there is a system folder & a system.hpp file. Where do you suggest retrieving this bitcoin.hpp file?
neillm19:02
@Terry Bennett The file (and repo) was renamed between version3 and version4
(edited)
T
Terry Bennett19:02
I see, so i should use system.hpp then
neillm19:02
If using master, yes
T
Terry Bennett19:03
Got it, was the namespace wallet updated as well?
neillm19:04
Yes, so bc::system::wallet is in master
T
Terry Bennett19:06
Awesome, that cleared up many errors from the transaction example. I am getting an error that base16_literal is undefined. Is there something missing from my includes or namespace?
Wait i think i know what the problem is, for some reason some of the files were not being included in the project
T
Terry Bennett19:18
I thought i had fixed it, but for some reason, visual studios isnt recognizing referenced files
Ill do some googling to see if i can get it figured out
I had to add this namespace: libbitcoin::system;
(edited)
neillm19:37
Yes, you also need bc::system for base16