From c7db792d80c7fc3268bd680260c74c6591ca237d Mon Sep 17 00:00:00 2001 From: PiVortex Date: Tue, 20 Aug 2024 14:59:09 +0100 Subject: [PATCH] add deposit explanation --- .../chain-signatures/chain-signatures.md | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md b/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md index 78a78b5088..5a427e8f08 100644 --- a/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md +++ b/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md @@ -68,13 +68,13 @@ We provide code to derive the address, as it's a complex process that involves m + url="https://github.com/near-examples/near-multichain/blob/main/src/services/ethereum.js" start="17" end="21" /> + url="https://github.com/near-examples/near-multichain/blob/main/src/services/bitcoin.js" start="13" end="17" /> @@ -118,7 +118,7 @@ In Ethereum, constructing the transaction is simple since you only need to speci + start="27" end="81" /> In bitcoin, you construct a new transaction by using all the Unspent Transaction Outputs (UTXOs) of the account as input, and then specify the output address and amount you want to send. @@ -148,7 +148,7 @@ The method requires two parameters: + start="83" end="102" /> For bitcoin, all UTXOs are signed independently and then combined into a single transaction. @@ -156,6 +156,16 @@ For bitcoin, all UTXOs are signed independently and then combined into a single +
+ + Deposit amount + + In this example, we attach a deposit of 0.05 $NEAR for the signature request. The transaction may fail if the network is congested since the deposit required by the MPC service scales linearly with the number of pending requests, from 1 yoctoNEAR to a maximum of 0.65 $NEAR. Any unused deposit will be refunded and if the signature fails, the user will be refunded the full deposit. + + The MPC contract does implement a method to check the current deposit required, however, it cannot be used reliably since the amount will likely change between the time of the check and the time of the request. + +
+ :::info The contract will take some time to respond, as the `sign` method [yields execution](/blog/yield-resume), waiting for the MPC service to sign the transaction. @@ -183,7 +193,7 @@ In Ethereum, the signature is reconstructed by concatenating the `r`, `s`, and ` + start="104" end="115" /> In Bitcoin, the signature is reconstructed by concatenating the `r` and `s` values returned by the contract. @@ -208,7 +218,7 @@ Once we have reconstructed the signature, we can relay it to the corresponding n + start="118" end="126" />