Skip to content

Commit

Permalink
Add information about fed address derivation and UTXOs storage
Browse files Browse the repository at this point in the history
  • Loading branch information
guidohernan93 committed Sep 18, 2020
1 parent a342e6c commit cefcb5c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion IPs/RSKIP175.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Abstract

This RSKIP allows a user to transfer BTC to RSK in a fast way, where a third party takes the risk to advance the payment in RBTC to the user.
This RSKIP allows a user to transfer BTC to RSK in a fast way, where a third party takes the risk to advance the payment in RBTC to the user.

## Motivation

Expand Down Expand Up @@ -71,9 +71,37 @@ The bridge is the most affected by this project. It will include:
- If not surpassed, will transfer funds to Liquidity Bridge Contract
- If surpassed, will refund Liquidity Provider


#### Flow chart
![registerBtcTransfer() flow](RSKIP175/flow-chart-for-rskip.png)


### UTXOs Storage

Two new entries will be created on Bridge storage when registerBtcTransfer() executes successfully in order to check if a UTXO was already processed.

These entries will be a tuple with:

**(UTXO, derivation arguments)**

**(derivation arguments, UTXO)**

The datetime will be saved too, as it is will be used for erasing old UTXOs.

After 7 days of being registered, the entries on the Bridge storage that contains the relations **(UTXO <-> derivation arguments)** will be erased through **updateCollections** method. If any UTXO is found after that period of time, it will be migrated to the active Federation before erasing it.


### Federation Address Derivation

The address derivation process will be carried out by creating a custom redeem script that will make a push of a 32 bytes hash created from the provided derivation arguments. That data is then dropped.

This new custom redeem scrtipt will have this structure::

scriptPubKey: OP_HASH160 <redeemScriptHash> OP_EQUAL
scriptSig: OP_0 <signatures> <redeemScript>
redeemScript: <derivationArgumentsHash> OP_DROP OP_M <publicKeys> OP_N OP_CHECKMULTISIG


### Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Binary file modified IPs/RSKIP175/flow-chart-for-rskip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cefcb5c

Please sign in to comment.