Deposit Satoshi Test

There is no way to sign a message in Bitcoin for P2WSH. In order to authenticate ownership of bitcoin address, we need to conduct a satoshi test.

Client needs to register a bitcoin address on the chain before it can send sats for satoshi test. Once the client completes the satoshi test, the address is eligible for deposit. The amount sent for the satoshi test is also minted in the client’s account.

Registered address is watched on the forkscanner only for 72 hours as part of registration process. However, once the deposit is successful, forkscanner watches the registered address for perpetuity.

MsgRegisterBTCDepositAddress

message MsgRegisterBtcDepositAddress {
string BTCDepositAddress
string TwilightDepositAddress
uint64 DepositValue
}

This mapping is confirmed only if deposit is confirmed / attested, else rejected.

On the forkscanner, this mapping is watched on a separate web socket connection, which is temporary. If deposit is received, we watch the address on a permanent websocket connection.

Every registered BTC address is mapped with a 4 byte identifier.

message ClearingAccount {
    string TwilightAddress = 1;
    string BtcDepositAddress = 2;
    uint32 BtcDepositAddressIdentifier = 3; 
    string BtcWithdrawAddress = 4;
    uint32 BtcWithdrawAddressIdentifier = 5;
    repeated IndividualTwilightReserveAccountBalance ReserveAccountBalances = 6;
}

Preventing DDoS of multiple address registration requests

In order to prevent bots from submitting multiple requests, a small stake amount is introduced. If the deposit is confirmed, stake is refunded.

message BtcDepositAddress {
    string btcDepositAddress  = 1;
    uint64 btcSatoshiTestAmount  = 2;
    uint64 twilightStakingAmount  = 3; // make it constant through gov proposal
    string twilightAddress  = 4;
    bool   isConfirmed = 5;
    int64  CreationTwilightBlockHeight = 6;

Last updated