Sign the returned data using your private key or, for example, the PRVD Vault
Broadcast the data and signature to the network for retirement
To programmatically retire carbon using the ECO API, users first create a RetireCarbonRequest.
Parameterize a retire carbon request for signature and broadcast
After creating a parameterized request that can be used to retire the specified amount of carbon, the transaction needs to be signed. We designed the API in this manner to ensure users can enable self-custody in their implementations. The signature over the transaction data returned by the parameterize request provides flexibility for (i) broadcasting the transaction and bearing the network transaction costs or (ii) leveraging the Managed Transactions API to broadcast the transaction while maintaining the ability to verify the original signer (e.g., by using ecrecover).
An integrated code sample will be provided here shortly. You can see how we leverage the PRVD Vault to sign transactions for EVM-based networks here.
This final step in the process to programmatically retire carbon enables flexibility in systems and applications that would otherwise struggle to assemble, encode and broadcast transactions to the targeted network. The broadcast API accepts the unsigned data as returned by the Parameterize call and a hex-encoded signature.
The following code demonstrates how to broadcast parameterized and signed ECO transactions:
The broadcast method provides guarantees around atomicity and double-spend protection, ensuring each parameterized carbon retirement request is only executed once. Subsequent attempts to broadcast the same request will fail with a 422 status code. Here is an example response to an API call attempting to retire a parameterized transaction:
"message":"retire carbon request has already been broadcast; tx hash: 584205679a00025e927fc24ef0a3a5e726017392395e7d027b3936d7e644d0ca"
Fetch Carbon Retirement
You can retrieve details related to an existing RetireCarbonRequest, including links to generated certificates and verifiable credentials, if applicable.
Retrieve details related to an existing retire carbon request
Note that the returned RetireCarbonRequest details will contain a non-null tx_hash and cardinality if the request has been successfully broadcast to the network for settlement. The returned cardinality represents the serial position of the completed carbon retirement for the provider for the associated beneficiary_address.
Similarly, the certificate_href and verifiable_credentials_href fields will only be included in the response if the underlying RetireCarbonRequest has been successfully retired and the provider supports those resources on the settlement network.
Some provider implementations may support an additional certificate_href_alt field.