I'm trying to create a NFT collection of 999 pieces. Out of this 999 pieces 23 will be reserved for early investors (they will receive a custom NFT). Because there is no way to mint a specific NFT (investor NFT) - I was advised to create 2 candy machines, one public which will be connected to the Candy Machine UI and one private which I will use to mint all investor NFTs and airdrop manually.
I set up the folder like this
./public-assets/ - NFTs for the Public Machine
./private-assets/ - NFTs for the Private Machine
./public-config.json - Configuration for the Public Machine
./private-config.json - Configuration for the Private Machine
Now in theory the public-assets directory will contain 976 assets and the private-assets directory will contain 23 NFTs and configurations will match that number.
I have a number of issues regarding this approach:
I have duplicate NFT numbers e.g. "Collection Name #0" (public mint)" = "Collection Name #0" (private mint) - even though the NFTs are different
Total number of items remaining on minting platform UI is 999 - 23 // this one I solved by modifying the candy machine UI to connect to the private machine and get the number of remaining items - but I don't know if there is a better way
The NFTs do not seem to be part of the same collection, even though the metadata attached to every asset has the same collection name and family
Would there be a better approach to this problem? And if so how can it solve all the issues I'm facing? TMy first stack overflow post, sorry if didn't provide enough details.
The duplicate NFT numbers means you didn't change the script/art engine you used to start incrementing at a later number to compensate for numbers already taken. By default Hashlips and other engines start their generative collections at #0.
Ideally you wanted Collection 1 to have metadata from #0 - #976 and then collection 2 metadata from #978 - #999.
You can easily modify collection 2's generated off chain data with a quick py or JS script (or langauge or your choice) to loop through and adjust the file collection names, or do it manually since it's only 23.
Once collection 2 is reuploaded to a new candymachine and minted these can then be merged to the larger collection by updating collection 2's metadata collection address to be the same as collection 1. This will then group everything under the same collection.
One of the major tools for updating Solana NFT's metadata is Metaboss.
https://metaboss.rs
In regards to the front end counter, if it works it works :P
What you do have to be careful with is the new bot tax. If for example the 2nd smaller candymachine doesn't sell out, but the UI on the front end still says 990/999 anyone who successfully attempts to mint at this point would be taxed 0.01 SOL because essentially the public machine is sold out but the private machine would have some remaining, but the numbers don't reflect this. So need to make sure your UI logic is onpoint and stops people from trying to mint when public machine does sell out.
you will have to take care of that on metadata generation / rename them before creating the candy machine
yes, best method is to either connect to the private machine, too or just hardcode the whole number.
You need to make sure that they are all part of the same on chain collection. The collection name and family in the off chain JSON does not matter for that.
To achieve that you can for example
create the first candy machine as normal. This will create a new collection
use this collection mint on upload of the second machine with -m <collection>. This will automatically make the minted NFTs part of that collection.
Related
I am trying to get the exact feature vector to save each fingerprint values in to the database. By according to the Adafruit library it display only the fingerprint template .But template is different for the same finger and I cannot identify the exact finger by matching from my client software.
Any help for this ? Any algorithm to convert this fingerprint template into feature vector or match each other.
Any method to get the character file (feature vector) from the fingerprint sensor ?
The algorithm for matching templates is unknown; the manufacturers did not release it probably because it's IP. You can't compare byte-by-byte because as you've discovered the generated template isn't always the same for the same finger. If you notice, there's a confidence value as well as different security levels implying there are different criteria for matching prints depending on the system parameters. The best you can probably do is store the templates on your database but use it as a second factor to authenticate users. What I mean is,
you can have a user enter some unique ID at a terminal and place their finger as well,
your Arduino queries your server with that ID as a key,
the server replies with the fingerprint template associated with that ID,
the Arduino forwards this template to the module and sends a command to perform a 1:1 match between the template just gotten from your database and the template just generated from the user's finger.
If they match, then you know you have the right user. Else, he's an impostor.
Or you can just make do with the local storage on the module and use your server only for assigning IDs during enrollment. If you still want to go ahead to get the character file from the module, you can try the UpChar command in the module's datasheet and see if you have any luck with it.
You can get the fingerprint templates using this library https://github.com/hmxmghl/Modified_AdafruitFingerprintSensor_Library
I am looking for alternative to GUIDs for key generation in a distributed app. For example supposed I have Bob, James, and Jack all running a bug tracking application on their desktop where they can do thing like create bug tickets ala JIRA, or Bugzilla ... etc. When a ticket is created it is assigned a number such as T-1, T-2, T-3, T-4 ... etc. Tickets need to have a stable ID and should be creatable without having to consult a central server.
I understand that this is what GUID's are really good for but it in my case displaying a GUID in a UI is ugly people can't just copy and paste it and discuss it on a phone call, I really want integers or some sort of short string that is easy to talk about read in one glance .. etc.
Is there a way to use the bitcoin block chain as some sort of counter?
You may evaluate the approach taken by git. They use sha1 hash of commit information. And then abbreviate IDs are allowed which are much shorter and easier to read\transfer manually.
Having the number of bugs in your tracker is not going to reach millions that should be sufficient. Once it is you'll just need a longer abbreviation.
There seem to be plenty info around on how git calculates hash IDs and abbreviates them.
If I recall correctly how UUIDv1 works - it's "just" putting together the mac address and a very exact timestamp + maybe some additional integer. As your mac address should be unique (unless you've fiddled with it) and there are only so many UUIDs one computer can generate within a nano second, the resulting ID will be unique.
This is a very general and uninformed way to create IDs. If you'd implement a version of it yourself for your specific use case you could get much smaller IDs.
Assuming you can identify each node with a bug tracking system with a simple and unique string - for instance "Bob", "James", "Jack" - and you can create unique continuous integers within each node, you could combine those two and have IDs like "Bob-1", "James-12", ...
As you can see, actually there has to be again one central point, which will assign the unique strings, however depending on the number of nodes and how long they stay within the system, this could be as well done just by a human being.
The additional disadvantage (or advantage, depends how you look at it) of this approach (as well as of UUIDv1) would be, that you'd know where the ticket has been created as well as order of the tickets within one system.
One hard working day I noticed that GUIDs I've been generating with usual .NET's Guid.NewGuid() method had the same number 4 in the beginning of the third block:
efeafa5f-fe21-4ab4-ba82-b9eefd5fa225
480b64d0-6762-4afe-8496-ac7cf3292898
397579c2-a4f4-4611-9fda-16e9c1e52d6a
...
There were ten of them appearing on the screen once a second or so. I've kept my eye on this pattern right after the fifth GUID. Finally, the last one had the same four bits inside and I've decided that I'm a lucky guy. I went home and felt that the whole world is opened for such an exceptional person as me. Next week I found a new work, cleaned my room and made a call to my parents.
But today I've faced the same pattern again. Thousand times. And I don't feel the Chosen One anymore.
I've googled it and now I know about UUID and a canonical format with 4 reserved bits for version and 2 for variant.
Here's a snippet to experiment with:
static void Main(string[] args)
{
while (true)
{
var g = Guid.NewGuid();
Console.WriteLine(BitConverter.ToString(g.ToByteArray()));
Console.WriteLine(g.ToString());
Console.ReadLine();
}
}
But still there is one thing I don't understand (except how to go on living). Why do we need these reserved bits? I see how it can harm - exposing internal implementation details, more collisions (still nothing to worry about, but one day...), more suicides - but I don't see any benefit. Can you help me to find any?
It is so that if you update the algorithm you can change that number. Otherwise 2 different algorithms could produce the exact same UUID for different reasons, leading to a collision. It is a version identifier.
For example, consider a contrived simplistic UUID format:
00000000-00000000
time - ip
now suppose we change that format for some reason to:
00000000-00000000
ip - time
This could generate a collision when a machine with IP 12.34.56.78 generates a UUID using the first method at time 01234567, and later a second machine with IP 01.23.45.67 generates a UUID at time 12345678 using the newer method. But if we reserve some bits for a version identifier, this cannot possibly cause a collision.
The value 4 specifically refers to a randomly generated UUID (therefore it relies on the miniscule chance of collisions given so many bits) rather than other methods which could use combinations of the time, mac address, pid, or other sorts of time & space identifiers to guarantee uniqueness.
See here for the relevant spec: https://www.rfc-editor.org/rfc/rfc4122#section-4.1.3
I am kind of a newbie at programming (have worked a bit with Delphi years back) but have started to build an application for Windows Phone 7.5 Mango, as I have a great idea for an app :D
In the application the user should be able to pick different locations from a list (a very large list, 5k+ items) - to make sure that all users always get the latest list, I have created a SQL on my website to generate the list as XML - which I load to the application via httpwebrequest; I am not quite sure what best practise is when dealing with a large list, which will be updated frequently etc.?
That is not the main question thou, because this seems to work pretty okay - my real question is, how to add a search function to my application, so the user can search for a location instead of scrolling throug the entire list?
My SQL is build up with ID, Country, State, Region, City (and a few more irrelevant tables for a search function).
I do not know what the best way to approach this is? Should I make a query on my website and generate the result as XML and use httpwebrequest to get the result to the phone - or should it be a search function on the device to search the entire list? And if so, how do I do that?
Thank you ;-)
First of all I have to inform you that fetching an list with over 5k+ items via a smartphone that not are using Wireless Network, will take a while. So, acrording to me there would be a huge waste of traffic to download the whole list if the user only are interested in a few items. This basically means that you are downloading a bunch of date but only are using 0,01% of it which is not the way you should build a program.
So, acording to me you should make an webservice so that the user can call the webservice and make a http request using its search parameter. And then you basically just use the parameter in an SQL Search Query, which could be an stored procedure or just bare in code, but I don't know how your server/database is build and structed so you can basically choose that whatever.
Here is an example:
SELECT * FROM TABLE_NAME WHERE (ID=#ID) OR (Country=#Country) OR (State=#State) OR (Region=#Region) OR (City=#City)
If i would have done this application I would have had two parameters. One that are representing the user input, in other words the search text and one that explains what the serach parameter is. (ID, Country, State, Region or City?).
You have to register your handle function for TextBox.TextChanged with some logic to filter queries that happens too often (for example typing name John may cause 4 requests: J, Jo, Joh, John). It can be done by using System.Threading.Timer with delayed start and changing it starting time when user types new character (if you need example - ask).
Then I recommend you to use WCF service to "talk" with SQL database. On WCF service use any ORM (Entity framework is simplest) to query you database.
I am trying to create a unique CD-KEY to put in our product's box, just like a normal CD-KEY found in standard software boxes that users use to register the product.
However we are not selling software, we are selling DNA collection kit for criminal and medical purposes. Users will receive a saliva collection kit by mail with the CD-KEY on it and they will use that CD-KEY to create an account on our website and get their results. The results from the test will be linked to the CD-KEY. This is the only way that we will have to link the results to the patients. It is therefore important that it does not fail :)
One of the requirements would be that the list of CD-KEYs must be sufficiently "spread" apart so that there is no possibility of someone entering an incorrect CD-KEY and still having it approved for someone else kit, thereby mixing up two kits. That could cost us thousands of dollars in liability.
For example, it cannot be a incremental sequence of numbers such as
00001
00002
00003
...
The reason is that if someone receives the kit 00002, but registers it as 000003 by accident, then his results will be matched to someone else. So it must be like credit card numbers... Unless a valid sequence is entered, your chances of randomly hitting a valid number is 1 in a million...
Also, we are selling over 50,000 kits annually to various providers (who will generate their own CD-KEYS using our algorithm) so we cannot maintain a list of all previously issued CD-KEYS to check for duplicate. The algorithm must generate unique CD-KEYs.
We also require the ability to verify that the CD-KEY is valid using a quick check algorithm, so that we can inform the user if the code he enters is invalid. This leaves out many hashing or MD5 algorithms I believe. And it cannot be a 128 bit because, who would take that time to type it out on the computer screen?
So far this is what I was thinking the final CD-KEY structure would look like
(4 char product code) - (4 char reseller code) - (12 char unique, verifiable CD-KEY)
Ex. 384A - GTLD - {4565 - FR54 - EDF3}
To insure the uniqueness of the KEYS, I could include the current date (20090521) as part of the source. We wont generate unique keys more than once a week, so this value changes often enough for the purpose of unique initial value.
What possible algorithm can I use to generate the unique keys?
Create the strings <providername>000001, <providername>000002, etc. or whatever and encrypt them with a public key, and that's your "CD-KEY" that the user enters. Decrypt the CD-KEY with the private key and validate that when decrypted you get a valid string with a valid provider name.
Credit Card numbers use the Luhn algorithm you might want to look at something similar to that.
I use SeriousBit Ellipter link for software protection but I don't see any reason you could generate a group of unique keys each week and us the library to verify the key validity when entered into your web site. You can also encode optional services into the key allow you to control how the sample is processed from the key (that's if you have different service levels).
As it uses an encrypted method of key generation in the first place and it's relatively cheap, it's certainly worth a look I would say.
I finally settled for a cd-key of this form
<TIMESTAMP>-<incremented number>-<8 char MD5 hash>-<checksumdigit>
I used the mod 11 ISBN checksum digit algorithm.
Generate GUID and catenate a random number to it. GUID is guaranteed to be unique and random number will make it improbable to hit a code accidentally. Just don't modify the GUID in any way or you might compromise the uniqueness.
http://msdn.microsoft.com/en-us/library/aa475087.aspx