# What is this? [Estelle Flores](https://twitter.com/estelle_flores_/status/1765823852385300807) hallucination. TLDR: Using objkt.com's condition interface and a simple backend to achieve password unlockable drops. ## What are conditions? Conditions can be added to any marketplace listing, auction, open edition or gallery invites. A Condition is a smart contract adhering to the condition interface and can do anything a developer chooses. For example, a condition could: * mint tokens into a buyers wallet after they purchase a listing (e.g. $POLE) * check and update an allow-list * check ownership of a specific token * check if a token has a certain trait basedon a merkle proof * check an offchain fact signed by an authority * anything else that can be written in a smart contract ## Password To achieve password mints, I created a simple [Offchain Authority Condition](https://better-call.dev/mainnet/KT1DxfMANubocGoWwLEuAxrNF3uDo2N8HeUe/operations) and added it to my open edition listing [here](https://objkt.com/tokens/KT1GHrkrZEzypxBQLWvKuj5QNTVdd1Xcndxu/2) See transaction: [https://better-call.dev/mainnet/opg/opZ2mQTzirKBxa4QyHNqU3yWi8FhEHxYJvGimRDis19XE8vXMLN/contents](https://better-call.dev/mainnet/opg/opZ2mQTzirKBxa4QyHNqU3yWi8FhEHxYJvGimRDis19XE8vXMLN/contents) Adding this condition to the open edition listing now requires everyone trying to claim an edition to pass an extra parameter to the claim transaction (The `condition_extra` bytes). The open edition contract will then call the condition contract and it is up to the condition contract to fail if the passed payload is wrong. The payload passed to claim as `condition_extra` has the following structure: packed bytes of: `pair (signature %signature bytes %data)` where %data is packed bytes of `pair (pair (bytes %nonce) (bytes %campaign_id)) (pair (nat %amount) (address %target))` python implementation to get this data structure ```python from pytezos.michelson.parse import michelson_to_micheline from pytezos.michelson.types import MichelsonType from pytezos.crypto.key import Key def condition_extra( authority: Key, nonce: bytes, campaign_id: bytes, claimer: str, amount: int ) -> bytes: ty = MichelsonType.match( michelson_to_micheline("pair (pair bytes bytes) (pair nat address)") ) raw_data = ty.from_python_object((nonce, campaign_id, amount, claimer)).pack() signature = authority.sign(raw_data) ty = MichelsonType.match(michelson_to_micheline("pair signature bytes")) payload = ty.from_python_object((signature, raw_data)).pack() return payload ``` For example this is the payload used for this [transaction](https://better-call.dev/mainnet/opg/ooBTYKd3mzHCc49VtFdwZbAF4GpcwVzqgEp38FbVxYJx6QA3qei/contents): ``` 0507070a000000404cc50541dfbe0c07d83f59f9c85ec5a4ea95c04d61342b088061809e961a90e2b495885324f38d1d72e5d0189c9414ceaa41d1b51bc6894d06ca1b40e058aa000a0000004205070707070a00000004313233340a0000001095314ed72ec34ed59a8688401170c529070700010a00000016000032b7ad03806fc1ec76863deba77145ed46c98807 ``` The server implementation is super simple. It owns the authority key and simply checks a password and if it's correect produces the payload with the above code.