<blockquote>
  <ol>
  <li>What is the BTC address I could use for creating a transaction?</li>
  </ol>
</blockquote>

<p>Any valid testnet address. You can get one from Bitcoin Core using the <code>getnewaddress</code> command.</p>

<blockquote>
  <ol start="2">
  <li>How do I "unlock" it to be able to send a transaction? </li>
  </ol>
</blockquote>

<p>Use the <code>walletpassphrase &lt;passphrase&gt; &lt;timeout&gt;</code> command where <code>&lt;passphrase&gt;</code> is your passphrase and <code>&lt;timeout&gt;</code> is the amount of time you want the wallet to be unlocked for. The wallet will automatically lock itself after the number of seconds specified in <code>&lt;timeout&gt;</code>.</p>

<blockquote>
  <ol start="3">
  <li>How do I add some BTC to it to be able to send it and/or pay for the transaction?</li>
  </ol>
</blockquote>

<p>To get regtest coins, you need to mine them yourself. Bitcoin Core can quickly and easily mine a bunch of blocks, just use the <code>generatetoaddress</code> command. Note that newly mined Bitcoin only become spendable after the coinbase transaction that produces them has 100 confirmations. So if you mine 101 blocks, you will be able to spend the 50 Bitcoin from the first block mined.</p>

<hr>

<p>For help with the RPCs, there is a <code>help</code> command. You can use that to get a list of available commands. Their names are pretty self explanatory. You can then do <code>help &lt;command&gt;</code> where <code>&lt;command&gt;</code> is some command you need help with. This will give you a more detailed description of the RPC, the parameters it takes, and what the result it returns will look like.</p>

CC BY-SA 4.0
2019-08-25T09:16:15.603Z
Sorry, I wasn't clear. By regtest I meant I was running it on my own machine only, not connecting to other nodes.
ulu
CC BY-SA 4.0
2019-08-25T16:44:55.140Z
Ah, I missed that. I updated my answer with regtest instructions.
Ava Chow
CC BY-SA 4.0
2019-08-24T16:06:33.160Z
2019-08-25T16:44:39.213Z
2019-08-25T16:44:39.213Z
Ava Chow
<p>I'm setting up a regtest node on my Windows machine using bitcoin-qt. Here's my config:</p>

<pre><code>regtest=1
txindex=1
server=1
[test]
rpcport=8332
rpcuser=ulu
rpcpassword=***
</code></pre>

<p>Next, I would like to run a transaction using RPC. However, I'm totally lost here:
 1. What is the BTC address I could use for creating a transaction?
 2. How do I "unlock" it to be able to send a transaction?
 3. How do I add some BTC to it to be able to send it and/or pay for the transaction?</p>

<bitcoin-core><regtest>
Loading seed coins in test mode
ulu
# Loading seed coins in test mode

(Asked by: username_0 on 2019-08-24)

I'm setting up a regtest node on my Windows machine using bitcoin-qt. Here's my config:

```
regtest=1
txindex=1
server=1
[test]
rpcport=8332
rpcuser=ulu
rpcpassword=***

```

Next, I would like to run a transaction using RPC. However, I'm totally lost here:
1. What is the BTC address I could use for creating a transaction?
2. How do I "unlock" it to be able to send a transaction?
3. How do I add some BTC to it to be able to send it and/or pay for the transaction?

**Tags:** bitcoin-core, regtest


---

## 1 answers

### Answer by username_1 on 2019-08-24. Score: 0 | Accepted answer

> 1. What is the BTC address I could use for creating a transaction?

Any valid testnet address. You can get one from Bitcoin Core using the `getnewaddress` command.

> 2. How do I "unlock" it to be able to send a transaction?

Use the `walletpassphrase <passphrase> <timeout>` command where `<passphrase>` is your passphrase and `<timeout>` is the amount of time you want the wallet to be unlocked for. The wallet will automatically lock itself after the number of seconds specified in `<timeout>`.

> 3. How do I add some BTC to it to be able to send it and/or pay for the transaction?

To get regtest coins, you need to mine them yourself. Bitcoin Core can quickly and easily mine a bunch of blocks, just use the `generatetoaddress` command. Note that newly mined Bitcoin only become spendable after the coinbase transaction that produces them has 100 confirmations. So if you mine 101 blocks, you will be able to spend the 50 Bitcoin from the first block mined.

---

For help with the RPCs, there is a `help` command. You can use that to get a list of available commands. Their names are pretty self explanatory. You can then do `help <command>` where `<command>` is some command you need help with. This will give you a more detailed description of the RPC, the parameters it takes, and what the result it returns will look like.

> **Comments:**
> **username_0**: Sorry, I wasn't clear. By regtest I meant I was running it on my own machine only, not connecting to other nodes.  
> **username_1**: Ah, I missed that. I updated my answer with regtest instructions.  

---

