user58283: The writer of this article https://pastebin.com/raw/jCDFcESz explains that 
Sha256('sender') x 2  yields the address    18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1
I am however getting the address 1DcTtaa37w971TmoafPpE9Pk16xc42YA87
What am I doing wrong?

user12983: static void test ( )
{
  const MyByteArray x ( QByteArray ( "sender" ) );
  _trace ( x.sha256  ( ).getAddressHashCompressed ( ).toString ( ) );
  _trace ( x.sha256d ( ).getAddressHashCompressed ( ).toString ( ) );
}

the output is:
1DcTtaa37w971TmoafPpE9Pk16xc42YA87
18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1

So, your code runs sha256 only once, but not twice

user10377: % echo -n "sender" | bx base16-encode | bx sha256 | bx sha256 | bx ec-to-public | bx ec-to-address -v 0
18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1
% echo -n "sender" | bx base16-encode | bx sha256 | bx ec-to-public | bx ec-to-address -v 0
1DcTtaa37w971TmoafPpE9Pk16xc42YA87

user60443: A few things to check:

Make sure you are computing the HASH256 on the decoded byte values of the string. In other words, HASH256(0x73656e646572)
Make sure you are doing 2 rounds of SHA256
Using secp256k1 to generate a compressed public key
This is a P2PKH address (prefix is 1) so the steps to generate the address from the public key are:


pubkeyhash = HASH160(compressed pubkey) i.e.RIPEMD160(SHA256(compressed pubkey)
prepend 00 byte prefix for P2PKH
BASE58CHECK(pubkeyhash)


$ echo -n sender | openssl sha256
(stdin)= 0a367b92cf0b037dfd89960ee832d56f7fc151681bb41e53690e776f5786998a

$ echo 0a367b92cf0b037dfd89960ee832d56f7fc151681bb41e53690e776f5786998a | xxd -r -p | openssl sha256
(stdin)= 098f6d68ce86adb2d8ba672a06227f7d177baca3568092e4cda159acca5eb0c7

$ openssl ec -inform DER -text -noout -in <(cat <(echo -n "302e0201010420") <(echo -n "098f6d68ce86adb2d8ba672a06227f7d177baca3568092e4cda159acca5eb0c7") <(echo -n "a00706052b8104000a") | xxd -r -p) 2>/dev/null | tail -6 | head -5 | sed 's/[ :]//g' | tr -d '\n' && echo
04f4e5977bcb050452289ebc750b56be65086bfdf3411bb9c346430716545d66b8dede7516256f34fa362b10b3ec85ccdf58c25733e00e5d33120fb66a79e596f6

# result is even (ends in 0xf6) so prefix first 32 bytes with 02 (for odd use 03)
$ echo 02f4e5977bcb050452289ebc750b56be65086bfdf3411bb9c346430716545d66b8 | xxd -r -p | openssl sha256
(stdin)= cb59a26ae2e385719a66f568476bace40a8789c5fe91d74be6381e29feb20ecb

$ echo cb59a26ae2e385719a66f568476bace40a8789c5fe91d74be6381e29feb20ecb | xxd -r -p | openssl ripemd160
(stdin)= 53178717ab3d70c50fe8ec8598a9c2a8a703abc5

$ echo 0053178717ab3d70c50fe8ec8598a9c2a8a703abc5 | xxd -r -p | base58 -c && echo
18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1

using base58

58283: <p>The writer of this article <a href="https://pastebin.com/raw/jCDFcESz" rel="nofollow noreferrer">https://pastebin.com/raw/jCDFcESz</a> explains that </p>

<p><code>Sha256('sender') x 2</code>  yields the address    <code>18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1</code></p>

<p>I am however getting the address <code>1DcTtaa37w971TmoafPpE9Pk16xc42YA87</code></p>

<p>What am I doing wrong?</p>
 12983: <pre><code>static void test ( )
{
  const MyByteArray x ( QByteArray ( "sender" ) );
  _trace ( x.sha256  ( ).getAddressHashCompressed ( ).toString ( ) );
  _trace ( x.sha256d ( ).getAddressHashCompressed ( ).toString ( ) );
}
</code></pre>

<p>the output is:</p>

<pre><code>1DcTtaa37w971TmoafPpE9Pk16xc42YA87
18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1
</code></pre>

<p>So, your code runs sha256 only once, but not twice</p>
 10377: <p><code>% echo -n "sender" | bx base16-encode | bx sha256 | bx sha256 | bx ec-to-public | bx ec-to-address -v 0</code></p>

<p><strong>18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1</strong></p>

<p><code>% echo -n "sender" | bx base16-encode | bx sha256 | bx ec-to-public | bx ec-to-address -v 0</code></p>

<p><strong>1DcTtaa37w971TmoafPpE9Pk16xc42YA87</strong></p>
 60443: <p>A few things to check:</p>

<ol>
<li>Make sure you are computing the <code>HASH256</code> on the decoded byte values of the string. In other words, <code>HASH256(0x73656e646572)</code></li>
<li>Make sure you are doing 2 rounds of <code>SHA256</code></li>
<li>Using secp256k1 to generate a compressed public key</li>
<li>This is a <code>P2PKH</code> address (prefix is 1) so the steps to generate the address from the public key are:

<ol>
<li><code>pubkeyhash = HASH160(compressed pubkey)</code> i.e.<code>RIPEMD160(SHA256(compressed pubkey)</code></li>
<li>prepend <code>00</code> byte prefix for <code>P2PKH</code></li>
<li><code>BASE58CHECK(pubkeyhash)</code></li>
</ol></li>
</ol>



<pre><code>$ echo -n sender | openssl sha256
(stdin)= 0a367b92cf0b037dfd89960ee832d56f7fc151681bb41e53690e776f5786998a

$ echo 0a367b92cf0b037dfd89960ee832d56f7fc151681bb41e53690e776f5786998a | xxd -r -p | openssl sha256
(stdin)= 098f6d68ce86adb2d8ba672a06227f7d177baca3568092e4cda159acca5eb0c7

$ openssl ec -inform DER -text -noout -in &lt;(cat &lt;(echo -n "302e0201010420") &lt;(echo -n "098f6d68ce86adb2d8ba672a06227f7d177baca3568092e4cda159acca5eb0c7") &lt;(echo -n "a00706052b8104000a") | xxd -r -p) 2&gt;/dev/null | tail -6 | head -5 | sed 's/[ :]//g' | tr -d '\n' &amp;&amp; echo
04f4e5977bcb050452289ebc750b56be65086bfdf3411bb9c346430716545d66b8dede7516256f34fa362b10b3ec85ccdf58c25733e00e5d33120fb66a79e596f6

# result is even (ends in 0xf6) so prefix first 32 bytes with 02 (for odd use 03)
$ echo 02f4e5977bcb050452289ebc750b56be65086bfdf3411bb9c346430716545d66b8 | xxd -r -p | openssl sha256
(stdin)= cb59a26ae2e385719a66f568476bace40a8789c5fe91d74be6381e29feb20ecb

$ echo cb59a26ae2e385719a66f568476bace40a8789c5fe91d74be6381e29feb20ecb | xxd -r -p | openssl ripemd160
(stdin)= 53178717ab3d70c50fe8ec8598a9c2a8a703abc5

$ echo 0053178717ab3d70c50fe8ec8598a9c2a8a703abc5 | xxd -r -p | base58 -c &amp;&amp; echo
18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1
</code></pre>

<p>using <a href="https://github.com/keis/base58" rel="nofollow noreferrer">base58</a></p>
