user82069: Can anyone tell me the specified source code to make "checksum bits appended", before doing Base58 conversion? Thanks very much!!!!

user60443: See src/base58.cpp Line 124:
std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
{
    // add 4-byte hash check to the end
    std::vector<unsigned char> vch(vchIn);
    uint256 hash = Hash(vch.begin(), vch.end());
    vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
    return EncodeBase58(vch);
}

As you can see, the data vch is hashed, then the first 4 bytes of the hash are appended to the end of vch before base58 encoding.

82069: <p>Can anyone tell me the specified source code to make "checksum bits appended", before doing Base58 conversion? Thanks very much!!!!</p>
 60443: <p>See <a href="https://github.com/bitcoin/bitcoin/blob/v0.16.2/src/base58.cpp#L124" rel="nofollow noreferrer">src/base58.cpp Line 124</a>:</p>

<pre><code>std::string EncodeBase58Check(const std::vector&lt;unsigned char&gt;&amp; vchIn)
{
    // add 4-byte hash check to the end
    std::vector&lt;unsigned char&gt; vch(vchIn);
    uint256 hash = Hash(vch.begin(), vch.end());
    vch.insert(vch.end(), (unsigned char*)&amp;hash, (unsigned char*)&amp;hash + 4);
    return EncodeBase58(vch);
}
</code></pre>

<p>As you can see, the data <code>vch</code> is hashed, then the first 4 bytes of the hash are appended to the end of <code>vch</code> before base58 encoding.</p>
