seredat / karbowanec

Karbo (Karbovanets) - Digital Exchange Medium - cryptocurrency made in Ukraine, CryptoNote protocol implementation.
https://karbo.io/
Other
104 stars 66 forks source link

Proper Base58 encoding of proofs #121

Closed aivve closed 4 years ago

aivve commented 4 years ago

Change the way the "transaction / payment proof" and "reserve / balance proof" are encoded.

Instead of adding ProofV1 to the beginning of the string of the Base58 encoded proof, use proper Base58 encoding with varint prefix tag which allows checking decoded data with checksum, just as CryptoNote address is encoded. The same applies to the "reserve proof": instead of adding ReserveProofV1 piece to Base58 encoded string of the reserve proof use proper encoding.

For this purpose two prefix tags are introduced: const uint64_t CRYPTONOTE_TX_PROOF_BASE58_PREFIX = 3576968; // (0x369488), starts with "Proof..." const uint64_t CRYPTONOTE_RESERVE_PROOF_BASE58_PREFIX = 44907175188; // (0xa74ad1d14), starts with "RsrvPrf..."

Of course, this will require the update of the wallets so the generated proofs can be verified on new nodes.