3

I wish to delegate access control with a Phone-As-A-Key DApp for vehicles (for sharing the vehicle, P2P rentals and more). When delegating access control, the DApp will update a smart contract which needs to be downloaded in the vehicle (so it knows a new user should be whitelisted and so they Phone as a Key will open the vehicle). Question: how many transactions do you foresee here and what shall the cost be. Obviously, we cannot have customers (or us) paying large amounts of ADA to delegate access control.

0

This is hard to answer without an intricate understanding of the business logic around the vehicle unlocking.

I assume each car has its own smart contract and you want to whitelist a user for a pre-determined time. For simplicity I assume that we're happy for time to be measured in slots, with the business logic working out time->slots happening off-chain. This would mean all we need to do is send a users identifier to the smart-contract with the time-frame. By checking the users time-frame against the node when unlocking the car you'd be able to limit this to a single transaction like:

{
    user  Address
    start Slot
    end   Slot
}

Another way to go would be to update a smart contract with Lock and Unlock events setting an Address value and checking this value against the users phone when they attempt to unlock the car. However this would require two transactions and constant internet access to receive the second event.

In terms of transaction spend, one of the perks of Plutus is that you can calculate the cost of a contract up-front and failed transactions don't cost anything. That way you can show the user the fee at the checkout without any surprises. It also means you can prototype this contract and check the cost yourself. As I said without really understanding how you want this contract to work it's difficult to come up with a $$$ value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.