I am educating myself on cryptocurrencies and a theme within that community is to use separate "addresses" for each transaction. As I interpret an address as the hash of the public key for the individual, it leads me to believe that you can generate multiple public keys for a private key. I am completely novice on this subject and am using the R PKI package as a jumping off point for this self tutorial.
This line of thinking is counter to the discussion at PKI multiple public keys so I might be well of the mark but if not is there a way to generate an additional public key with the PKI package?
I have a code block below that covers some of my thinking. Now having said all this. I am trying to understand some 9 pages of discussion as to what that implies and I don't think I am up for finite groups discussion nor the compromise of the Private Key if multiple public keys are released. SO if you can correct me via programming or additional reference material I would appreciate. Ultimately, its and exercise to improve my R skills first and foremost.
require(PKI)
# generate 2048-bit RSA key
key <- PKI.genRSAkey(bits = 2048L)
# extract private and public parts as PEM
priv.pem <- PKI.save.key(key)
pub.pem <- PKI.save.key(key, private=FALSE)
# load back the public key separately
pub.k <- PKI.load.key(pub.pem)
# encrypt with the public key
x <- PKI.encrypt(charToRaw("Hello, world!"), pub.k)
# decrypt with private key
rawToChar(PKI.decrypt(x, key))
# So straight from the Package examples I have the public and private keys.
# Additionally, with the same I can sign a message
x <- charToRaw("My message to sign")
sig <- PKI.sign(x, key)
PKI.verify(x, sig, key)
# Now a slight change from the exapmles I will verify that the public key can verify
PKI.verify(x, sig, pub.k)
# Now I would like to generate another public key based on the same private key
# my nieve attempt is
#PKI.mkRSApubkey(modulus, exponent=65537L, format = c("DER", "PEM", "key"))
pub.k
pub.k2<-PKI.mkRSApubkey(123, exponent=65537L, format = "key")
pub.k2
PKI.verify(x, sig, pub.k2)
PKI.verify(x, sig, pub.k)
priv.pem