System and method for a distributed ledger tracking animals
System, method, and non-transitory computer-readable storage media for allowing creating a record of an animal on a distributed ledger such as a blockchain. The animals have tags which, when read using a livestock tag reader, allow the owners of the animals to update the animal records with information about the animal, such as health and/or location data. The updated record can then be cryptographically signed and transmitted to a network server which verifies that the cryptographic signature corresponds to an owner's cryptographic signature for the animal.
1 . A system comprising:
at least one processor;
a network interface;
a livestock tag reader;
a database storing uniquely identified ear tags for a plurality of livestock, and storing records associated with the plurality of livestock;
a non-transitory computer-readable storage medium having instructions stored which, when executed by the at least one processor, cause the at least one processor to perform operations comprising:
scanning, via the livestock tag reader, an ear tag for an animal in the plurality of livestock, the ear tag hanging from an ear of the animal, the ear tag comprising a QR (Quick Response) tag on a portion of the ear tag hanging below the ear of the animal;
identifying, by comparison of the ear tag to the uniquely identified ear tags, a record of the animal within the database;
adding, to the record of the animal in the database, wherein the database is an InterPlanetary File System (IPFS) database:
(1) at least one of additional health data about the animal or location data about the animal; and
(2) further proof of life data of the animal generated by an implanted device on the animal and wirelessly transmitted to a mobile device, the proof of life data comprising a heart rate and a temperature of the animal, resulting in an updated record of the animal;
cryptographically signing the updated record of the animal using encryption, resulting in an encrypted signed updated record;
transmitting, via the network interface, the encrypted signed updated record to a network server which verifies that a cryptographic signature of the encrypted signed updated record corresponds to a cryptographic signature for the animal belonging to a first owner, wherein the encrypted signed updated record is added to a distributed ledger, the distributed ledger allowing only an owner of an NFT (Non-Fungible Token) associated with the animal to modify portions of the distributed ledger associated with the animal;
generating unique digital identity data for the animal, the unique digital identity data comprising a combination of:
images of the animal;
a unique Bluetooth identification associated with the implanted device; and
owner input,
the unique digital identity data being sent to a distributed ledger as part of a smart contract resulting in a non-fungible token (NFT) for the animal;
receiving, from the first owner, instructions to transfer ownership of the animal to a second owner;
transferring rights to update the record of the animal in the database from the first owner to the second owner;
transmitting, via the network interface, the encrypted signed updated record and the cryptographic signature to a decentralized database;
obtaining consensus from a plurality of other computing devices regarding adding the encrypted signed updated record to a blockchain; and
based on the consensus, adding the encrypted signed updated record to the NFT, wherein the adding of the encrypted signed updated record to the NFT comprises:
retrieving an existing reference of existing files attached to the NFT from the blockchain using a SHA-256 hash of the existing files as attached to ERC-721 metadata of the NFT;
inspecting new files to ensure that reference is made to the existing reference of existing files by inspecting a designated location in a JSON payload;
rejecting an update upon determining the new files do not include a reference to the existing files by reverting a blockchain transaction;
setting the new files as a NFT reference by setting the ERC-721 metadata to a SHA-256 hash of the new files; and
persisting the new files to the IPFS database.
2 . The system of claim 1 , wherein the ear tag further comprises a RFID (Radio Frequency Identification) tag, the livestock tag reader being configured to receive RFID tag.
3 . The system of claim 2 , the non-transitory computer-readable storage medium having additional instructions stored which, when executed by the processor, cause the processor to perform operations comprising:
receiving biometric data associated with the animal, the biometric data comprising identification generated from a recorded video;
receiving owner input from the first owner; and
generating digital identity data for the animal, the digital identity data comprising a combination of the biometric data, a unique Bluetooth identification associated with an implanted device on the animal, and the owner input,
wherein the identifying of the record is further performed by comparing the digital identity data to previously recorded digital identity data for the animal.
4 . The system of claim 1 , wherein the ear tag further comprises a NFC (Near Field Communication) tag, the livestock tag reader being configured to receive NFC tags.
5 . The system of claim 1 , wherein the ear tag further comprises a Bluetooth tag, the livestock tag reader being configured to receive Bluetooth tags.
6 . The system of claim 1 , wherein the encryption is asymmetrical encryption, and wherein the encrypted signed updated record is signed using a private key.
7 . The system of claim 1 , wherein the encryption is symmetrical encryption.
8 . The system of claim 1 , the non-transitory computer-readable storage medium having additional instructions stored which, when executed by the processor, cause the processor to perform operations comprising:
transmitting, via the network interface, the encrypted signed updated record and the cryptographic signature to decentralized database;
obtaining consensus from a plurality of other computing devices regarding adding the encrypted signed updated record to a blockchain; and
based on the consensus, adding the encrypted signed updated record to the blockchain.
9 . The system of claim 1 , wherein the database is an InterPlanetary File System (IPFS) database.
10 . A method for notarizing livestock records, comprising:
identifying, via at least one processor, records for a plurality of livestock and unique identifiers associated with each livestock in the plurality of livestock;
identifying, via the at least one processor, ownership records for the plurality of livestock, each ownership record within the ownership records having a cryptographic signature belonging to a first owner;
receiving, from a mobile device, an encrypted signed updated record having a cryptographic signature, the encrypted signed updated record having proof of life data associated with an animal within the plurality of livestock, wherein:
the proof of life data is generated by an implanted device on the animal, the implanted device wirelessly transmitting the proof of life data to a mobile device;
the proof of life data comprises a heart rate of the animal, a temperature of the animal, movement of the animal, and location of the animal; and
the implanted device hangs from an ear of the animal, the implanted device comprising a QR (Quick Response) tag on a portion of the implanted device hanging below the ear of the animal;
adding, to a record of the animal in a database, wherein the database is an InterPlanetary File System (IPFS) database, the proof of life data;
verifying, via the at least one processor, that the cryptographic signature of the encrypted signed updated record corresponds to the cryptographic signature of the first owner for the animal, resulting in a verification;
based on the verification, sending the encrypted signed updated record to a distributed ledger;
generating unique digital identity data for the animal, the unique digital identity data comprising a combination of:
images of the animal;
a unique Bluetooth identification associated with the implanted device; and
owner input,
the unique digital identity data being sent to the distributed ledger as part of a smart contract resulting in an ERC-721 non-fungible token (NFT) for the animal;
receiving, from the first owner, instructions to transfer ownership of the animal to a second owner;
transferring rights to update an animal-specific ownership record associated with the animal from the first owner to the second owner;
transmitting, via a network interface, the encrypted signed updated record and the cryptographic signature to a decentralized database;
obtaining consensus from a plurality of other computing devices regarding adding the encrypted signed updated record to a blockchain; and
based on the consensus, adding the encrypted signed updated record to the NFT, wherein the adding of the encrypted signed updated record to the NFT comprises:
retrieving an existing reference of existing files attached to the NFT from the blockchain using a SHA-256 hash of the existing files as attached to ERC-721 metadata of the NFT;
inspecting new files to ensure that reference is made to the existing reference of existing files by inspecting a designated location in a JSON payload;
rejecting an update upon determining the new files do not include a reference to the existing files by reverting a blockchain transaction;
setting the new files as a NFT reference by setting the ERC-721 metadata to a SHA-256 hash of the new files; and
persisting the new files to the IPFS database.
11 . The method of claim 10 , wherein the at least one processor are contained within a server.
12 . The method of claim 10 , wherein the at least one processor are executing a contract using a blockchain.
13 . The method of claim 12 , wherein the blockchain is Ethereum.
14 . The method of claim 10 , wherein the records for the plurality of livestock comprise health and location data for the animal over multiple periods of time.
15 . The method of claim 10 , wherein the cryptographic signature and an owner's cryptographic signature of the owner are a cryptographic hash.
16 . The method of claim 10 , wherein an owner's cryptographic signature of the owner is associated with more than one entity or individual.
17 . The method of claim 10 , wherein the encrypted signed updated record is received via a Low Power Wide Area Network (LPWAN).
18 . A non-transitory computer-readable storage medium having instructions stored which, when executed by at least one processor, causes the at least one processor to perform operations comprising:
identifying records for a plurality of livestock and unique identifiers associated with each livestock in the plurality of livestock;
identifying ownership records for the plurality of livestock, each ownership record within the ownership records having a cryptographic signature of a first owner;
receiving, from a mobile device, identification of an animal within the plurality of livestock, the identification determined by scanning an ear tag of the animal, the ear tag comprising a QR (Quick Response) tag on a first portion of the ear tag hanging below the ear of the animal;
receiving, from the mobile device, an encrypted signed updated record having a cryptographic signature, the encrypted signed updated record having proof of life data associated with the animal within the plurality of livestock, the proof of data comprising:
a heart rate of the animal;
a location of the animal;
movement of the animal; and
a temperature of the animal,
the proof of life data generated by a second portion of the ear tag extending through the ear of the animal;
adding, to a record of the animal in a database, wherein the database is an InterPlanetary File System (IPFS) database, the proof of life data;
verifying that the cryptographic signature of the encrypted signed updated record corresponds to the cryptographic signature of the first owner for the animal, resulting in a verification;
based on the verification, sending the encrypted signed updated record to a distributed ledger;
generating unique digital identity data for the animal, the unique digital identity data comprising a combination of:
images of the animal;
a unique Bluetooth identification associated with the ear tag; and
owner input,
the unique digital identity data being sent to the distributed ledger as part of a smart contract resulting in a non-fungible token (NFT) for the animal;
receiving, from the first owner, instructions to transfer ownership of the animal to a second owner;
transferring rights to update an animal-specific ownership record associated with the animal from the first owner to the second owner;
transmitting, via a network interface, the encrypted signed updated record and the cryptographic signature to a decentralized database;
obtaining consensus from a plurality of other computing devices regarding adding the encrypted signed updated record to a blockchain; and
based on the consensus, adding the encrypted signed updated record to the NFT, wherein the adding of the encrypted signed updated record to the NFT comprises:
retrieving an existing reference of existing files attached to the NFT from the blockchain using a SHA-256 hash of the existing files as attached to ERC-721 metadata of the NFT;
inspecting new files to ensure that reference is made to the existing reference of existing files by inspecting a designated location in a JSON payload;
rejecting an update upon determining the new files do not include a reference to the existing files by reverting a blockchain transaction;
setting the new files as a NFT reference by setting the ERC-721 metadata to a SHA-256 hash of the new files; and
persisting the new files to the IPFS database.
19 . The non-transitory computer-readable storage medium of claim 18 , wherein the at least one processor are contained within a server.
20 . The non-transitory computer-readable storage medium of claim 18 , wherein the at least one processor are executing a contract using a blockchain.