Bitcoin Forum
November 19, 2018, 08:40:29 AM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I need to learn how key pairing works for my own coin, help me start  (Read 32 times)
UrulaTheGiantBlueTurtle
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 14, 2018, 10:37:51 AM
 #1

Make no mistake, I'm of no delusion that there aren't hundreds of other wannabes with far more coding experience than I that are attempting to make their own blockchains. But bare with me and please help me out here on where I should begin my journey in study.

I want to create my own basic system where private/public keys can be used to verify a transaction. It doesn't need to be on a blockchain to begin with. I just want to learn how to generate keys and how to encrypt and decrypt them automatically through python for transaction verification on my own central database. I want this to be completely secure in terms of the only point of failure being the central database, and not the key pairs.

Here is exactly what I want to learn how to do:
Let's say a SQL database has the following table format. It simply has two columns ("public_key" text, "coin_balance" int). So each public key is paired with a coin balance in the table, nothing else, to keep it simple. Let's forget blockchain/decentraliation entirely at this point, so I can focus on the key pairing aspect alone. Now, I want to know how I can verify that a user is the actual owner of a public key when they send a query to the database. Eg:
Code:
"UPDATE "coin_balance" WHERE public_key=
".."  AND (conditional statements whereby user has proved ownership of public_key with their private key, without showing it to me or the database)". Ideally I will do all this in python.

So in essence, the user can only make transactions in the database if they have verified they own the public key with the associated coin balance. I don't want to know, and I don't want the database to ever know, what the users private key was (since if the database or I were hacked, this would be exposed). I only want it such that the user can send a string or key or something else that verifies ownership of the associated public key.

I have absolutely no experience with cryptography or key pairing, and so I'm not looking for an answer to the above problem, but rather if you could guide me on the specific resources I should study in the minimal amount of time that would allow me to do the above intuitively. I'm not looking to get a degree in cryptography, or to read an entire book explaining the fundamentals that still doesn't allow me to solve the above problem. I'm after specific direction on what I should read in order to implement the above as quickly as possible. I'll be hiring proper programmers later to work on my blockchain, but I just want to know that I can do everything myself first, without the code auditing/factoring and security that the proper programmers will provide.

Here's my current confusion: Current key pair generators such as for BTC and ETH.. are these exclusive to BTC or ETH, or could I use them on my own blockchain as well? For instance what about the Putty SSH key pair generator.. could I use that on a blockchain to verify identity? How do I actually generate these key pairs for a general purpose such as my own blockchain? My other confusion is how to avoid brute force attacks. Do I use a key/pair based on the same algorithm as BTC & ETH? Why do BTC & ETH have such different private key formats? Wouldn't they both use the same optimal and most secure one? How hard would it be to make the private/key pairing of my own blockchain secure? I'm willing to use APIs and already existing solutions, but the application will be for my own blockchain, not anywhere else.

As you can see, I know absolutely nothing about this subject, but wish to learn, however I don't want to get sidetracked in entire books of theory. I want to jump straight to practical understanding as soon as possible so that I can allow users of a database to verify ownership of their public key without exposing their private key to me, and I want to automate all this in python, and I want it to be as secure as Bitcoin or Ethereum in terms of the keypair being uncrackable (not as secure in terms of the blockchain, that is delusional, I'm just talking about the key pairing generation and verification here, not blockchain). So in essence, I don't want to build a blockchain to begin with, but rather just a centralized keypair verification system that could be used for basic transactions without exposing the users private key.

Where do I begin with my reading and study, and where do I end to arrive at my desired goal? If anyone is willing to go the extra mile and mentor me I'll give them some of the coins in my project for free. I'll be investing $10k of my own money into this project, so you can be assured that I'll be taking it seriously. I also have a lot of free time on my hands.
1542616829
Hero Member
*
Offline Offline

Posts: 1542616829

View Profile Personal Message (Offline)

Ignore
1542616829
Reply with quote  #2

1542616829
Report to moderator
1542616829
Hero Member
*
Offline Offline

Posts: 1542616829

View Profile Personal Message (Offline)

Ignore
1542616829
Reply with quote  #2

1542616829
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1542616829
Hero Member
*
Offline Offline

Posts: 1542616829

View Profile Personal Message (Offline)

Ignore
1542616829
Reply with quote  #2

1542616829
Report to moderator
1542616829
Hero Member
*
Offline Offline

Posts: 1542616829

View Profile Personal Message (Offline)

Ignore
1542616829
Reply with quote  #2

1542616829
Report to moderator
NeuroticFish
Legendary
*
Online Online

Activity: 1666
Merit: 1095


The real one is http://bitcoin.ORG


View Profile WWW
June 14, 2018, 10:57:55 AM
 #2

From what I know the private key is just a big number and the public key (address) is obtained from the private key.

For tests and reading you can use some of the link from https://bitcointalk.org/index.php?topic=4413938.msg39316953#msg39316953
I did a google for you python bitcoin private public key and the first 3 results already look useful, although I don't know python. One of them is for altcoins too.

If you know C# this could also be of help, for me it was: https://en.bitcoin.it/wiki/Bitcoin_Address_Utility

.BITSLER.                 ▄███
               ▄████▀
             ▄████▀
           ▄████▀  ▄██▄
         ▄████▀    ▀████▄
       ▄████▀        ▀████▄
     ▄████▀            ▀████▄
   ▄████▀                ▀████▄
 ▄████▀ ▄████▄      ▄████▄ ▀████▄
█████   ██████      ██████   █████
 ▀████▄ ▀████▀      ▀████▀ ▄████▀
   ▀████▄                ▄████▀
     ▀████▄            ▄████▀
       ▀████▄        ▄████▀
         ▀████▄    ▄████▀
           ▀████▄▄████▀
             ▀██████▀
               ▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄            
▄▄▄▄▀▀▀▀    ▄▄█▄▄ ▀▀▄         
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄      
█  ▀▄▄  ▀█▀▀ ▄      ▀████   ▀▀▄   
█ █▄  ▀▄   ▀████       ▀▀ ▄██▄ ▀▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█  ▀▀       ▀▄▄ ▀████      ▄▄▄▀▀▀  █
█            ▄ ▀▄    ▄▄▄▀▀▀   ▄▄  █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ ▄▄   ███   ▀██  █           ▀▀  █ 
█ ███  ▀██       █        ▄▄      █ 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  
▀▄            █        ▀▀      █  
▀▀▄   ███▄  █   ▄▄          █   
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    
▀▀▄   █   ▀▀▄▄▄▀▀▀         
▄▄▄▄▄▄▄▄▄▄▄█▄▄▀▀▀▀              
              ▄▄▄██████▄▄▄
          ▄▄████████████████▄▄
        ▄██████▀▀▀▀▀▀▀▀▀▀██████▄
▄     ▄█████▀             ▀█████▄
██▄▄ █████▀                ▀█████
 ████████            ▄██      █████
  ████████▄         ███▀       ████▄
  █████████▀▀     ▄███▀        █████
   █▀▀▀          █████         █████
     ▄▄▄         ████          █████
   █████          ▀▀           ████▀
    █████                     █████
     █████▄                 ▄█████
      ▀█████▄             ▄█████▀
        ▀██████▄▄▄▄▄▄▄▄▄▄██████▀
          ▀▀████████████████▀▀
              ▀▀▀██████▀▀▀
            ▄▄▄███████▄▄▄
         ▄█▀▀▀ ▄▄▄▄▄▄▄ ▀▀▀█▄
       █▀▀ ▄█████████████▄ ▀▀█
     █▀▀ ███████████████████ ▀▀█
    █▀ ███████████████████████ ▀█
   █▀ ███████████████▀▀ ███████ ▀█
 ▄█▀ ██████████████▀      ▀█████ ▀█▄
███ ███████████▀▀            ▀▀██ ███
███ ███████▀▀                     ███
███ ▀▀▀▀                          ███
▀██▄                             ▄██▀
  ▀█▄                            ▀▀
    █▄       █▄▄▄▄▄▄▄▄▄█
     █▄      ▀█████████▀
      ▀█▄      ▀▀▀▀▀▀▀
        ▀▀█▄▄  ▄▄▄
            ▀▀█████
[]
UrulaTheGiantBlueTurtle
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 14, 2018, 11:12:45 AM
 #3

Thank you I'll look through that. My concern though with using these resources designed for Bitcoin in mind is whether they'll be generalizable to my own unique blockchain?
NeuroticFish
Legendary
*
Online Online

Activity: 1666
Merit: 1095


The real one is http://bitcoin.ORG


View Profile WWW
June 14, 2018, 01:26:09 PM
 #4

Thank you I'll look through that. My concern though with using these resources designed for Bitcoin in mind is whether they'll be generalizable to my own unique blockchain?

You didn't pay attention to what I wrote:

One of them is for altcoins too.

More exactly pybitcoin supports quite a number of altcoins.
And I've done even more, I've looked shortly into the code. If you go to the lines 143+ of privatekey.py you'll find that for Litecoin or Namecoin there's only one small difference from Bitcoin (_pubkeyhash_version_byte). And just with that they've become different.

