Author

Topic: How are coins unique when creating wallet code (Read 824 times)

member
Activity: 70
Merit: 10
January 19, 2014, 05:58:43 PM
#11
Thank you all, I am now understanding it.
legendary
Activity: 3472
Merit: 4801
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.
sr. member
Activity: 462
Merit: 250
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.
full member
Activity: 147
Merit: 100
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)
member
Activity: 70
Merit: 10
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?
full member
Activity: 147
Merit: 100
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)
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
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.
sr. member
Activity: 462
Merit: 250
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.
member
Activity: 70
Merit: 10
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?

legendary
Activity: 2053
Merit: 1356
aka tonikt
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
member
Activity: 70
Merit: 10
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.
Jump to: