11 Commits

Author SHA1 Message Date
tomFlowee 4845de2470 Add PrivateKey::fromBase58() 2024-05-01 21:55:25 +02:00
tomFlowee 2d0aec2cd7 Rename file to match class it is in
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

key.{h|cpp} -> PrivateKey.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee b5b493542b Rework base58 and tests
The unit tests testing base58 encoding were using univalue JSON
parsing, since we deprecatd univalue to be a hub-private lib
this has now been ported to Qts JSON parser.
Which also makes the clunky cmake hack nice to replace with the
QRC files concept.

As I was in there anyway, the base58 methods being global scope
C-style methods has now been fixed by putting them in a namespace.
2022-12-13 11:34:54 +01:00
tomFlowee 05bbba3cb3 Rename class CKey -> PrivateKey 2022-07-06 22:12:33 +02:00
tomFlowee cca8a885bc Fix coding style issues
Follow the coding styleguide and make the methods lowercase on CKey
2022-05-11 13:46:15 +02:00
tomFlowee e30c4ceca5 Wrap new feature in ifdef
The API-wise nice addition of base58 encoding learning about
private keys has as a downside that external projects get the
surprise of pulling in a lot more code.

Those that want to avoid this, while not using private keys, can
simply add
  add_definitions(-DNPRIVKEY)  # avoid private-key using code
to their CMake file.
2021-08-09 20:04:27 +02:00
tomFlowee 3bac1cc9e0 Add setData for CKey style data. 2021-07-31 17:36:15 +02:00
tomFlowee 6a92cbf695 Add easier way to set the id on a base58 data. 2021-01-05 22:38:57 +01:00
TomZ 9f0a75839a Process static checks warnings 2020-12-06 13:18:08 +01:00
TomZ 8796dc4b7d Add support for testnet addresses
Notice that we only use 2 type of base58 prefixes, mainnet and everything
else. So this support all worthless chains.
2020-10-30 18:08:09 +01:00
TomZ 707d2212de Move encoding (base58) out of server lib
Also write some new accessor methods on the baseclass.

The longer term idea is to make the server itself only use the uint160
raw version for bitcoin addresses.
For now move the encodings (between that uint160 and human-readable) to
the utils library.
2019-04-11 16:20:04 +02:00