This is a C++ implementation of BCR-0004 and BCR-0005.
Use this library to interface with airgapped hardware wallets such as Cobo Vault using QR codes.
Add bc-ur-cpp
as a submodule in your CMake project.
$ cd your_project/
$ git submodule add https://github.com/nunchuk-io/bc-ur-cpp
$ git submodule update --init --recursive
Add the following to your CMakeLists.txt
.
add_subdirectory(bc-ur-cpp)
target_link_libraries("${PROJECT_NAME}" PUBLIC ur)
Include <bc32.h>
to encode or decode BC32 data encoding format.
#include <bc32.h>
using namespace nunchuk::bcr;
std::string bc32Data = EncodeBc32Data(HexToBytes("..."));
std::vector<uint8_t> raw = DecodeBc32Data(bc32Data);
Include <ur.h>
to encode or decode Uniform Resources.
#include <ur.h>
using namespace nunchuk::bcr;
std::vector<std::string> payload = EncodeUniformResource(HexToBytes("...");
std::vector<uint8_t> raw = DecodeUniformResource(payload);
bc-ur-cpp
is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.