You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/fdc/guides/check-address-validity.mdx
+56-44Lines changed: 56 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ unlisted: false
10
10
11
11
The [AddressValidity](/fdc/attestation-types/address-validity) attestation type validates whether a string represents a valid address on supported blockchain networks (`BTC`, `DOGE`, and `XRP`).
12
12
This validation ensures addresses meet chain-specific formatting and checksum requirements before they're used in transactions or smart contracts.
13
-
The full specification is available on the official [specification repo](https://github.com/flare-foundation/flare-specs/blob/main/src/FDC/AttestationTypes/AddressValidity.md).
13
+
The full specification is available on the official [specification repo](/fdc/attestation-types/address-validity).
14
14
15
15
The primary contract interface for this attestation type is [`IAddressValidity`](/fdc/reference/IFdcHub). Let's walk through validating a Bitcoin testnet address using the FDC protocol.
16
16
We will use the address `mg9P9f4wr9w7c1sgFeiTC5oMLYXCc2c7hs` as an example throughout this guide.
@@ -58,7 +58,7 @@ The names of included contracts mostly mirror the steps described in the [FDC ov
58
58
To bridge the separate script executions, we will save the relevant data of each script to a file in the `dirPath` folder.
59
59
Each succeeding script will then read that file to load the data.
60
60
61
-
## Preparing the Request
61
+
## Prepare request
62
62
63
63
A JSON request to the verifier follows the same structure for all attestation types, with field values varying per type.
64
64
@@ -74,7 +74,7 @@ For `AddressValidity`, `requestBody` contains a single field:
- API available for [DOGE](https://fdc-verifiers-testnet.flare.network/verifier/doge/api-doc#/AddressValidity/BTCAddressValidityVerifierController_prepareRequest) and [XRP](https://fdc-verifiers-testnet.flare.network/verifier/xrp/api-doc#/AddressValidity/BTCAddressValidityVerifierController_prepareRequest).
The prerequisite for this is that the `.env` file is not missing the `PRIVATE KEY` and `COSTON2_RPC_URL` values.
274
274
The script can also access other chains; that can be achieved by replacing the `--rpc-url` value with `COSTON_RPC_URL`, `FLARE_RPC_URL`, or `SONGBIRD_RPC_URL`.
275
275
276
-
## Posting the Request to a Verifier Server
276
+
## Post request to verifier
277
277
278
278
Before submitting address validation requests to the FDC protocol, we first need to prepare and send them to a verifier server.
279
279
This section walks through the request submission process using the `surl` package.
@@ -355,25 +355,25 @@ Let's break it down line by line:
355
355
356
356
What this demonstrates is that, with some effort, the `abiEncodedRequest` can be constructed manually.
357
357
358
-
## Submitting the Request to the FDC
358
+
## Submit request to FDC
359
359
360
360
This step transitions from off-chain request preparation to on-chain interaction with the FDC protocol. Now, we submit the validated request to the blockchain using deployed smart contracts.
361
361
362
-
### Submitting the Request
362
+
### Submit request
363
363
364
364
The entire submission process requires only five key steps:
Copy file name to clipboardExpand all lines: docs/fdc/guides/evm-transaction.mdx
+17-18Lines changed: 17 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ unlisted: false
10
10
11
11
The [`EVMTransaction`](/fdc/attestation-types/evm-transaction) attestation type enables data collection about a transaction on an EVM chain.
12
12
The currently supported chain are: `ETH`, `FLR`, and `SGB`.
13
-
You can learn more about it in the official [specification repo](https://github.com/flare-foundation/flare-specs/blob/main/src/FDC/AttestationTypes/EVMTransaction.md).
13
+
You can learn more about it in the official [specification repo](/fdc/attestation-types/evm-transaction).
14
14
15
15
We will now demonstrate how the FDC protocol can be used to collect the data of a given Ethereum transaction.
16
16
The transaction we will be observing has the hash `0x4e636c6590b22d8dcdade7ee3b5ae5572f42edb1878f09b3034b2f7c3362ef3c`; this is an arbitrary transaction that we acquired from the Sepolia Ethereum testnet [explorer](https://sepolia.etherscan.io/).
@@ -56,7 +56,7 @@ The names of included contracts mostly mirror the steps described in the [FDC gu
56
56
To bridge the separate executions of the scripts, we will save the relevant data of each script to a file in the `dirPath` folder.
57
57
Each succeeding script will then read that file to load the data.
58
58
59
-
## Preparing the Request
59
+
## Prepare request
60
60
61
61
The JSON request to the verifier is the same form for all attestation types, but the values of the fields differ between them.
62
62
It contains the following fields.
@@ -77,10 +77,8 @@ In the case of `EVMTransaction`, `requestBody` is a JSON containing the fields:
77
77
78
78
### Reference Documentation
79
79
80
-
We can find the required fields in the [specification](https://gitlab.com/flarenetwork/docs-team/flare-specs/-/blob/main/src/FDC/AttestationTypes/EVMTransaction.md?ref_type=heads) for the `EVMTransaction` attestation type.
81
-
Alternatively, we can check the verifier's [interactive docs](https://fdc-verifiers-testnet.flare.network/verifier/api-doc#/ETH/ETHEVMTransactionVerifierController_prepareRequest).
82
-
Here we can also check the verifier's response by providing the necessary data.
83
-
Though the URLs are slightly different, the verifier has the same API for both [FLR](https://fdc-verifiers-testnet.flare.network/verifier/flr/api-doc#/AddressValidity/BTCAddressValidityVerifierController_prepareRequest) and [SGB](https://fdc-verifiers-testnet.flare.network/verifier/sgb/api-doc#/AddressValidity/BTCAddressValidityVerifierController_prepareRequest).
The prerequisite for this is that the `.env` file is not missing the `PRIVATE KEY` and `COSTON2_RPC_URL` values.
297
295
The script can also access other chains; that can be achieved by replacing the `--rpc-url` value with `COSTON_RPC_URL`, `FLARE_RPC_URL`, or `SONGBIRD_RPC_URL`.
298
296
299
-
## Posting the Request to a Verifier Server
297
+
## Post request to verifier
300
298
301
299
Before submitting address validation requests to the FDC protocol, we first need to prepare and send them to a verifier server.
302
300
This section walks through the request submission process using the `surl` package.
@@ -389,11 +387,11 @@ Base.writeToFile(
389
387
);
390
388
```
391
389
392
-
## Submitting the Request to the FDC
390
+
## Submit request to FDC
393
391
394
392
This step transitions from off-chain request preparation to on-chain interaction with the FDC protocol. Now, we submit the validated request to the blockchain using deployed smart contracts.
395
393
396
-
### Submitting the Request
394
+
### Submit request
397
395
398
396
The entire submission process requires only five key steps:
399
397
@@ -462,7 +460,7 @@ function submitAttestationRequest(bytes memory abiEncodedRequest) internal {
FDC optimizes on-chain storage costs by implementing a hybrid data verification system.
624
622
Instead of storing complete datasets on-chain, it stores only Merkle proofs, while maintaining the actual data through trusted off-chain providers.
@@ -670,7 +668,7 @@ Base.writeToFile(
670
668
);
671
669
```
672
670
673
-
## Using the Data
671
+
## Use the data
674
672
675
673
We will now define a simple contract, that will demonstrate how the data can be used onchain.
676
674
The contract will receive data and proof of an Ethereum transaction, and store all token transfers contained into an array of `TokenTransfer` structs.
@@ -782,7 +780,8 @@ contract TransferEventListener is ITransferEventListener {
782
780
}
783
781
```
784
782
785
-
We deploy the contract through a simple script. The script creates a new `TransferEventListener` contract, and writes its address to a file (`data/EVMTransaction_listenerAddress.txt`).
783
+
We deploy the contract through a simple script.
784
+
The script creates a new `TransferEventListener` contract, and writes its address to a file (`data/EVMTransaction_listenerAddress.txt`).
0 commit comments