Changeset 9 for trunk/standards

Show
Ignore:
Timestamp:
12/12/07 16:01:51 (4 years ago)
Author:
ocnils
Message:

Fleshed out the rest of the protocol.
Protocol now has all messages between Wallets, Issuer Services, and DSDBs
Protocol requires Issuer Services to temporarily store value (will be fixed

soon hopefully)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/standards/protocol.txt

    r8 r9  
    3333 
    3434  { 
    35     key identifier   = base64(id(p)) 
    36     denomination     = denomination 
    37     not_before       = TIME(...) 
    38     key_not_after    = TIME(...) 
    39     coin_not_after   = TIME(...) 
    40     public key       = base64(p) 
    41  
    42     issuer           = Hash(pM) 
     35    key identifier      = base64(id(p)) 
     36    currency identifier = http://opencent.net/OpenCent 
     37    denomination        = denomination 
     38    not_before          = TIME(...) 
     39    key_not_after       = TIME(...) 
     40    coin_not_after      = TIME(...) 
     41    public key          = base64(p) 
     42 
     43    issuer              = Hash(pM) 
    4344    base64(sig(sM, hash(content part))) 
    4445  } 
     
    7980* Wallet: fetches current public minting keys for denomination 
    8081 
    81     Wallet:  FETCH_MINTING_KEY #string(denomination) 
     82Wallet:  FETCH_MINTING_KEY {DENOMINATION #string(denomination)|KEYID #hexstring(key_id)} 
    8283    IS:      PASS_MINTING_KEY keycertificate 
     84      or     FAIL_MINTING_KEY "Reason" 
    8385 
    8486    (question: base64 response?) 
     
    179181  * Wallet Alice calculates a splitting of sum into coins (units) and 
    180182    creates a list of coins to send 
     183  * Wallet Alice and Wallet Bob are synchronized to UTC (within some small margin of error) 
    181184 
    182185* Alice fetches DSDB key at IS 
     
    233236      - parse blanks for necessary minting key ids 
    234237      - start session with authenticated issuer service (IS) (secured and authenticated by transport layer, e.g. SSL) 
    235         - get session id (from transport layer) 
    236         - get all missing minting key certs 
    237         - IS sends key certs or rejects a key id (unknown, outdated) 
     238        - create transaction id (two-party secret agreement (collision free)) 
     239          Possible example with https. 
     240            USE_HTTPS_SESSIONID 
     241            YES|NO 
     242        - get all missing minting key certs (FETCH_MINTING_KEY) 
     243        - IS sends key certs or rejects a key id (unknown, outdated) (PASS_MINTING_KEY/FAIL_MINTING_KEY) 
    238244        - lock list of encrypted coin serial numbers at IS (DSDB)  
     245            LOCK_COINS #key_id_of_DSDB #hex_string(transaction_id) #hex_string(#number_of_obfuscated_blanks) 
     246                       #key_identifier1 #encrypted_serial1 
     247                       #key_identifier2 #encrypted_serial2[\r]\n 
     248 
    239249        - IS either accepts with locking time or rejects with list of rejected serials + reason (locked, spent)  
     250            If all coins lock: 
     251               LOCK_COINS_GRANTED #hex_string(transaction_id) TIME(lock_expires) 
     252            If some coins cannot lock, no coins are locked. 
     253               LOCK_COINS_FAILED #hex_sting(transaction_id) #hex_string(number_of_failures) 
     254                                 #key_identifier1 #encrypted_serial1 "Reason 1" 
     255                                 #key_identifier2 #encrypted_serial2 "Reason 2"[\r]\n 
     256 
     257                     Reasons: 
     258                           
     259                          Key ID of DSDB is unknown or expired       Permanant 
     260                          Key ID of blank is unknown or expired      Permanant 
     261                          Decryption of serial failed                Permanant 
     262                          Serial already spent                       Permanant 
     263                          Serial locked (not spent)                  Temporary 
     264 
    240265 
    241266      (this part pauses, session is kept) 
     
    244269  (if one blank is rejected the whole transfer has to be rejected) (future: bob signs receipt) 
    245270 
     271      REFUSE_BLANK #hex_string(number_of_failures) 
     272         #base64(ecrypted serial of blank1) "Why did we fail?!?" 
     273         #base64(ecrypted serial of blank2) "Why did we fail?!?"[\r]\n 
     274 
     275      REFUSE_BLANK #hex_string(0) "reason"   
     276 
     277      ACCEPT_BLANK 
     278 
     279      Note: After ACCEPT_BLANK, a REFUSE_BLANK #hex_string(0) can be given to abort the transaction 
     280 
     281 
    246282* Wallet Alice sends coins to Wallet Bob (this time including their clear serial and signature) 
    247283   
    248     SPEND_COINS 
     284    SPEND_COINS #hex_string(number_of_coins) 
     285                #base64(coin1) 
     286                #base64(coin2)[\r]\n 
    249287 
    250288* Wallet Bob checks that the coins match the blanks and that signatures are valid 
    251289 
    252290* Wallet Bob accepts transaction or rejects with reason (unknown, invalid) for each rejected coin 
     291 
     292     REJECT_COIN #hex_string(number_of_coins) 
     293                 #base64(coin1) "Reason" 
     294                 #base64(coin2) "Reason"[\r]\n 
     295 
     296     REJECT_COIN #hex_string(0) "Reason" 
     297 
     298     ACCEPT_COIN 
    253299 
    254300* Wallet Bob terminates session with Wallet Alice 
     
    261307     
    262308    * in case of reject in the checking phase delete the blanks, otherwise 
    263      
     309        UNLOCK_COINS #hex_string(transaction_id) 
     310 
    264311    * Wallet Bob sends buy request (blanks + coins) (Wallet Bob continues as in #4 and #8) 
     312        (REDEEM_COINS+REQUEST_MINT) 
    265313 
    266314    * IS has to check if sum of blanks and coins are equal 
     
    269317#7 Redeeming Coins  
    270318 
    271 * Wallet locks serials at IS (see above) 
     319* Wallet locks serials at IS (see above LOCK_COINS) 
    272320 
    273321* Wallet sends coins + target to IS 
    274322   
    275323  - target can be an account 
     324    REDEEM_COINS #hex_string(transaction_id) "#string(target)" #hex_string(number_of_coins) 
     325                 #base64(coin1) 
     326                 #base64(coin2)[\r]\n 
     327 
     328    target is of the form: 
     329        MINT_REQUEST=#base64(request_id) 
     330        ONLINE_BANKING_ACCOUNT=#string(account_identifier) 
     331        and so on... to be defined with relationship between IS and individual 
    276332 
    277333* continue with #8 
     334 
     335* Send money to target 
    278336 
    279337 
     
    284342    - if serial is still valid (against DSDB) 
    285343    - if signature is valid 
     344    - if target is valid 
    286345 
    287346* IS rejects with reason (key id unknown, coin outdated, coin spent, signature invalid) per coin or  
     347     REJECT_COINS #hex_string(number_of_coins) 
     348                  #base64(coin1) "Reason" 
     349                  #base64(coin2) "Reason"[\r]\n 
    288350 
    289351* (IS tries to service target, rejects with reason if not possible) 
     
    292354 
    293355* IS sends accept to Wallet 
    294  
    295  
     356      ACCEPT_COINS 
     357