You keep telling about your "unique blockchain". A blockchain is only a database of transactions. You should certainly not have public key + balance pairs there. You should have the transactions and follow them to find each balance and, more important, the source and validity of that balance.



Edit: of course, people with more knowledge than myself can explain you how is all done; but it won't hurt if you study that code a little...

.BITSLER.                 ▄███
               ▄████▀
             ▄████▀
           ▄████▀  ▄██▄
         ▄████▀    ▀████▄
       ▄████▀        ▀████▄
     ▄████▀            ▀████▄
   ▄████▀                ▀████▄
 ▄████▀ ▄████▄      ▄████▄ ▀████▄
█████   ██████      ██████   █████
 ▀████▄ ▀████▀      ▀████▀ ▄████▀
   ▀████▄                ▄████▀
     ▀████▄            ▄████▀
       ▀████▄        ▄████▀
         ▀████▄    ▄████▀
           ▀████▄▄████▀
             ▀██████▀
               ▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄            
▄▄▄▄▀▀▀▀    ▄▄█▄▄ ▀▀▄         
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄      
█  ▀▄▄  ▀█▀▀ ▄      ▀████   ▀▀▄   
█ █▄  ▀▄   ▀████       ▀▀ ▄██▄ ▀▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█  ▀▀       ▀▄▄ ▀████      ▄▄▄▀▀▀  █
█            ▄ ▀▄    ▄▄▄▀▀▀   ▄▄  █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ ▄▄   ███   ▀██  █           ▀▀  █ 
█ ███  ▀██       █        ▄▄      █ 
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  
▀▄            █        ▀▀      █  
▀▀▄   ███▄  █   ▄▄          █   
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    
▀▀▄   █   ▀▀▄▄▄▀▀▀         
▄▄▄▄▄▄▄▄▄▄▄█▄▄▀▀▀▀              
              ▄▄▄██████▄▄▄
          ▄▄████████████████▄▄
        ▄██████▀▀▀▀▀▀▀▀▀▀██████▄
▄     ▄█████▀             ▀█████▄
██▄▄ █████▀                ▀█████
 ████████            ▄██      █████
  ████████▄         ███▀       ████▄
  █████████▀▀     ▄███▀        █████
   █▀▀▀          █████         █████
     ▄▄▄         ████          █████
   █████          ▀▀           ████▀
    █████                     █████
     █████▄                 ▄█████
      ▀█████▄             ▄█████▀
        ▀██████▄▄▄▄▄▄▄▄▄▄██████▀
          ▀▀████████████████▀▀
              ▀▀▀██████▀▀▀
            ▄▄▄███████▄▄▄
         ▄█▀▀▀ ▄▄▄▄▄▄▄ ▀▀▀█▄
       █▀▀ ▄█████████████▄ ▀▀█
     █▀▀ ███████████████████ ▀▀█
    █▀ ███████████████████████ ▀█
   █▀ ███████████████▀▀ ███████ ▀█
 ▄█▀ ██████████████▀      ▀█████ ▀█▄
███ ███████████▀▀            ▀▀██ ███
███ ███████▀▀                     ███
███ ▀▀▀▀                          ███
▀██▄                             ▄██▀
  ▀█▄                            ▀▀
    █▄       █▄▄▄▄▄▄▄▄▄█
     █▄      ▀█████████▀
      ▀█▄      ▀▀▀▀▀▀▀
        ▀▀█▄▄  ▄▄▄
            ▀▀█████
[]
UrulaTheGiantBlueTurtle
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 14, 2018, 01:55:19 PM
 #5

Thank you I'll look through that. My concern though with using these resources designed for Bitcoin in mind is whether they'll be generalizable to my own unique blockchain?

You didn't pay attention to what I wrote:

One of them is for altcoins too.

More exactly pybitcoin supports quite a number of altcoins.
And I've done even more, I've looked shortly into the code. If you go to the lines 143+ of privatekey.py you'll find that for Litecoin or Namecoin there's only one small difference from Bitcoin (_pubkeyhash_version_byte). And just with that they've become different.

You keep telling about your "unique blockchain". A blockchain is only a database of transactions. You should certainly not have public key + balance pairs there. You should have the transactions and follow them to find each balance and, more important, the source and validity of that balance.



Edit: of course, people with more knowledge than myself can explain you how is all done; but it won't hurt if you study that code a little...

Amazing, so essentially if the user inputs a private key as a string, and I append .public_key() to that statement and it matches a public key in the database, then I can be certain that the user is the owner of the public key? I just want to start simple with the database making sure I understand how to verify the key correctly first.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!