<blockquote>
<ol>
<li>Coin only. No colors, no assets.</li>
</ol>
</blockquote>
<p>Yes, the bitcoin baselayer facilitates payments. You will find however, that Bitcoin on-chain payments are not cost efficient for micropayments as fees would eat large portions of the received funds.</p>
<blockquote>
<ol start="2">
<li>Receive coin using P2PK and / or P2PKH only?</li>
</ol>
</blockquote>
<p>There is no address standard for P2PK, so receiving to P2PK is not trivial at all. You could use P2PKH, but it is more than twice as expensive as more modern address formats. I would suggest to go with P2WPKH instead.</p>
<blockquote>
<ol start="3">
<li>For sending I can always stay with P2PK or P2PKH is that correct?</li>
</ol>
</blockquote>
<p>Yes, inputs must satisfy the locking script the output used which is defined by the address the receiver chose. If you receive funds to a P2PKH address, you have to spend them as a P2PKH input. I'd say receiving is easier, since it only requires deriving a new private key and the corresponding address, then polling whether the address got paid. Sending on the other hand requires you to estimate an appropriate feerate, select inputs to fund the transaction,  support a number of different output formats for compatibility, produce the correct signatures, build the transaction, and submit the transaction to the network.</p>
<p>You don't have to reinvent the wheel. There are libraries that will solve most of these issues out of the box, or you can set yourself up with a BTCPayServer which solves all of the above and enables you to send and receive Lightning Network payments.</p>

CC BY-SA 4.0
2021-04-12T00:50:40.080Z
thanks for the initial reply. I have tried, and found that BTCPayServer is overkilled. I can get it done easily with NBitcoin library
s k
CC BY-SA 4.0
2021-03-29T14:08:02.977Z
2021-03-29T14:08:02.977Z
Murch
<p>I have been working on Ethereum for years. Now assigned to work on Bitcoin. The way that BTC handle transaction is vastly different and utterly complicated.</p>
<p>After reading for quite sometime. Can I assume that for a simple website to receive and send bitcoin, I only need to handle the scenarios below:</p>
<ol>
<li><p>Coin only. No colors, no assets.</p>
</li>
<li><p>Receive coin using P2PK and / or P2PKH only?</p>
</li>
<li><p>For sending I can always stay with P2PK or P2PKH is that correct?</p>
</li>
</ol>
<p>Are the above sufficient for me to handle coins sent to my website and subsequently transfer to another account?</p>

CC BY-SA 4.0
2021-03-29T13:41:42.523Z
You ask how to handle sending and receiving, then give a way you want to handle receiving and ask whether you're done. To be honest, it feels too obvious to say "no, you also need to cover sending". If you're looking for a solution to set up a webshop or smth, perhaps you should take a look at BTCPayServer? Otherwise, you may need to elaborate your question a bit to clarify what you're trying to learn more about.
Murch
CC BY-SA 4.0
2021-03-29T13:48:10.097Z
Thanks Murch. I am assuming sending is more straight forward right? I can choose to stay with P2PK or P2PKH whenever I wish. Anyway let me update my question.
s k
<client><website-integration>
Send and Received BITCOIN
s k
# Send and Received BITCOIN

(Asked by: username_0 on 2021-03-29)

I have been working on Ethereum for years. Now assigned to work on Bitcoin. The way that BTC handle transaction is vastly different and utterly complicated.

After reading for quite sometime. Can I assume that for a simple website to receive and send bitcoin, I only need to handle the scenarios below:

1. Coin only. No colors, no assets.
2. Receive coin using P2PK and / or P2PKH only?
3. For sending I can always stay with P2PK or P2PKH is that correct?

Are the above sufficient for me to handle coins sent to my website and subsequently transfer to another account?

**Tags:** client, website-integration

> **Comments:**
> **username_1**: You ask how to handle sending and receiving, then give a way you want to handle receiving and ask whether you're done. To be honest, it feels too obvious to say "no, you also need to cover sending". If you're looking for a solution to set up a webshop or smth, perhaps you should take a look at BTCPayServer? Otherwise, you may need to elaborate your question a bit to clarify what you're trying to learn more about.  
> **username_0**: Thanks username_1. I am assuming sending is more straight forward right? I can choose to stay with P2PK or P2PKH whenever I wish. Anyway let me update my question.  

---

## 1 answers

### Answer by username_1 on 2021-03-29. Score: 3

> 1. Coin only. No colors, no assets.

Yes, the bitcoin baselayer facilitates payments. You will find however, that Bitcoin on-chain payments are not cost efficient for micropayments as fees would eat large portions of the received funds.

> 2. Receive coin using P2PK and / or P2PKH only?

There is no address standard for P2PK, so receiving to P2PK is not trivial at all. You could use P2PKH, but it is more than twice as expensive as more modern address formats. I would suggest to go with P2WPKH instead.

> 3. For sending I can always stay with P2PK or P2PKH is that correct?

Yes, inputs must satisfy the locking script the output used which is defined by the address the receiver chose. If you receive funds to a P2PKH address, you have to spend them as a P2PKH input. I'd say receiving is easier, since it only requires deriving a new private key and the corresponding address, then polling whether the address got paid. Sending on the other hand requires you to estimate an appropriate feerate, select inputs to fund the transaction, support a number of different output formats for compatibility, produce the correct signatures, build the transaction, and submit the transaction to the network.

You don't have to reinvent the wheel. There are libraries that will solve most of these issues out of the box, or you can set yourself up with a BTCPayServer which solves all of the above and enables you to send and receive Lightning Network payments.

> **Comments:**
> **username_0**: thanks for the initial reply. I have tried, and found that BTCPayServer is overkilled. I can get it done easily with NBitcoin library  

---

