<blockquote>
<p><strong>I have a java code that I need to pass to python</strong></p>
</blockquote>
<p>Unless the same library has been ported to both languages, there will probably be no direct equivalent.</p>
<p>Instead it will probably be best to describe what you want to achieve and select <a href="https://www.google.com/search?q=pythion+bitcoin+library" rel="nofollow noreferrer">a well-known Python bitcoin library</a> and work from the examples</p>

CC BY-SA 4.0
2023-04-05T09:56:41.430Z
2023-04-05T09:56:41.430Z
RedGrittyBrick
<p>I have a java code that I need to pass to python but I don't know which libraries to use and how to start and if you can help me I would really appreciate it</p>
<pre><code>MNEMONIC = &quot;twenty four mnemonic words hereí&quot; ACCOUNT_KEY = &quot;&quot; WALLET_PRIVATE_KEY = &quot;&quot;


// We will generate 3 parameters here // 1. hashSecret // 2. encryptedSecret // 3. hashPublicKey

const epochTimeNow = Fecha.ahora().toString()

const secret = getDeterministicTradeSecret(MNEMONIC, epochTimeNow) // This function is defined below 

const hashSecret = hash160(secret)

const encryptedSecret = encryptTradeSecret (secreto, ACCOUNT_KEY, indefinido)

const publicKey = privateKeyToPublic(privateKey) 

const hashPublicKey = hash160(publicKey)

const btc_trade_secrets = {crypted_secret:cryptedSecret, hash_secret:hashedSecret,hashed_public_key:hashedPublicKey,}
</code></pre>

CC BY-SA 4.0
2023-05-05T17:02:37.023Z
I’m voting to close this question because this is not a place for coding assistance or general software development questions.
Antoine Poinsot
<python><javascript><block-hash><python-bitcoinlib>
Recreate Java code in python
you1977
# Recreate Java code in python

(Asked by: username_0 on 2023-04-05)

I have a java code that I need to pass to python but I don't know which libraries to use and how to start and if you can help me I would really appreciate it
MNEMONIC = "twenty four mnemonic words hereí" ACCOUNT_KEY = "" WALLET_PRIVATE_KEY = ""


// We will generate 3 parameters here // 1. hashSecret // 2. encryptedSecret // 3. hashPublicKey

const epochTimeNow = Fecha.ahora().toString()

const secret = getDeterministicTradeSecret(MNEMONIC, epochTimeNow) // This function is defined below 

const hashSecret = hash160(secret)

const encryptedSecret = encryptTradeSecret (secreto, ACCOUNT_KEY, indefinido)

const publicKey = privateKeyToPublic(privateKey) 

const hashPublicKey = hash160(publicKey)

const btc_trade_secrets = {crypted_secret:cryptedSecret, hash_secret:hashedSecret,hashed_public_key:hashedPublicKey,}

**Tags:** python, javascript, block-hash, python-bitcoinlib

> **Comments:**
> **username_1**: I’m voting to close this question because this is not a place for coding assistance or general software development questions.  

---

## 1 answers

### Answer by username_2 on 2023-04-05. Score: 1

> **I have a java code that I need to pass to python**

Unless the same library has been ported to both languages, there will probably be no direct equivalent.

Instead it will probably be best to describe what you want to achieve and select [a well-known Python bitcoin library](https://www.google.com/search?q=pythion+bitcoin+library) and work from the examples


---

