Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Snape14 on April 19, 2014, 11:01:46 PM



Title: Newly generated coins
Post by: Snape14 on April 19, 2014, 11:01:46 PM
I'm building my own system to accept bitcoin payments.
I give a new bitcoin address for a customer, wait for him to pay the bill, wait for 1 confirmation (using `listunspent`) and send the customer the product he paid for.
It seems to be the standard way to run things, but I have a question. What if instead of sending the coins from a wallet a customer would send me newly generated coins from a pool? ??? I'll not be able to spend them for 100 blocks. How to decline transactions from the pools (I mean not to return the funds, but not to send the customer the product)?
Or if the money came from a pool, `listunspent` would show confirmations as 0 until 100 new blocks and I just could write "We don't accept generated coins" on my website?


Title: Re: Newly generated coins
Post by: jbrnt on April 19, 2014, 11:23:37 PM
100 blocks is only about 17hrs. Can't you add a warning saying newly generated coins may take up to 24hrs to confirm so product dispatch may be delayed.





Title: Re: Newly generated coins
Post by: mriou on April 20, 2014, 02:21:20 AM
They won't be able to spend them in the first place so they can't pay you with mined coins until they reached the 100 confirmations. Not a problem.


Title: Re: Newly generated coins
Post by: ncsupanda on April 20, 2014, 02:25:58 AM
They won't be able to spend them in the first place so they can't pay you with mined coins until they reached the 100 confirmations. Not a problem.

This. They can't get the coins until it reaches the confirmation threshold of the pool, at which point it's a moot point for you to worry about anyway.


Title: Re: Newly generated coins
Post by: cp1 on April 20, 2014, 04:03:24 AM
Yeah, unless for some strange reason they set you as the coinbase for the mined block you'll be fine.


Title: Re: Newly generated coins
Post by: Snape14 on April 20, 2014, 02:13:27 PM
Thank you for your replies.
Yeah, unless for some strange reason they set you as the coinbase for the mined block you'll be fine.
I agree, that is true for Bitcoin. However, if in the future I would add let's say Crapcoin, the probability someone would set me money as the coinbase becomes higher.

I think I've found a solution to the problem.
If we use listreceivedbyaddress we may txids for each address. Then we use getrawtransaction & decoderawtransaction to determine if it's a newly generated coins.

It there a simpler solution?


Title: Re: Newly generated coins
Post by: KaChingCoinDev on April 20, 2014, 09:58:03 PM
Thank you for your replies.
Yeah, unless for some strange reason they set you as the coinbase for the mined block you'll be fine.
I agree, that is true for Bitcoin. However, if in the future I would add let's say Crapcoin, the probability someone would set me money as the coinbase becomes higher.

I think I've found a solution to the problem.
If we use listreceivedbyaddress we may txids for each address. Then we use getrawtransaction & decoderawtransaction to determine if it's a newly generated coins.

It there a simpler solution?

New transactions in general are not allowed to be traded if they are newly generated. No coin has changed that yet. So, accept DOGE, LTC, CRAP, whatever, and it will not allow sending newly mined coins.


Title: Re: Newly generated coins
Post by: Snape14 on April 21, 2014, 02:12:58 AM
Thank you for your replies.
Yeah, unless for some strange reason they set you as the coinbase for the mined block you'll be fine.
I agree, that is true for Bitcoin. However, if in the future I would add let's say Crapcoin, the probability someone would set me money as the coinbase becomes higher.

I think I've found a solution to the problem.
If we use listreceivedbyaddress we may txids for each address. Then we use getrawtransaction & decoderawtransaction to determine if it's a newly generated coins.

It there a simpler solution?

New transactions in general are not allowed to be traded if they are newly generated. No coin has changed that yet. So, accept DOGE, LTC, CRAP, whatever, and it will not allow sending newly mined coins.

The problem is, if I understand the process of mining correctly, that someone can set my address as the address to send a POW or POS reward when a new block is mined.


Title: Re: Newly generated coins
Post by: cyrpi4 on April 21, 2014, 03:49:05 AM
Let us know when you end building your system to accept bitcoin payments. I'd like to try it and watch how it works ;)


Title: Re: Newly generated coins
Post by: DannyHamilton on April 21, 2014, 03:52:44 AM
The problem is, if I understand the process of mining correctly, that someone can set my address as the address to send a POW or POS reward when a new block is mined.

And it is easy to determine that has happened.

Make sure that you clearly state with whatever service you are offering that such a payment method is not acceptable.  Then when you receive a payment, verify that it isn't a reward payment.  If it is, treat it as if you haven't been paid yet.  When the customer complains that their payment hasn't been recognized, you can point them to your clearly indicated payment rules, and let them know that once the reward is spendable, you'll refund it to them.


Title: Re: Newly generated coins
Post by: jparsley on April 21, 2014, 09:28:40 AM
They cant spend them till 100 blocks, unless they were mining using ur address


Title: Re: Newly generated coins
Post by: KaChingCoinDev on April 21, 2014, 10:38:49 AM
Thank you for your replies.
Yeah, unless for some strange reason they set you as the coinbase for the mined block you'll be fine.
I agree, that is true for Bitcoin. However, if in the future I would add let's say Crapcoin, the probability someone would set me money as the coinbase becomes higher.

I think I've found a solution to the problem.
If we use listreceivedbyaddress we may txids for each address. Then we use getrawtransaction & decoderawtransaction to determine if it's a newly generated coins.

It there a simpler solution?

New transactions in general are not allowed to be traded if they are newly generated. No coin has changed that yet. So, accept DOGE, LTC, CRAP, whatever, and it will not allow sending newly mined coins.

The problem is, if I understand the process of mining correctly, that someone can set my address as the address to send a POW or POS reward when a new block is mined.

You are correct. I would put a note like cryptsy to say "Do not mine to this address", only send confirmed coins.


Title: Re: Newly generated coins
Post by: cp1 on April 21, 2014, 03:56:25 PM
You are correct. I would put a note like cryptsy to say "Do not mine to this address", only send confirmed coins.

They'd have to be solo mining, not on a pool or going through an exchange.  And I'm sure bitcoind won't show them as spendable, so just check that and you'll be covered in this super duper rare case that will never ever happen.


Title: Re: Newly generated coins
Post by: cr1776 on April 21, 2014, 04:07:53 PM
You are correct. I would put a note like cryptsy to say "Do not mine to this address", only send confirmed coins.

They'd have to be solo mining, not on a pool or going through an exchange.  And I'm sure bitcoind won't show them as spendable, so just check that and you'll be covered in this super duper rare case that will never ever happen.

A few pools send newly mined coins - p2pool for example, although that is the exception.

:-)