How to fetch raw data from Binance Smart Chain (txs for specific address) - blockchain

I am not sure what I don't know and if this is possible. I think this would be a similar issue for Ethereum, so that is the reason why I marked Ethereum on tags.
I am going to describe on example what I want to achieve:
There is a token called "Elonomics".
https://bscscan.com/address/0xd3ecc6a4ce1a9faec1aa5e30b55f8a1a4b84f938
there is owner with address "0x3a78ea5c462f0afa76fa091a70a7bcd020b274d6"
there are all txs from owner address: https://bscscan.com/txs?a=0x3a78ea5c462f0afa76fa091a70a7bcd020b274d6
when I take one of the transaction from the owner e.g. 0x6f81f2dbd285d772c6b34151b676f6749ef75ac9a6c76b5e4dfa844a0c6932d2"
I can read the logs from this transaction in:
https://bscscan.com/tx/0x6f81f2dbd285d772c6b34151b676f6749ef75ac9a6c76b5e4dfa844a0c6932d2#eventlog
so I can read that somebody set "totalSupply :1500000800000"
and now are my questions:
Is it possible to fetch all txs related to this specific owner address with these logs in json data (or any other data that can be updated dynamically on dAPPs)?
Are data from txs logs are encrypted? (if yes what is the format of this and how to decrypt this how bscscan do)
Is it possible to fetch these data directly from blockchain instead of using 3rd part application like bscscan?

Is it possible to fetch all txs related to this specific owner address with these logs in json data (or any other data that can be updated dynamically on dAPPs)?
Yes, because all this data is stored on a blockchain.
Are data from txs logs are encrypted? (if yes what is the format of this and how to decrypt this how bscscan do)
All data on a public blockchain is public.
Is it possible to fetch these data directly from blockchain instead of using 3rd part application like bscscan?
Run your own BSC node. Please see web3.py library how to interact with an Ethereum based blockchain, like one that is BSC node.

Related

Want to know the reason how Rarible and Opensea sync the items using the same wallet address?

I'm working on an NFT project, Once I created an item on Rarible, and after that login on to Opensea with the same wallet address. Then the item I was created on Rarible is automatically synced to Opensea including title, history, etc.
So, As a programmer. I want to know the reason behind this process and how they are getting this data from one to another using the same wallet.
When any contract writes an ERC721 compliant transaction to Ethereum, marketplaces like OpenSea and Rarible are able to monitor new blocks (e.g. via event streaming) for new token creation. Since this information is public, information such as the issuing contract id, owner address and token id are immediately available and can be retrieved. Additional information about the contract can also be obtained from the contract constructor.
Additionally, one of the methods on an ERC721 contract is tokenURI. By navigating to this URI (often stored on immutable storage like IPFS), anyone observing the blockchain can retrieve additional metadata information about the token. This metadata usually includes an image, description and other custom attributes which describe the NFT. This allows marketplaces to render the NFT on their exchanges.

How to control access to personnal information stored on blockchain (with an educational use case)

The following use case would it be possible ?
At a nation level, the government wants its regional educational direction to build a system to certify diplomas. Those diplomas should be stored on a blockchain in such a way that no region could, alone, temper them after they were issued.
The students should be able to give access temporally to his or her diplomas, to anyone (eg. employer wanting to recruit).
Please correct me:
I think this should be possible if the data stored on the blockchain was encrypted and if the DAPP was able to generate temporary key to decrypt that data.
Obviously any employer gaining access to the record could make a copy of it, but the point here is that after the expiration of the key's validity, no employer should be able to prove that he owned the real record.
Does that sound like a valid use case for dapps in general. Does it sound even feasible to you ?
The following scenario can be suggested as the simplest option:
We create a smart contract with 3 methods:
RegistryRequest(bytes32 info_id, bytes32 user_id, string memory public_cert) payeble
SendInfo(bytes32 info_id, bytes32 user_id, string file_addr)
GetInfo(bytes32 info_id, bytes32 user_id) view return(string memory retVal)
The consumer calls the method RegistryRequest transfers:
info_id - the identifier of the required data
user_id - his unique identifier (e-mail, mobile phone, and so on) ()
public_cert- his public key OpenSSL
and attaches a certain amount in Eth to the transaction as payment for the service.
Having received the details and payment from the consumer, you:
create a file with the data he needs
encrypt this file with the consumer's public key OpenSSL,
upload it to some web resource or transfer it via IPFS or Ethereum Swarm (or in any other way)
using the method SendInfo lay out the "address" of the data file (file_addr) in relation to the data and consumer identifiers (info_id, user_id).
To pay for the transaction, you use a portion of the amount received from the consumer along with the RegistryRequest.
The consumer through the method GetInfo using the data identifier (info_id) and his personal identifier (user_id) receives the "address" of the data file, extracts and decrypts it
If the data changes, then their changed state is laid out similarly to point 3
After the expiration of the data provision period, you stop releasing their update
More complex solutions can, for example, be discussed with experts for free and simulated on a kekker.com

Hyperledger Fabric: Can a smart contract secretly add numbers and only share the sum?

Scenario:
I have 4 nodes in which each node sends a number. Each number should not be visible to any node other than the owner. The smart contract should secretly add all 4 numbers without viewing them to any member. Only the result which is the summation should be visible to all contracts.
Is the above scenario possible when using hyperledger fabric?
The asymmetric encryption maybe the way to do it. The nodes use the public key to encrypt their number. And only smart contract have the key to decrypt it. You somehow need to dig deep inside the API see how the contract interact with the CA server.
You can easily achieve this by using Symmetric encryption like AES.
Data(number) that you are using can be encrypted using AES. what you will get as output will be IV, password, tag and encrypted data. You can store encrypted data on blockchain for everyone to see. However, only those entities that wish to see the decrypted data can ask the owner of data for the required 3 keys(IV, password, tag) which will not be stored in the blockchain.

What kind of data should/can each SQS message contain?

Suppose I have a task of updating an user via a third party API call. Is it okay to put the actual user data inside the message (if it fits)? Or should I only provide an ID in the message so the worker can retrieve the updated record from my local database?
You need to check what level of compliance is required for your infrastructure, to see what kind of data you want to put in the queue.
If there aren't any compliance restrictions, you are free to put any kind of data in your own infrastructure on AWS.

how can I store and send some images (pictures) in Hyperledger Smart Contract?

I want to know how to store and send as a transaction some picture or link to some resources in Hyperledged Smart Contract.
Where in code I should do it?
The chaincode function to store data to blockchain in a Hyperledger Fabric chaincode is:
PutState(key string, value []byte)
The value can be any byte array, which may represent a picture to store on the blockchain, or a link to a resource outside the blockchain.