<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="257006" data-post-id="257006">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LegitStack" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LegitStack/120/5086_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LegitStack
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I noticed one thing in my efforts that seems strange. the private key created by the erlang code is of a different length than that created by the ravencoin wallet. but they should both be using secp256k1:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(1)&gt; {public_key, private_key} = :crypto.generate_key(:ecdh, :secp256k1) 
iex(2)&gt;  private_key                                                                 
&lt;&lt;231, 49, 181, 107, 209, 99, 246, 12, 213, 213, 34, 123, 69, 214, 136, 98, 210,
  64, 135, 54, 173, 132, 143, 107, 5, 122, 131, 26, 33, 238, 154, 188&gt;&gt;
iex(3)&gt; Base.encode64(private_key) 
"5zG1a9Fj9gzV1SJ7RdaIYtJAhzathI9rBXqDGiHumrw="
iex(3)&gt; python_private_key
"L16mQdokXV8hVxGc8su2z9xNkavWPdGGM92B6nt2bMj8yhjTCF8Z"
</code></pre>
<p>same is true for the public keys and signatures</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257006" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/verifying-blockchain-crypto-signature-elixir-erlang/49226/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-257006" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257006"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="257031" data-post-id="257031">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LegitStack" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LegitStack/120/5086_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LegitStack
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>in the python version it’s a base58 encoded so I thought that was the reason, so I converted it to hex encoding and it still wasn’t the same…</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">codecs.encode(
  codecs.decode(
    base58_to_hex('L16mQdokXV8hVxGc8su2z9xNkavWPdGGM92B6nt2bMj8yhjTCF8Z'), 
    'hex'), 
  'base64'
).decode()
'gHPG8PzA12Hj9NHZD8aBzJHvb+5OguAKw62jTN3EFhCtAQ==\n'
</code></pre>
<p>which is 48 characters rather than 44 like the elixir version.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257031" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/verifying-blockchain-crypto-signature-elixir-erlang/49226/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-257031" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257031"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="257033" data-post-id="257033">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LegitStack" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LegitStack/120/5086_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LegitStack
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I appreciate the help you’ve offered me so far. I have to move on to another part of the system, but if anyone sees this, who can solve the issue, we made a bounty out of it:<br>
<a href="https://app.bountysource.com/issues/110284153-verify-cryptographic-signature-in-elixir-server" class="onebox" target="_blank" rel="noopener nofollow ugc">https://app.bountysource.com/issues/110284153-verify-cryptographic-signature-in-elixir-server</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257033" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/verifying-blockchain-crypto-signature-elixir-erlang/49226/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-257033" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257033"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="257040" data-post-id="257040">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hst337" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hst337
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The problem is that this ravencoin and satori use non-standard encoding</p>
<p>For example, ravencoin prepends some data to the signature, it signs the hash of the message and the public key is also prefixed by some magic bytes</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257040" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/verifying-blockchain-crypto-signature-elixir-erlang/49226/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-257040" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257040"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="257042" data-post-id="257042">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hst337" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hst337
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>And the ravencoin code is some spaghetti I’ve never seen with login in object constructor. sheeeesh</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257042" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/verifying-blockchain-crypto-signature-elixir-erlang/49226/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-257042" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257042"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="257056" data-post-id="257056">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LegitStack" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LegitStack/120/5086_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LegitStack
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Maybe the correct approach then, instead of implementing the corresponding magic in elixir is to write my own signing logic on the python side instead of using the python-ravencoinlib.</p>
<p>I’ll try that next, thanks for your help!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257056" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/verifying-blockchain-crypto-signature-elixir-erlang/49226/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-257056" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257056"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>