📄️ How to Integrate sCrypt Service
Before interacting with an existing sCrypt contract that exists on chain,
📄️ Sighash Types
A signature hash (sighash) flag is used to indicate which part of the transaction is signed by the ECDSA signature. There are mainly two ways to use it in the context of Bitcoin smart contracts.
📄️ How to Debug ScriptContext Failure
ScriptContext enables the logic of the contract to be executed correctly according to the agreement, and the state of the contract to be propagated correctly.
📄️ Use Script inside sCrypt
Script is a low-level language and acts as assembly for the Bitcoin Virtual Machine. Usually, developers do not have to deal with it directly and can use high-level languages like sCrypt. However, there are cases where using script is desirable. For example, customized script is optimized and thus smaller and more efficient than Script generated by sCrypt. Or script is generated using external tools like Baguette and needs to be integrated into sCrypt.
📄️ Use Code Separators
How Code Separators Work
📄️ How to Add a Provider
In the contract testing section, we learned about the Provider class in sCrypt. This class serves as an abstraction of a Bitcoin node, allowing your application to communicate with the Bitcoin network.
📄️ How to Add a Signer
As described in this section, a signer is an abstraction of private keys, which can be used to sign messages and transactions. A simple signer would be a single private key, while a complex signer is a wallet.
📄️ Call Multiple Contracts in a Single Tx
Up to now, we have only shown how to call one smart contract in a transaction. That is, only one input of the tx spends a smart contract UTXO, and the other inputs, if any, spend Pay-to-Public-Key-Hash (P2PKH) UTXOs, which are generally NOT regarded as smart contracts.
📄️ Time Lock
Overview
📄️ How to Sign P2PKH Inputs Using the Signer Class
In certain scenarios, it is necessary to sign only P2PKH inputs when working with transactions in sCrypt. This documentation will guide you through the process of utilizing the Signer class to achieve this.
📄️ How to Replay a Contract Instance to the Latest State
Using sCrypt Service and sCrypt client, we can effortlessly create a contract instance reflecting the latest state as follows:
📄️ How to Build an Oracle Service
As described in this tutorial, a blockchain oracle is a third-party service or agent that provides external data to a blockchain network. It is a bridge between the blockchain and the external world, enabling smart contracts to access, verify, and incorporate data from outside the blockchain. Specifically, the oracle service provides external data along with a Rabin signature of the data, and the smart contract uses this data and verifies the signature before using it.