Bitcoin Forum
May 30, 2024, 09:31:31 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How are coins unique when creating wallet code  (Read 805 times)
divinity (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
January 19, 2014, 08:30:26 PM
 #1

Hello

As I understand it, the wallets come with source code to allow people verify the integrity of the code. As a programmer of different languages I can understand some (not all) of the wallet code and what it's trying to do. What I'm curious about though is how do you differentiate a coin from another one?

Say I loaded up Bitcoin code and changed some text so that "Send Coins" and "Receive Coins" was changed to "Send BTC" and "Receive BTC". I also changed a few colours. If I recompiled this code, I am surmising that I could use it on the BTC network without any issues.

I have heard of clone coins out there, just recompiled versions, so my question is... how does the network know when the code is different? Say you modify just one byte of a wallet to change the network fee, or you changed a value for the reward, I'm thinking it wouldn't work...

Is there a checksum or hash value or something? If I wanted to create a new coin and test it on the network (pre-mine) but when it came time to release the coin (without any pre-mining) what would I change to make the code different, unique, from my pre-mine testing code.

What I'm basically asking in plain English is, at what point does source code being modified actually make a DIFFERENT coin? Is it by creating a different node? Surely one does not just change the name of a coin and recompile and you have a new coin to mine... what makes the code unique?

Thanks.
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
January 19, 2014, 09:29:12 PM
 #2

Network does not care about the software you use.
It only cares to enforce the block chain protocol - you can use any software you want

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
divinity (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
January 19, 2014, 09:49:41 PM
 #3

What identifies the unique block chains once I go in and modify code on my end? If I set my code to generate 2x as many coins upon finding a block surely it would be seen as incorrect code.

Again what actually makes the chain unique. If Joe and John both compiled the same coin code, would each be its own coin or would 2 coins exist?

markjamrobin
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
January 19, 2014, 09:58:40 PM
 #4

What identifies the unique block chains once I go in and modify code on my end? If I set my code to generate 2x as many coins upon finding a block surely it would be seen as incorrect code.

Again what actually makes the chain unique. If Joe and John both compiled the same coin code, would each be its own coin or would 2 coins exist?



1. Your "block" would be rejected by the rest of the BTC network.
2. The peers that connect to each other. If Joe's network has no connections to John's network, it will be separate.

Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
January 19, 2014, 09:59:03 PM
 #5

What identifies the unique block chains once I go in and modify code on my end? If I set my code to generate 2x as many coins upon finding a block surely it would be seen as incorrect code.

Again what actually makes the chain unique. If Joe and John both compiled the same coin code, would each be its own coin or would 2 coins exist?


Well the first thing you do when creating a new coin is changing the default P2P port as well as the magic bytes.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
Apocalipsis
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
January 19, 2014, 10:01:52 PM
 #6

What identifies the unique block chains once I go in and modify code on my end? If I set my code to generate 2x as many coins upon finding a block surely it would be seen as incorrect code.

Again what actually makes the chain unique. If Joe and John both compiled the same coin code, would each be its own coin or would 2 coins exist?


Well the first thing you do when creating a new coin is changing the default P2P port as well as the magic bytes.


+1)

And divinity, don't forget about GENESIS BLOCK.(it separate you from  bitcoin network)
divinity (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
January 19, 2014, 10:12:55 PM
 #7

I'm still a little confused. I don't have any plans to release a coin (there are too many as is) but my programming mind is trying to grasp this.

1 ) Joe and John both download the source code for Doge. They compile it as is, no changes... would it run on the existing Doge network? Say that they added the same nodes as Doge uses.

2) Joe changes some code so that the block reward is twice what it ought to be, compiles it, and uses the same Doge nodes for his wallet. Should he mine, what would happen?

I guess what I'm not seeing is, with open source code available and so many clone coins, is what is to stop someone from changing code and using it with the same nodes. Somewhere in the code there must be some checksum or confirm that everything is the same?
Apocalipsis
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
January 19, 2014, 10:18:28 PM
 #8

I'm still a little confused. I don't have any plans to release a coin (there are too many as is) but my programming mind is trying to grasp this.

1 ) Joe and John both download the source code for Doge. They compile it as is, no changes... would it run on the existing Doge network? Say that they added the same nodes as Doge uses.

2) Joe changes some code so that the block reward is twice what it ought to be, compiles it, and uses the same Doge nodes for his wallet. Should he mine, what would happen?

I guess what I'm not seeing is, with open source code available and so many clone coins, is what is to stop someone from changing code and using it with the same nodes. Somewhere in the code there must be some checksum or confirm that everything is the same?


We call it GENESIS BLOCK(zero block,that should be mined firstly,ZERO block,it gives you HashSum(in your debug file),and you have to put it into your source file,just after that you should compile again your client, and your ALTcoin network can to work)
markjamrobin
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
January 19, 2014, 10:19:07 PM
 #9

I'm still a little confused. I don't have any plans to release a coin (there are too many as is) but my programming mind is trying to grasp this.

1 ) Joe and John both download the source code for Doge. They compile it as is, no changes... would it run on the existing Doge network? Say that they added the same nodes as Doge uses.

2) Joe changes some code so that the block reward is twice what it ought to be, compiles it, and uses the same Doge nodes for his wallet. Should he mine, what would happen?

I guess what I'm not seeing is, with open source code available and so many clone coins, is what is to stop someone from changing code and using it with the same nodes. Somewhere in the code there must be some checksum or confirm that everything is the same?


1. Yes.
2. His block would not be accepted by the BTC network.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4657



View Profile
January 19, 2014, 10:41:04 PM
 #10

2) Joe changes some code so that the block reward is twice what it ought to be, compiles it, and uses the same Doge nodes for his wallet. Should he mine, what would happen?

These cryptocurrencies are peer-to-peer decentralized systems.

This means that any set of peers that agree to the same set of rules belong to the same system, any peer that attempts to break those rules is rejected by the system, but accepted by any other peer that agrees with the broken rules.

Assuming that Joe hasn't modified the port that his wallet will communicate on. . .

If Joe rewards him self twice as much as he should, he broadcasts that block to every peer he is connected to.  Each of those peers validate the block before they accept it or relay it.  Since one of the protocol rules that a block has to meet to be considered a "valid" block is the size of the reward, every peer rejects the block and continues to wait for a valid block from a peer.  Meanwhile, Joe's wallet adds the block to his own blockchain.  Whether this results in a permanently forked blockchain for Joe (and he never accepts any blocks from the rest of the network), or results in his block being orphaned and eventually replaced by a longer chain from his peers will depend on the coding of Joe's wallet.  Does his wallet accept as valid blocks that have a smaller reward?

Now, if Joe can convince others to run his wallet software, then they will accept his blocks as valid.  Depending on the coding, this can result in a forked blockchain with users of Joe's software accepting some blocks, and users of the other software accepting other blocks.
divinity (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
January 19, 2014, 10:58:43 PM
 #11

Thank you all, I am now understanding it.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!