Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Matthews Lab
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Timechain
(section)
Page
Discussion
British English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Stitching parallel keys into a single chain with encryption == In the simple example we started with - a time-lock of 1 year would be roughly equivalent to 1 year of computation. If it takes a whole year to generate a single timechain this concept wouldn’t be very useful. Fortunately this problem can be solved by generating separate N minute keys on a GPU cluster and then stitching them all together with standard [https://en.wikipedia.org/wiki/Symmetric-key_algorithm symmetric encryption] ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES]) to form a chain of 5 minute RSA public keys. After releasing the starting IV to the chain (called the genesis IV), the chain must then be broken in serial, however the exact time needed to break the chain will fluctuate based on available computing power as well as advances in sha256 performance - a problem we address later in the paper. <syntaxhighlight lang="python3"> import time from Crypto.Cipher import AES from Crypto import Random from Crypto.Cipher import PKCS1_OAEP from Crypto.PublicKey import RSA def make_aes_cipher(key): return AES.new(key, AES.MODE_CFB) def encrypt(plaintext, cipher): return cipher.encrypt(plaintext) """ These are abstract functions defined previously or for demonstration purposes only. """ def timelock(duration, iv): return iv def publish_timechain(genesis, timechain, genesis_time): return None """ Generate starting IVs for parallel keys. These need to be distributed to individual processors. """ ivs = [] key_no = int(1 * 365 * 24 * 60 / 5) for i in range(0, key_no): iv = Random.new().read(32) ivs.append(iv) """ Generate individual time-locked keys. (Image this is done in parallel because I'm lazy.) """ keys = [] duration = 5 * 60 for i in range(0, key_no): key = timelock(duration, ivs[i]) keys.append(key) """ This is where the magic happens: stitch the keys together into one long chain of serial keys. """ en_ivs = [] en_rsa_priv_keys = [] rsa_public_keys = [] for i in range(1, key_no): #Stitch keys together. aes_cipher = make_aes_cipher(keys[i]) en_iv = encrypt(ivs[i], aes_cipher) en_ivs.append(en_iv) """ We also encrypt an RSA key at this point in the chain, that way people can use public key crypto to time-lock encrypt an arbitrary number of plaintexts without recomputing work. """ random_generator = Random.new().read rsa_key = RSA.generate(1024 * 2, random_generator) rsa_priv_key = rsa_key.exportKey('DER') en_rsa_priv_key = encrypt(rsa_priv_key, aes_cipher) rsa_public_key = rsa_key.publickey().exportKey('DER') en_rsa_priv_keys.append(en_rsa_priv_key) rsa_public_keys.append(rsa_public_key) #When should the timechain be released? genesis_time = time.time() + (10 * 60) #Generate timechain. timechain = [] for i in range(0, key_no - 1): link = { "en_iv": en_ivs[i], "en_rsa_priv_key": en_rsa_priv_keys[i], "rsa_public_key": rsa_public_keys[i], "expiry": genesis_time + ((i + 1) * duration) } timechain.append(link) #Timechain starts here. genesis = ivs[0] #Publish timechain - not coded - for example only. publish_timechain(genesis, timechain, genesis_time) </syntaxhighlight> There’s a lot going on here so lets take a closer look. Remember how we started with an [https://en.wikipedia.org/wiki/Initialization_vector IV] and repeatedly hashed it to produce a time-locked key? Well in the parallel form that process is done hundreds of times simultaneously on different processors and at the end the IVs used for the keys are encrypted with a previous key so now the IVs have to be hashed sequentially before the next IV can be decrypted. [[File:Timechain 1.png|thumb]] Dotted lines denote information being used as keys for ciphers and green denotes publicaly released information. By building a chain of N minute time-lock encrypted, RSA public keys in parallel, and then stitching them together with symmetric encryption - it is possible to encrypt information in such a way that it can be released at arbitrary points in the future [https://en.wikipedia.org/wiki/Decentralization without depending on a third-party]. While this concept alone might be sufficient to solve a number of complex trust problems it is currently missing an important feature that the blockchain provides: an incentive. What mechanism is there for the the keys to be released after they’re solved? What mechanism is there to encourage participants to attempt to decrypt the timechain at all? In the next section we propose a novel [https://en.wikipedia.org/wiki/Decentralized_Autonomous_Organization#Decentralized_Autonomous_Corporations.2FCompanies_.28DACs.29 decentralized autonomous company] that addresses these issues and more.<span id="the-timechain-dac"></span>
Summary:
Please note that all contributions to Matthews Lab may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Matthews Lab:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)